1、用户导入;
2、用户角色支持多个; 3、单位资质;
This commit is contained in:
@@ -4,86 +4,91 @@
|
||||
<html>
|
||||
<head runat="server">
|
||||
<title>角色管理</title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="角色管理" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="RoleId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="RoleId" AllowSorting="true" SortField="RoleCode"
|
||||
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="名称" ID="txtRoleName" EmptyText="输入查询条件"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="类型" ID="txtRoleTypeName" EmptyText="输入查询条件"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px">
|
||||
</f:TextBox>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server" Hidden ="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center"/>
|
||||
<f:RenderField Width="100px" ColumnID="RoleCode" DataField="RoleCode"
|
||||
SortField="RoleCode" FieldType="String" HeaderText="编码" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="RoleName" DataField="RoleName" EnableFilter="true"
|
||||
SortField="RoleName" FieldType="String" HeaderText="名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="IsOfficeName" DataField="IsOfficeName" EnableFilter="true"
|
||||
SortField="IsOfficeName" FieldType="String" HeaderText="类型" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<%-- <f:RenderField Width="90px" ColumnID="RoleType" DataField="RoleType" EnableFilter="true"
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="角色管理" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="RoleId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="RoleId" AllowSorting="true" SortField="RoleCode"
|
||||
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="名称" ID="txtRoleName" EmptyText="输入查询条件"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px">
|
||||
</f:TextBox>
|
||||
<%--<f:TextBox runat="server" Label="类型" ID="txtRoleTypeName" EmptyText="输入查询条件"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px">
|
||||
</f:TextBox>--%>
|
||||
<f:DropDownList ID="dpRoleType" runat="server" Label="类型" LabelAlign="Right" EnableEdit="true" LabelWidth="80px" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
|
||||
<f:ListItem Text="-请选择-" Value="" />
|
||||
<f:ListItem Text="本部角色" Value="1" />
|
||||
<f:ListItem Text="项目角色" Value="0" />
|
||||
</f:DropDownList>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||
<f:RenderField Width="100px" ColumnID="RoleCode" DataField="RoleCode"
|
||||
SortField="RoleCode" FieldType="String" HeaderText="编码" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="RoleName" DataField="RoleName" EnableFilter="true"
|
||||
SortField="RoleName" FieldType="String" HeaderText="名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="IsOfficeName" DataField="IsOfficeName" EnableFilter="true"
|
||||
SortField="IsOfficeName" FieldType="String" HeaderText="类型" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<%-- <f:RenderField Width="90px" ColumnID="RoleType" DataField="RoleType" EnableFilter="true"
|
||||
SortField="RoleType" FieldType="String" HeaderText="级别" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>--%>
|
||||
<f:CheckBoxField Width="100px" RenderAsStaticField="true" TextAlign="Center" DataField="IsSystemBuilt" HeaderText="内置" />
|
||||
<f:CheckBoxField Width="80px" RenderAsStaticField="true" TextAlign="Center" DataField="IsAuditFlow" HeaderText="参与审批" />
|
||||
<f:RenderField ColumnID="Def" DataField="Def" SortField="Def" FieldType="String" Width="150px"
|
||||
HeaderText="备注" HeaderTextAlign="Center" TextAlign="Left" >
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="角色管理" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Self" EnableResize="false" runat="server" IsModal="true"
|
||||
Width="700px" Height="400px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
runat="server" Text="编辑" Hidden ="true" Icon="Pencil">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" Icon="Delete"
|
||||
ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除" Hidden ="true">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
<f:CheckBoxField Width="100px" RenderAsStaticField="true" TextAlign="Center" DataField="IsSystemBuilt" HeaderText="内置" />
|
||||
<f:CheckBoxField Width="80px" RenderAsStaticField="true" TextAlign="Center" DataField="IsAuditFlow" HeaderText="参与审批" />
|
||||
<f:RenderField ColumnID="Def" DataField="Def" SortField="Def" FieldType="String" Width="150px"
|
||||
HeaderText="备注" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
</Listeners>
|
||||
<PageItems>
|
||||
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
|
||||
</f:ToolbarSeparator>
|
||||
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
|
||||
</f:ToolbarText>
|
||||
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
|
||||
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
|
||||
</f:DropDownList>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="角色管理" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Self" EnableResize="false" runat="server" IsModal="true"
|
||||
Width="700px" Height="400px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
runat="server" Text="编辑" Hidden="true" Icon="Pencil">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" Icon="Delete"
|
||||
ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除" Hidden="true">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/jscript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
////权限按钮方法
|
||||
@@ -39,14 +39,20 @@
|
||||
{
|
||||
string strSql = @"SELECT Roles.RoleId,Roles.RoleName,Roles.RoleCode,Roles.Def,Roles.IsSystemBuilt,IsAuditFlow"
|
||||
+ @" ,(CASE WHEN IsOffice=1 THEN '本部角色' ELSE '项目角色' END) AS IsOfficeName"
|
||||
+ @" FROM dbo.Sys_Role AS Roles "
|
||||
+ @" FROM dbo.Sys_Role AS Roles "
|
||||
+ @" WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (!string.IsNullOrEmpty(this.txtRoleName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND RoleName LIKE @RoleName";
|
||||
listStr.Add(new SqlParameter("@RoleName", "%" + this.txtRoleName.Text.Trim() + "%"));
|
||||
}
|
||||
}
|
||||
var roleType = this.dpRoleType.SelectedValue;
|
||||
if (!string.IsNullOrWhiteSpace(roleType))
|
||||
{
|
||||
strSql += " AND IsOffice = @RoleType";
|
||||
listStr.Add(new SqlParameter("@RoleType", roleType));
|
||||
}
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
@@ -55,7 +61,7 @@
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
|
||||
#region 删除数据
|
||||
/// <summary>
|
||||
/// 右键删除事件
|
||||
@@ -84,7 +90,7 @@
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, roles.RoleCode, roles.RoleId, Const.RoleMenuId, Const.BtnDelete);
|
||||
BLL.RoleService.DeleteRole(rowID);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,7 +108,7 @@
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
@@ -160,7 +166,7 @@
|
||||
}
|
||||
string Id = Grid1.SelectedRowID;
|
||||
var roles = BLL.RoleService.GetRoleByRoleId(Id);
|
||||
if (roles != null && (!roles.IsSystemBuilt.HasValue || roles.IsSystemBuilt == false || this.CurrUser.UserId == BLL.Const.sysglyId ))
|
||||
if (roles != null && (!roles.IsSystemBuilt.HasValue || roles.IsSystemBuilt == false || this.CurrUser.UserId == BLL.Const.sysglyId))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RoleListEdit.aspx?roleId={0}", Id, "编辑 - ")));
|
||||
}
|
||||
@@ -188,7 +194,7 @@
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
@@ -222,7 +228,7 @@
|
||||
{
|
||||
content = "该角色已在【用户信息】中使用,不能删除!";
|
||||
}
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty(content))
|
||||
{
|
||||
return true;
|
||||
|
||||
+24
-22
@@ -7,11 +7,13 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.SysManage {
|
||||
|
||||
|
||||
public partial class RoleList {
|
||||
|
||||
namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
|
||||
|
||||
public partial class RoleList
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtRoleName 控件。
|
||||
/// </summary>
|
||||
@@ -65,16 +67,16 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRoleName;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtRoleTypeName 控件。
|
||||
/// dpRoleType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRoleTypeName;
|
||||
|
||||
protected global::FineUIPro.DropDownList dpRoleType;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
@@ -92,7 +94,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
@@ -101,7 +103,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
@@ -110,7 +112,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
@@ -119,7 +121,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
@@ -128,7 +130,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
@@ -137,7 +139,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
@@ -146,7 +148,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -7,8 +7,7 @@
|
||||
<title>导入人员信息</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.f-grid-row .f-grid-cell-inner
|
||||
{
|
||||
.f-grid-row .f-grid-cell-inner {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
@@ -16,112 +15,78 @@
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="审核" ValidateForms="SimpleForm1"
|
||||
OnClick="btnAudit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载模板" OnClick="btnDownLoad_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
|
||||
LabelWidth="150px">
|
||||
</f:FileUpload>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" EnableCollapse="true" runat="server"
|
||||
EnableColumnLines="true" BoxFlex="1" DataKeyNames="RCount" AllowCellEditing="true"
|
||||
ClicksToEdit="2" DataIDField="RCount" AllowSorting="true" SortField="RCount"
|
||||
PageSize="50" Height="360px">
|
||||
<Columns>
|
||||
<f:TemplateField Width="55px" HeaderText="序号">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField Width="80px" ColumnID="RCount" DataField="RCount" FieldType="Int"
|
||||
HeaderText="行号" HeaderTextAlign="Center" TextAlign="Right">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="UserCode" DataField="UserCode" FieldType="String"
|
||||
HeaderText="用户编号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="UserName" DataField="UserName"
|
||||
SortField="UserName" FieldType="String" HeaderText="人员姓名" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="80px" ColumnID="Account" DataField="Account"
|
||||
SortField="Account" FieldType="String" HeaderText="账号" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="220px" ColumnID="UnitName" DataField="UnitName" FieldType="String"
|
||||
HeaderText="单位" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="DepartName" DataField="DepartName" FieldType="String"
|
||||
HeaderText="部门" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="RoleName" DataField="RoleName" FieldType="String"
|
||||
HeaderText="角色" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="IdentityCard" DataField="IdentityCard" SortField="IdentityCard"
|
||||
FieldType="String" HeaderText="身份证号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="Telephone" DataField="Telephone" SortField="Telephone"
|
||||
FieldType="String" HeaderText="手机号码" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:CheckBoxField Width="60px" SortField="IsPost" RenderAsStaticField="true" DataField="IsPost"
|
||||
HeaderText="在岗" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:CheckBoxField>
|
||||
<f:CheckBoxField Width="60px" SortField="IsOffice" RenderAsStaticField="true" DataField="IsOffice"
|
||||
HeaderText="本部" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:CheckBoxField>
|
||||
<f:RenderField Width="80px" ColumnID="MainCNProfessionalName" DataField="MainCNProfessionalName" FieldType="String"
|
||||
HeaderText="主专业" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="ViceCNProfessionalName" DataField="ViceCNProfessionalName" FieldType="String"
|
||||
HeaderText="副专业" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:HiddenField ID="hdFileName" runat="server">
|
||||
</f:HiddenField>
|
||||
<f:HiddenField ID="hdCheckResult" runat="server">
|
||||
</f:HiddenField>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Label ID="lblBottom" runat="server" Text="说明:1 人员信息导入模板为.xls后缀的EXCEL文件,黑体字为必填项。2 身份证号码必须为15或18位,所属单位、角色等必须与基础信息中对应类型的名称一致,否则无法导入。3 如需修改已有人员信息,请到系统中修改。4 数据审核后,点击“保存”,即可完成人员信息导入。">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
<f:Window ID="Window1" Title="审核人员信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="false"
|
||||
CloseAction="HidePostBack" Width="900px" Height="600px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="导入人员信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window2_Close" IsModal="false"
|
||||
CloseAction="HidePostBack" Width="900px" Height="600px">
|
||||
</f:Window>
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="审核" ValidateForms="SimpleForm1"
|
||||
OnClick="btnAudit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载模板" OnClick="btnDownLoad_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
|
||||
LabelWidth="150px">
|
||||
</f:FileUpload>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Grid ID="gvErrorInfo" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="导入人员信息" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" AllowCellEditing="true" ClicksToEdit="2" AllowSorting="true"
|
||||
SortDirection="DESC" EnableColumnLines="true" ForceFit="true" AllowPaging="false" IsDatabasePaging="false" PageSize="10"
|
||||
EnableRowDoubleClickEvent="true" AllowFilters="true" EnableTextSelection="True" Height="400">
|
||||
<Columns>
|
||||
<f:TemplateField ColumnID="tfPageIndex" Width="40px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
|
||||
EnableLock="true" Locked="False">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblPageIndex" runat="server" Text='<%# gvErrorInfo.PageIndex * gvErrorInfo.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:BoundField DataField="Row" HeaderText="错误行号" Width="50px">
|
||||
</f:BoundField>
|
||||
<f:BoundField DataField="Column" HeaderText="错误列" Width="100px">
|
||||
</f:BoundField>
|
||||
<f:BoundField DataField="Reason" HeaderText="错误类型" MinWidth="220px">
|
||||
</f:BoundField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:HiddenField ID="hdFileName" runat="server">
|
||||
</f:HiddenField>
|
||||
<f:HiddenField ID="hdCheckResult" runat="server">
|
||||
</f:HiddenField>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Label ID="lblBottom" runat="server" Text="说明:1 人员信息导入模板为.xls后缀的EXCEL文件,有填充色项为必填项。2 身份证号码必须为15或18位,所属单位、角色等必须与基础信息中对应类型的名称一致,否则无法导入。3 如需修改已有人员信息,请到系统中修改。4 数据审核后,点击“保存”,即可完成人员信息导入。">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
<f:Window ID="Window1" Title="审核人员信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="false"
|
||||
CloseAction="HidePostBack" Width="900px" Height="600px">
|
||||
</f:Window>
|
||||
<%--<f:Window ID="Window2" Title="导入人员信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window2_Close" IsModal="false"
|
||||
CloseAction="HidePostBack" Width="900px" Height="600px">
|
||||
</f:Window>--%>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -6,6 +6,8 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web.UI;
|
||||
using BLL;
|
||||
using FineUIPro.Web.HSSE.PostTraining;
|
||||
using Model;
|
||||
|
||||
namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
@@ -22,10 +24,17 @@ namespace FineUIPro.Web.SysManage
|
||||
/// </summary>
|
||||
public static List<Model.View_Sys_User> userViews = new List<Model.View_Sys_User>();
|
||||
|
||||
///// <summary>
|
||||
///// 错误集合
|
||||
///// </summary>
|
||||
//public static string errorInfos = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 错误集合
|
||||
/// </summary>
|
||||
public static string errorInfos = string.Empty;
|
||||
public static List<Model.ErrorInfo> errorInfos = new List<Model.ErrorInfo>();
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
@@ -44,7 +53,11 @@ namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
userViews.Clear();
|
||||
}
|
||||
errorInfos = string.Empty;
|
||||
if (errorInfos != null)
|
||||
{
|
||||
errorInfos.Clear();
|
||||
}
|
||||
//errorInfos = string.Empty;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
@@ -74,10 +87,14 @@ namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
userViews.Clear();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(errorInfos))
|
||||
if (errorInfos != null)
|
||||
{
|
||||
errorInfos = string.Empty;
|
||||
errorInfos.Clear();
|
||||
}
|
||||
//if (!string.IsNullOrWhiteSpace(errorInfos))
|
||||
//{
|
||||
// errorInfos = string.Empty;
|
||||
//}
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initFullPath = rootPath + initPath;
|
||||
if (!Directory.Exists(initFullPath))
|
||||
@@ -159,6 +176,7 @@ namespace FineUIPro.Web.SysManage
|
||||
ir = pds.Rows.Count;
|
||||
if (pds != null && ir > 0)
|
||||
{
|
||||
var users = from x in Funs.DB.View_Sys_User select x;
|
||||
var units = from x in Funs.DB.Base_Unit select x;
|
||||
var roles = from x in Funs.DB.Sys_Role select x;
|
||||
var departs = from x in Funs.DB.Base_Depart select x;
|
||||
@@ -183,22 +201,44 @@ namespace FineUIPro.Web.SysManage
|
||||
ViceCNProfessionalName = pds.Rows[i][11].ToString().Trim()
|
||||
};
|
||||
|
||||
if (string.IsNullOrEmpty(newSysUser.UserName))
|
||||
if (string.IsNullOrWhiteSpace(newSysUser.UserCode))
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "人员姓名" + "," + "此项为必填项!" + "|";
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "员工编号", Reason = "此项为必填项!" });
|
||||
}
|
||||
if (string.IsNullOrEmpty(newSysUser.Account))
|
||||
else
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "登录账号" + "," + "此项为必填项!" + "|";
|
||||
//判断人员编号是否存在
|
||||
bool isexist = users.Where(x => x.UserCode == newSysUser.UserCode).Any();
|
||||
if (isexist)
|
||||
{
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "员工编号", Reason = $"已存在编号为[{newSysUser.UserCode}]的人员!" });
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(newSysUser.IdentityCard))
|
||||
{
|
||||
//判断人员编号是否存在
|
||||
bool isexist = users.Where(x => x.IdentityCard == newSysUser.IdentityCard).Any();
|
||||
if (isexist)
|
||||
{
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "身份证号", Reason = $"已存在身份证号为[{newSysUser.IdentityCard}]的人员!" });
|
||||
}
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(newSysUser.UserName))
|
||||
{
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "人员姓名", Reason = "此项为必填项!" });
|
||||
}
|
||||
if (string.IsNullOrWhiteSpace(newSysUser.Account))
|
||||
{
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "登录账号", Reason = "此项为必填项!" });
|
||||
}
|
||||
|
||||
string unitName = newSysUser.UnitName;
|
||||
if (!string.IsNullOrEmpty(unitName))
|
||||
if (!string.IsNullOrWhiteSpace(unitName))
|
||||
{
|
||||
var unit = units.FirstOrDefault(e => e.UnitName == unitName);
|
||||
if (unit == null)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "单位" + "," + "[" + unitName + "]不在单位表中!" + "|";
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "单位", Reason = $"[{unitName}]不在单位表中!" });
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -208,52 +248,78 @@ namespace FineUIPro.Web.SysManage
|
||||
}
|
||||
else
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "单位" + "," + "此项为必填项!" + "|";
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "单位", Reason = "此项为必填项!" });
|
||||
}
|
||||
|
||||
string departName = newSysUser.DepartName;
|
||||
if (!string.IsNullOrEmpty(departName))
|
||||
if (!string.IsNullOrWhiteSpace(departName))
|
||||
{
|
||||
var depart = departs.FirstOrDefault(e => e.DepartName == departName);
|
||||
if (depart == null)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "部门" + "," + "[" + departName + "]不在部门表中!" + "|";
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "部门", Reason = $"[{departName}]不在部门表中!" });
|
||||
}
|
||||
else
|
||||
{
|
||||
newSysUser.DepartId = depart.DepartId;
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "部门" + "," + "此项为必填项!" + "|";
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "部门", Reason = "此项为必填项!" });
|
||||
}
|
||||
|
||||
string roleName = newSysUser.RoleName;
|
||||
var role = roles.FirstOrDefault(e => e.RoleName == roleName);
|
||||
if (role == null)
|
||||
string roleIds = string.Empty;
|
||||
string roleNames = string.Empty;
|
||||
if (!string.IsNullOrWhiteSpace(roleName))
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "角色" + "," + "[" + roleName + "]错误!" + "|";
|
||||
}
|
||||
else
|
||||
{
|
||||
newSysUser.RoleId = role.RoleId;
|
||||
newSysUser.RoleName = role.RoleName;
|
||||
var roleNameList = roleName.Split(',');
|
||||
string errRoleName = string.Empty;
|
||||
foreach (var rol in roleNameList)
|
||||
{
|
||||
var role = roles.FirstOrDefault(e => e.RoleName == rol);
|
||||
if (role == null)
|
||||
{
|
||||
errRoleName = !string.IsNullOrWhiteSpace(errRoleName) ? $"{errRoleName},{rol}" : rol;
|
||||
}
|
||||
else
|
||||
{
|
||||
roleIds = !string.IsNullOrWhiteSpace(roleIds) ? $"{roleIds},{role.RoleId}" : role.RoleId;
|
||||
roleNames = !string.IsNullOrWhiteSpace(roleNames) ? $"{roleNames},{role.RoleName}" : role.RoleName;
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(errRoleName))
|
||||
{
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "角色", Reason = $"[{errRoleName}]不在角色表中!" });
|
||||
}
|
||||
}
|
||||
newSysUser.RoleId = roleIds;
|
||||
newSysUser.RoleName = roleNames;
|
||||
|
||||
//var role = roles.FirstOrDefault(e => e.RoleName == roleName);
|
||||
//if (role == null)
|
||||
//{
|
||||
// result += "第" + (i + 2).ToString() + "行," + "角色" + "," + "[" + roleName + "]错误!" + "|";
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// newSysUser.RoleId = role.RoleId;
|
||||
// newSysUser.RoleName = role.RoleName;
|
||||
//}
|
||||
|
||||
if (!newSysUser.IsPost.HasValue)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "在岗" + "," + "此项为必填项!" + "|";
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "在岗", Reason = "此项为必填项!" });
|
||||
}
|
||||
|
||||
string mainCNProfessionalName = newSysUser.MainCNProfessionalName;
|
||||
if (!string.IsNullOrEmpty(mainCNProfessionalName))
|
||||
if (!string.IsNullOrWhiteSpace(mainCNProfessionalName))
|
||||
{
|
||||
var cNProfessional = cNProfessionals.FirstOrDefault(e => e.ProfessionalName == mainCNProfessionalName);
|
||||
if (cNProfessional == null)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "主专业" + "," + "[" + mainCNProfessionalName + "]不在专业表中!" + "|";
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "主专业", Reason = $"[{mainCNProfessionalName}]不在专业表中!" });
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -262,20 +328,22 @@ namespace FineUIPro.Web.SysManage
|
||||
}
|
||||
|
||||
string viceCNProfessionalName = newSysUser.ViceCNProfessionalName;
|
||||
if (!string.IsNullOrEmpty(viceCNProfessionalName))
|
||||
if (!string.IsNullOrWhiteSpace(viceCNProfessionalName))
|
||||
{
|
||||
string viceCNProfessionalId = string.Empty;
|
||||
bool hasErr = false;
|
||||
string[] strs = viceCNProfessionalName.Split(',');
|
||||
string errViceCNProfessionalName = string.Empty;
|
||||
foreach (var item in strs)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(item))
|
||||
if (!string.IsNullOrWhiteSpace(item))
|
||||
{
|
||||
var cNProfessional = cNProfessionals.FirstOrDefault(e => e.ProfessionalName == item);
|
||||
if (cNProfessional == null)
|
||||
{
|
||||
hasErr = true;
|
||||
result += "第" + (i + 2).ToString() + "行," + "副专业" + "," + "[" + item + "]不在专业表中!" + "|";
|
||||
//result += "第" + (i + 2).ToString() + "行," + "副专业" + "," + "[" + item + "]不在专业表中!" + "|";
|
||||
errViceCNProfessionalName = !string.IsNullOrWhiteSpace(errViceCNProfessionalName) ? $"{errViceCNProfessionalName},{item}" : item;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -283,7 +351,11 @@ namespace FineUIPro.Web.SysManage
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(viceCNProfessionalId))
|
||||
if (!string.IsNullOrWhiteSpace(errViceCNProfessionalName))
|
||||
{
|
||||
errorInfos.Add(new ErrorInfo { Row = (i + 2).ToString(), Column = "副专业", Reason = $"[{errViceCNProfessionalName}]不在专业表中!" });
|
||||
}
|
||||
if (!string.IsNullOrWhiteSpace(viceCNProfessionalId))
|
||||
{
|
||||
viceCNProfessionalId = viceCNProfessionalId.Substring(0, viceCNProfessionalId.Length - 1);
|
||||
}
|
||||
@@ -296,31 +368,22 @@ namespace FineUIPro.Web.SysManage
|
||||
///加入用户视图
|
||||
userViews.Add(newSysUser);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
if (errorInfos.Any())
|
||||
{
|
||||
userViews.Clear();
|
||||
result = result.Substring(0, result.LastIndexOf("|"));
|
||||
errorInfos = result;
|
||||
Alert alert = new Alert
|
||||
{
|
||||
Message = result,
|
||||
Target = Target.Self
|
||||
};
|
||||
alert.Show();
|
||||
this.gvErrorInfo.DataSource = errorInfos;
|
||||
this.gvErrorInfo.DataBind();
|
||||
}
|
||||
else
|
||||
{
|
||||
errorInfos = string.Empty;
|
||||
if (userViews.Count > 0)
|
||||
errorInfos.Clear();
|
||||
if (!userViews.Any())
|
||||
{
|
||||
this.Grid1.Hidden = false;
|
||||
this.Grid1.DataSource = userViews;
|
||||
this.Grid1.DataBind();
|
||||
Alert.ShowInTop("审核完成,请点击保存!", MessageBoxIcon.Success);
|
||||
Alert.ShowInTop("导入数据为空!", MessageBoxIcon.Warning);
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert.ShowInTop("导入数据为空!", MessageBoxIcon.Warning);
|
||||
ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -341,7 +404,7 @@ namespace FineUIPro.Web.SysManage
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(errorInfos))
|
||||
if (!errorInfos.Any())
|
||||
{
|
||||
int a = userViews.Count();
|
||||
int insertCount = 0;
|
||||
@@ -354,19 +417,19 @@ namespace FineUIPro.Web.SysManage
|
||||
UserName = userViews[i].UserName,
|
||||
Account = userViews[i].Account,
|
||||
UnitId = userViews[i].UnitId,
|
||||
DepartId=userViews[i].DepartId,
|
||||
DepartId = userViews[i].DepartId,
|
||||
RoleId = userViews[i].RoleId,
|
||||
IdentityCard = userViews[i].IdentityCard,
|
||||
Telephone = userViews[i].Telephone,
|
||||
IsPost = userViews[i].IsPost,
|
||||
IsOffice = userViews[i].IsOffice,
|
||||
MainCNProfessionalId=userViews[i].MainCNProfessionalId,
|
||||
ViceCNProfessionalId=userViews[i].ViceCNProfessionalId,
|
||||
MainCNProfessionalId = userViews[i].MainCNProfessionalId,
|
||||
ViceCNProfessionalId = userViews[i].ViceCNProfessionalId,
|
||||
};
|
||||
var getUser = Funs.DB.Sys_User.FirstOrDefault(x => x.Account == userViews[i].Account);
|
||||
if (getUser == null)
|
||||
{
|
||||
newUser.Password = Funs.EncryptionPassword(Const.Password);
|
||||
newUser.Password = Funs.EncryptionPassword(Const.Password);
|
||||
newUser.RawPassword = Const.Password;
|
||||
BLL.UserService.AddUser(newUser);
|
||||
insertCount++;
|
||||
@@ -396,24 +459,24 @@ namespace FineUIPro.Web.SysManage
|
||||
#endregion
|
||||
|
||||
#region 关闭弹出窗口
|
||||
/// <summary>
|
||||
/// 关闭导入弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
if (Session["sysUsers"] != null)
|
||||
{
|
||||
userViews = Session["sysUsers"] as List<Model.View_Sys_User>;
|
||||
}
|
||||
if (userViews.Count > 0)
|
||||
{
|
||||
this.Grid1.Hidden = false;
|
||||
this.Grid1.DataSource = userViews;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
}
|
||||
///// <summary>
|
||||
///// 关闭导入弹出窗口
|
||||
///// </summary>
|
||||
///// <param name="sender"></param>
|
||||
///// <param name="e"></param>
|
||||
//protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
//{
|
||||
// if (Session["sysUsers"] != null)
|
||||
// {
|
||||
// userViews = Session["sysUsers"] as List<Model.View_Sys_User>;
|
||||
// }
|
||||
// if (userViews.Count > 0)
|
||||
// {
|
||||
// this.Grid1.Hidden = false;
|
||||
// this.Grid1.DataSource = userViews;
|
||||
// this.Grid1.DataBind();
|
||||
// }
|
||||
//}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
+24
-31
@@ -7,11 +7,13 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.SysManage {
|
||||
|
||||
|
||||
public partial class UserIn {
|
||||
|
||||
namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
|
||||
|
||||
public partial class UserIn
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit 控件。
|
||||
/// </summary>
|
||||
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnDownLoad 控件。
|
||||
/// </summary>
|
||||
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDownLoad;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// fuAttachUrl 控件。
|
||||
/// </summary>
|
||||
@@ -83,25 +85,25 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FileUpload fuAttachUrl;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// gvErrorInfo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
protected global::FineUIPro.Grid gvErrorInfo;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// lblPageIndex 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label2;
|
||||
|
||||
protected global::System.Web.UI.WebControls.Label lblPageIndex;
|
||||
|
||||
/// <summary>
|
||||
/// hdFileName 控件。
|
||||
/// </summary>
|
||||
@@ -110,7 +112,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdFileName;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// hdCheckResult 控件。
|
||||
/// </summary>
|
||||
@@ -119,7 +121,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdCheckResult;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// lblBottom 控件。
|
||||
/// </summary>
|
||||
@@ -128,7 +130,7 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lblBottom;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
@@ -137,14 +139,5 @@ namespace FineUIPro.Web.SysManage {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
runat="server" BoxFlex="1" DataKeyNames="UserId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="UserId" AllowSorting="true" SortField="UnitName,UserCode" ForceFit="true"
|
||||
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
|
||||
PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" Width="980px" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
@@ -56,40 +56,40 @@
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="45px" HeaderTextAlign="Center"
|
||||
TextAlign="Center" />
|
||||
<f:RenderField Width="100px" ColumnID="UserCode" DataField="UserCode" SortField="UserCode"
|
||||
<f:RenderField Width="90px" ColumnID="UserCode" DataField="UserCode" SortField="UserCode"
|
||||
FieldType="String" HeaderText="员工编号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="UserName" DataField="UserName" SortField="UserName"
|
||||
<f:RenderField Width="120px" ColumnID="UserName" DataField="UserName" SortField="UserName"
|
||||
FieldType="String" HeaderText="姓名" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="230px" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
|
||||
FieldType="String" HeaderText="单位名称" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="UnitCode" DataField="UnitCode" SortField="UnitCode"
|
||||
<%--<f:RenderField Width="100px" ColumnID="UnitCode" DataField="UnitCode" SortField="UnitCode"
|
||||
FieldType="String" HeaderText="单位编号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>--%>
|
||||
<f:RenderField Width="220px" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
|
||||
FieldType="String" HeaderText="单位名称" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="DepartName" DataField="DepartName" SortField="DepartName"
|
||||
FieldType="String" HeaderText="部门" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="110px" ColumnID="Account" DataField="Account" SortField="Account"
|
||||
<f:RenderField Width="100px" ColumnID="Account" DataField="Account" SortField="Account"
|
||||
FieldType="String" HeaderText="账号" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<%-- <f:RenderField Width="120px" ColumnID="IdentityCard" DataField="IdentityCard" SortField="IdentityCard"
|
||||
FieldType="String" HeaderText="身份证号码" HeaderTextAlign="Center" TextAlign="Right" Hidden="true">
|
||||
</f:RenderField>--%>
|
||||
<f:RenderField Width="150px" ColumnID="RoleName" DataField="RoleName" SortField="RoleName"
|
||||
<f:RenderField Width="230px" ColumnID="RoleName" DataField="RoleName" SortField="RoleName"
|
||||
FieldType="String" HeaderText="本部角色" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="120px" ColumnID="Telephone" DataField="Telephone" SortField="Telephone"
|
||||
FieldType="String" HeaderText="手机号码" HeaderTextAlign="Center" TextAlign="Right" Hidden="true">
|
||||
</f:RenderField>
|
||||
<f:CheckBoxField Width="60px" SortField="IsPost" RenderAsStaticField="true" DataField="IsPost"
|
||||
<f:CheckBoxField Width="50px" SortField="IsPost" RenderAsStaticField="true" DataField="IsPost"
|
||||
HeaderText="在岗" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:CheckBoxField>
|
||||
<%-- <f:CheckBoxField Width="50px" SortField="IsOffice" RenderAsStaticField="true" DataField="IsOffice"
|
||||
HeaderText="本部" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:CheckBoxField>--%>
|
||||
<f:TemplateField Width="200px" ColumnID="UserId" HeaderText="参与项目" TextAlign="Left">
|
||||
<f:TemplateField Width="180px" ColumnID="UserId" HeaderText="参与项目" TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbtnPro" runat="server" Text='<%# ConvertProject(Eval("UserId")) %>' OnClick="lbtnPro_Click"></asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
@@ -116,7 +116,7 @@
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="导入人员信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window2_Close" IsModal="false"
|
||||
CloseAction="HidePostBack" Width="1000px" Height="560px">
|
||||
CloseAction="HidePostBack" Width="1000px" Height="620px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections;
|
||||
using static System.Windows.Forms.VisualStyles.VisualStyleElement.StartPanel;
|
||||
|
||||
public partial class UserList : PageBase
|
||||
{
|
||||
public partial class UserList : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
@@ -44,13 +44,13 @@
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT Users.UserId,Users.Account,Users.UserCode,Users.Password,Users.UserName,Depart.DepartName,Users.RoleId,Users.UnitId,Users.IsPost,CASE WHEN Users.IsPost=1 THEN '是' ELSE '否' END AS IsPostName,Users.IdentityCard,Users.Telephone,Users.IsOffice,UnitCode,"
|
||||
+ @"Roles.RoleName,Unit.UnitName,Unit.UnitCode"
|
||||
+ @" From dbo.Sys_User AS Users"
|
||||
+ @" LEFT JOIN Sys_Role AS Roles ON Roles.RoleId=Users.RoleId"
|
||||
+ @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId=Users.UnitId"
|
||||
+ @" LEFT JOIN Base_Depart AS Depart ON Depart.DepartId=Users.DepartId"
|
||||
+ @" WHERE Users.UserId !='" + Const.sysglyId + "' AND Users.UserId !='" + Const.hfnbdId + "' AND Users.UserId !='" + Const.sedinId + "'";
|
||||
string strSql = $@"SELECT Users.UserId,Users.Account,Users.UserCode,Users.Password,Users.UserName,Depart.DepartName,Users.RoleId,Users.UnitId,Users.IsPost,CASE WHEN Users.IsPost=1 THEN '是' ELSE '否' END AS IsPostName,Users.IdentityCard,Users.Telephone,Users.IsOffice,UnitCode,Unit.UnitName,Unit.UnitCode
|
||||
,RoleName= STUFF(( SELECT ',' + RoleName FROM dbo.Sys_Role where PATINDEX('%,' + RTRIM(RoleId) + ',%',',' +Users.RoleId + ',')>0 FOR XML PATH('')), 1, 1,'')
|
||||
From dbo.Sys_User AS Users
|
||||
LEFT JOIN Sys_Role AS Roles ON Roles.RoleId=Users.RoleId
|
||||
LEFT JOIN Base_Unit AS Unit ON Unit.UnitId=Users.UnitId
|
||||
LEFT JOIN Base_Depart AS Depart ON Depart.DepartId=Users.DepartId
|
||||
WHERE Users.UserId !='{Const.sysglyId}' AND Users.UserId !='{Const.hfnbdId}'";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
//strSql += " AND Users.UnitId = @ThisUnitId";
|
||||
//listStr.Add(new SqlParameter("@ThisUnitId", Const.UnitId_CWCEC));
|
||||
@@ -328,94 +328,94 @@
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnImport1_Click(object sender, EventArgs e)
|
||||
{
|
||||
//同步项目
|
||||
int total = 10;
|
||||
int pageSize = 100;
|
||||
int pageIndex = 0;
|
||||
while (pageSize * pageIndex <= total)
|
||||
{
|
||||
string pushContent = string.Empty;
|
||||
var dictTypeCode = new
|
||||
{
|
||||
criteria = new { _expr = new[] { new { _property = "isusedcode", _value = "0", _op = "=" } } },
|
||||
pageSize = pageSize,
|
||||
pageIndex = pageIndex
|
||||
};
|
||||
Hashtable newToken = new Hashtable
|
||||
{
|
||||
{ "userName", "nuobida_construction" },
|
||||
{ "password", "nuobida@2023" },
|
||||
{ "ClientId", "com.tcc.pm.sggl" },
|
||||
{ "OperationCode", "com.tcc.dm.mdm.ee.basicinfo" }
|
||||
};
|
||||
pushContent = JsonConvert.SerializeObject(dictTypeCode);
|
||||
string returndata = APIGetHttpService.OutsideHttp("https://esb.china-tcc.com:9090/com/tcc/dm/mdm/TCC_TM_EE_BASIC_INFO", "POST", "application/json;charset=utf-8", newToken, pushContent);
|
||||
if (!string.IsNullOrEmpty(returndata))
|
||||
{
|
||||
JObject obj = JObject.Parse(returndata);
|
||||
total = int.Parse(obj["total"].ToString());
|
||||
string datas = obj["datas"].ToString();
|
||||
JArray arr = JArray.Parse(datas);
|
||||
foreach (var item in arr)
|
||||
{
|
||||
string full_name = item["full_name"].ToString();
|
||||
string genderCode = item["gender_code"].ToString();
|
||||
string idcard = item["idcard"].ToString();
|
||||
string data_source_code = item["data_source_code"].ToString();
|
||||
string hrp_personnel_unique_id = item["hrp_personnel_unique_id"].ToString();
|
||||
string cellphone = item["cellphone"].ToString();
|
||||
string domainAccount = item["domain_account"].ToString();
|
||||
|
||||
if (!string.IsNullOrEmpty(idcard))
|
||||
{
|
||||
var sysUser = Funs.DB.Sys_User.FirstOrDefault(x => x.IdentityCard == idcard );
|
||||
if (sysUser != null)
|
||||
{
|
||||
sysUser.UserName = full_name;
|
||||
sysUser.Telephone = cellphone;
|
||||
sysUser.DomainAccount = domainAccount;
|
||||
sysUser.Sex = genderCode;
|
||||
{
|
||||
//同步项目
|
||||
int total = 10;
|
||||
int pageSize = 100;
|
||||
int pageIndex = 0;
|
||||
while (pageSize * pageIndex <= total)
|
||||
{
|
||||
string pushContent = string.Empty;
|
||||
var dictTypeCode = new
|
||||
{
|
||||
criteria = new { _expr = new[] { new { _property = "isusedcode", _value = "0", _op = "=" } } },
|
||||
pageSize = pageSize,
|
||||
pageIndex = pageIndex
|
||||
};
|
||||
Hashtable newToken = new Hashtable
|
||||
{
|
||||
{ "userName", "nuobida_construction" },
|
||||
{ "password", "nuobida@2023" },
|
||||
{ "ClientId", "com.tcc.pm.sggl" },
|
||||
{ "OperationCode", "com.tcc.dm.mdm.ee.basicinfo" }
|
||||
};
|
||||
pushContent = JsonConvert.SerializeObject(dictTypeCode);
|
||||
string returndata = APIGetHttpService.OutsideHttp("https://esb.china-tcc.com:9090/com/tcc/dm/mdm/TCC_TM_EE_BASIC_INFO", "POST", "application/json;charset=utf-8", newToken, pushContent);
|
||||
if (!string.IsNullOrEmpty(returndata))
|
||||
{
|
||||
JObject obj = JObject.Parse(returndata);
|
||||
total = int.Parse(obj["total"].ToString());
|
||||
string datas = obj["datas"].ToString();
|
||||
JArray arr = JArray.Parse(datas);
|
||||
foreach (var item in arr)
|
||||
{
|
||||
string full_name = item["full_name"].ToString();
|
||||
string genderCode = item["gender_code"].ToString();
|
||||
string idcard = item["idcard"].ToString();
|
||||
string data_source_code = item["data_source_code"].ToString();
|
||||
string hrp_personnel_unique_id = item["hrp_personnel_unique_id"].ToString();
|
||||
string cellphone = item["cellphone"].ToString();
|
||||
string domainAccount = item["domain_account"].ToString();
|
||||
|
||||
//sysUser.DataSource = "数据同步";
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
sysUser = new Model.Sys_User
|
||||
{
|
||||
UserId = SQLHelper.GetNewID(),
|
||||
};
|
||||
sysUser.UnitId = BLL.Const.UnitId_XJYJ;
|
||||
sysUser.UserCode = domainAccount;
|
||||
sysUser.UserName = full_name;
|
||||
sysUser.Telephone = cellphone;
|
||||
sysUser.IdentityCard = idcard;
|
||||
sysUser.Account = domainAccount;
|
||||
sysUser.DomainAccount = domainAccount;
|
||||
sysUser.Password = Funs.EncryptionPassword(BLL.Const.Password);
|
||||
sysUser.RawPassword = BLL.Const.Password;
|
||||
sysUser.IsPost = true;
|
||||
sysUser.DataSource = "数据同步";
|
||||
Funs.DB.Sys_User.InsertOnSubmit(sysUser);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(idcard))
|
||||
{
|
||||
var sysUser = Funs.DB.Sys_User.FirstOrDefault(x => x.IdentityCard == idcard);
|
||||
if (sysUser != null)
|
||||
{
|
||||
sysUser.UserName = full_name;
|
||||
sysUser.Telephone = cellphone;
|
||||
sysUser.DomainAccount = domainAccount;
|
||||
sysUser.Sex = genderCode;
|
||||
|
||||
}
|
||||
pageIndex++;
|
||||
}
|
||||
//sysUser.DataSource = "数据同步";
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
else
|
||||
{
|
||||
sysUser = new Model.Sys_User
|
||||
{
|
||||
UserId = SQLHelper.GetNewID(),
|
||||
};
|
||||
sysUser.UnitId = BLL.Const.UnitId_XJYJ;
|
||||
sysUser.UserCode = domainAccount;
|
||||
sysUser.UserName = full_name;
|
||||
sysUser.Telephone = cellphone;
|
||||
sysUser.IdentityCard = idcard;
|
||||
sysUser.Account = domainAccount;
|
||||
sysUser.DomainAccount = domainAccount;
|
||||
sysUser.Password = Funs.EncryptionPassword(BLL.Const.Password);
|
||||
sysUser.RawPassword = BLL.Const.Password;
|
||||
sysUser.IsPost = true;
|
||||
sysUser.DataSource = "数据同步";
|
||||
Funs.DB.Sys_User.InsertOnSubmit(sysUser);
|
||||
Funs.DB.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BindGrid();
|
||||
}
|
||||
}
|
||||
pageIndex++;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭导入弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭导入弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
@@ -14,19 +14,19 @@
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtUserCode" runat="server" Label="员工编号" MaxLength="20" LabelWidth="90px">
|
||||
<f:TextBox ID="txtUserCode" runat="server" Label="员工编号" MaxLength="20" LabelWidth="90px">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtUserName" runat="server" Label="姓名" Required="true" ShowRedStar="true" MaxLength="20"
|
||||
FocusOnPageLoad="true" LabelWidth="90px">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtAccount" runat="server" Label="登录账号" Required="true" ShowRedStar="true" MaxLength="50"
|
||||
LabelWidth="90px">
|
||||
<f:TextBox ID="txtAccount" runat="server" Label="登录账号" Required="true" ShowRedStar="true" MaxLength="50"
|
||||
LabelWidth="90px">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpUnit" runat="server" Label="单位" EnableEdit="true" ForceSelection="false"
|
||||
<f:DropDownList ID="drpUnit" runat="server" Label="单位" EnableEdit="true" ForceSelection="false"
|
||||
Required="true" ShowRedStar="true" LabelWidth="90px">
|
||||
</f:DropDownList>
|
||||
<f:TextBox ID="txtIdentityCard" runat="server" Label="身份证号" MaxLength="50" ShowRedStar="true" Required="true"
|
||||
@@ -37,50 +37,50 @@
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow runat="server" ID="trServer">
|
||||
<Items>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpDepart" runat="server" Label="部门" ShowRedStar="true" Required="true"
|
||||
EnableEdit="true" ForceSelection="false" LabelWidth="90px">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpIsOffice" runat="server" Label="本部人员"
|
||||
<f:DropDownList ID="drpIsOffice" runat="server" Label="本部人员"
|
||||
EnableEdit="true" ForceSelection="false" LabelWidth="90px">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpRole" runat="server" Label="本部角色" EnableEdit="true" ForceSelection="false" LabelWidth="90px">
|
||||
<f:DropDownList ID="drpRole" runat="server" Label="本部角色" EmptyText="请选择" AutoSelectFirstItem="false" EnableCheckBoxSelect="true" EnableEdit="true" EnableMultiSelect="true" ForceSelection="false" LabelWidth="90px">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpIsPost" runat="server" Label="在岗" EnableEdit="true" ForceSelection="false"
|
||||
<f:DropDownList ID="drpIsPost" runat="server" Label="在岗" EnableEdit="true" ForceSelection="false"
|
||||
Required="true" ShowRedStar="true" LabelWidth="90px">
|
||||
</f:DropDownList>
|
||||
<f:Image ID="Image2" ImageUrl="~/res/images/Signature0.png" runat="server" ImageHeight="35px" ImageWidth="90px"
|
||||
BoxFlex="1" Label="签名" LabelWidth="90px">
|
||||
</f:Image>
|
||||
<f:FileUpload runat="server" ID="fileSignature" EmptyText="请选择"
|
||||
OnFileSelected="btnSignature_Click" AutoPostBack="true" Width="150px" LabelWidth="90px">
|
||||
</f:FileUpload>
|
||||
<f:Image ID="Image2" ImageUrl="~/res/images/Signature0.png" runat="server" ImageHeight="35px" ImageWidth="90px"
|
||||
BoxFlex="1" Label="签名" LabelWidth="90px">
|
||||
</f:Image>
|
||||
<f:FileUpload runat="server" ID="fileSignature" EmptyText="请选择"
|
||||
OnFileSelected="btnSignature_Click" AutoPostBack="true" Width="150px" LabelWidth="90px">
|
||||
</f:FileUpload>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</f:FormRow>
|
||||
<f:FormRow runat="server">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpMainCNProfessional" runat="server" Label="主专业" EnableEdit="true" LabelWidth="90px">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpMainCNProfessional" runat="server" Label="主专业" EnableEdit="true" LabelWidth="90px">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpViceCNProfessional" runat="server" Label="副专业" EnableEdit="true"
|
||||
EnableMultiSelect="true" MaxLength="500" EnableCheckBoxSelect="true">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpViceCNProfessional" runat="server" Label="副专业" EnableEdit="true"
|
||||
EnableMultiSelect="true" MaxLength="500" EnableCheckBoxSelect="true">
|
||||
</f:DropDownList>
|
||||
<f:RadioButtonList runat="server" ID="rblHomePageType" Label="首页加载">
|
||||
<f:RadioItem Text="施工管理" Value="1" Selected="true" />
|
||||
<f:RadioItem Text="QHSE" Value="2" />
|
||||
</f:RadioButtonList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnArrowRefresh" Text="重置密码" Icon="ArrowRefresh" ConfirmText="确定恢复当前用户原始密码?" OnClick="btnArrowRefresh_Click"
|
||||
runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button ID="btnArrowRefresh" Text="重置密码" Icon="ArrowRefresh" ConfirmText="确定恢复当前用户原始密码?" OnClick="btnArrowRefresh_Click"
|
||||
runat="server" Hidden="true">
|
||||
</f:Button>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1" Hidden="true"
|
||||
OnClick="btnSave_Click">
|
||||
@@ -90,7 +90,7 @@
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
</f:Form>
|
||||
<f:Window ID="Window1" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
|
||||
@@ -5,6 +5,7 @@ using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using BLL;
|
||||
using FineUIPro.Web.ProjectData;
|
||||
|
||||
namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
@@ -78,7 +79,7 @@ namespace FineUIPro.Web.SysManage
|
||||
DepartService.InitDepartDropDownList(this.drpDepart, true);
|
||||
CNProfessionalService.InitCNProfessionalDownList(this.drpMainCNProfessional, true);
|
||||
CNProfessionalService.InitCNProfessionalDownList(this.drpViceCNProfessional, true);
|
||||
if (!string.IsNullOrEmpty(this.UnitId))
|
||||
if (!string.IsNullOrWhiteSpace(this.UnitId))
|
||||
{
|
||||
this.drpIsOffice.SelectedValue = "False";
|
||||
}
|
||||
@@ -88,22 +89,22 @@ namespace FineUIPro.Web.SysManage
|
||||
this.drpUnit.Enabled = false;
|
||||
}
|
||||
///角色下拉框
|
||||
BLL.RoleService.InitRoleDropDownList(this.drpRole, string.Empty, true, true);
|
||||
if (!string.IsNullOrEmpty(this.UserId))
|
||||
BLL.RoleService.InitRoleDropDownList(this.drpRole, string.Empty, true, false);
|
||||
if (!string.IsNullOrWhiteSpace(this.UserId))
|
||||
{
|
||||
var user = BLL.UserService.GetUserByUserId(this.UserId);
|
||||
if (user != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(user.UnitId))
|
||||
if (!string.IsNullOrWhiteSpace(user.UnitId))
|
||||
{
|
||||
this.drpUnit.SelectedValue = user.UnitId;
|
||||
}
|
||||
this.txtUserCode.Text = user.UserCode;
|
||||
this.txtUserName.Text = user.UserName;
|
||||
this.txtAccount.Text = user.Account;
|
||||
if (!string.IsNullOrEmpty(user.RoleId))
|
||||
if (!string.IsNullOrWhiteSpace(user.RoleId))
|
||||
{
|
||||
this.drpRole.SelectedValue = user.RoleId;
|
||||
this.drpRole.SelectedValueArray = user.RoleId.Split(',');
|
||||
}
|
||||
if (user.IsPost.HasValue)
|
||||
{
|
||||
@@ -119,21 +120,21 @@ namespace FineUIPro.Web.SysManage
|
||||
this.drpIsOffice.SelectedValue = "False";
|
||||
}
|
||||
this.txtIdentityCard.Text = user.IdentityCard;
|
||||
if (!string.IsNullOrEmpty(user.SignatureUrl))
|
||||
if (!string.IsNullOrWhiteSpace(user.SignatureUrl))
|
||||
{
|
||||
this.SignatureUrl = user.SignatureUrl;
|
||||
this.Image2.ImageUrl = "~/" + this.SignatureUrl;
|
||||
}
|
||||
this.drpDepart.SelectedValue = user.DepartId;
|
||||
if (!string.IsNullOrEmpty(user.MainCNProfessionalId))
|
||||
if (!string.IsNullOrWhiteSpace(user.MainCNProfessionalId))
|
||||
{
|
||||
this.drpMainCNProfessional.SelectedValue = user.MainCNProfessionalId;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(user.ViceCNProfessionalId))
|
||||
if (!string.IsNullOrWhiteSpace(user.ViceCNProfessionalId))
|
||||
{
|
||||
this.drpViceCNProfessional.SelectedValueArray = user.ViceCNProfessionalId.Split(',');
|
||||
}
|
||||
if (!string.IsNullOrEmpty(user.HomePageType))
|
||||
if (!string.IsNullOrWhiteSpace(user.HomePageType))
|
||||
{
|
||||
this.rblHomePageType.SelectedValue = user.HomePageType;
|
||||
}
|
||||
@@ -174,7 +175,7 @@ namespace FineUIPro.Web.SysManage
|
||||
Alert.ShowInParent("输入的账号已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtUserCode.Text))
|
||||
if (!string.IsNullOrWhiteSpace(this.txtUserCode.Text))
|
||||
{
|
||||
var q2 = Funs.DB.Sys_User.FirstOrDefault(x => x.UserCode == this.txtUserCode.Text.Trim() && (x.UserId != this.UserId || (this.UserId == null && x.UserId != null)));
|
||||
if (q2 != null)
|
||||
@@ -184,7 +185,7 @@ namespace FineUIPro.Web.SysManage
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text) && BLL.UserService.IsExistUserIdentityCard(this.UserId, this.txtIdentityCard.Text.Trim()) == true)
|
||||
if (!string.IsNullOrWhiteSpace(this.txtIdentityCard.Text) && BLL.UserService.IsExistUserIdentityCard(this.UserId, this.txtIdentityCard.Text.Trim()) == true)
|
||||
{
|
||||
Alert.ShowInParent("输入的身份证号码已存在!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
@@ -206,9 +207,26 @@ namespace FineUIPro.Web.SysManage
|
||||
{
|
||||
newUser.UnitId = this.CurrUser.UnitId;
|
||||
}
|
||||
if (this.drpRole.SelectedValue != Const._Null)
|
||||
//if (!string.IsNullOrWhiteSpace(this.drpRole.SelectedValue))
|
||||
//{
|
||||
// newUser.RoleId = this.drpRole.SelectedValue;
|
||||
//}
|
||||
///角色
|
||||
string roleIds = string.Empty;
|
||||
foreach (var item in this.drpRole.SelectedValueArray)
|
||||
{
|
||||
newUser.RoleId = this.drpRole.SelectedValue;
|
||||
var role = BLL.RoleService.GetRoleByRoleId(item);
|
||||
if (role != null)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(newUser.RoleId))
|
||||
{
|
||||
newUser.RoleId = role.RoleId;
|
||||
}
|
||||
else
|
||||
{
|
||||
newUser.RoleId += "," + role.RoleId;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.drpDepart.SelectedValue != Const._Null)
|
||||
{
|
||||
@@ -227,7 +245,7 @@ namespace FineUIPro.Web.SysManage
|
||||
var cn = BLL.CNProfessionalService.GetCNProfessional(item);
|
||||
if (cn != null)
|
||||
{
|
||||
if (string.IsNullOrEmpty(newUser.ViceCNProfessionalId))
|
||||
if (string.IsNullOrWhiteSpace(newUser.ViceCNProfessionalId))
|
||||
{
|
||||
newUser.ViceCNProfessionalId = cn.CNProfessionalId;
|
||||
}
|
||||
@@ -238,11 +256,11 @@ namespace FineUIPro.Web.SysManage
|
||||
}
|
||||
}
|
||||
newUser.HomePageType = this.rblHomePageType.SelectedValue;
|
||||
if (string.IsNullOrEmpty(this.UserId))
|
||||
if (string.IsNullOrWhiteSpace(this.UserId))
|
||||
{
|
||||
newUser.RawPassword = UserService.getInitialPassword(newUser.UnitId, newUser.IdentityCard); ;
|
||||
newUser.Password = Funs.EncryptionPassword(newUser.RawPassword);
|
||||
|
||||
|
||||
newUser.UserId = SQLHelper.GetNewID(typeof(Model.Sys_User));
|
||||
newUser.DataSources = this.CurrUser.LoginProjectId;
|
||||
UserService.AddUser(newUser);
|
||||
@@ -265,7 +283,7 @@ namespace FineUIPro.Web.SysManage
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
if (!string.IsNullOrWhiteSpace(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
@@ -331,7 +349,7 @@ namespace FineUIPro.Web.SysManage
|
||||
/// <param name="e"></param>
|
||||
protected void btnArrowRefresh_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.UserId))
|
||||
if (!string.IsNullOrWhiteSpace(this.UserId))
|
||||
{
|
||||
BLL.UserService.UpdatePassword(this.UserId);
|
||||
ShowNotify("密码已重置为原始密码!", MessageBoxIcon.Success);
|
||||
|
||||
Reference in New Issue
Block a user