20230920人员信息中人员类型只有管理员能修改

This commit is contained in:
2023-09-20 10:30:15 +08:00
parent 8ff01fdd35
commit 017edfa146
5 changed files with 57 additions and 2 deletions
+18
View File
@@ -0,0 +1,18 @@
错误信息开始=====>
错误类型:NullReferenceException
错误信息:未将对象引用设置到对象的实例。
错误堆栈:
在 FineUIPro.Web.Person.PersonEdit.Page_Load(Object sender, EventArgs e) 位置 E:\SEDIN\SGGL_SeDin_New\SGGL\FineUIPro.Web\Person\PersonEdit.aspx.cs:行号 229
在 System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
在 System.EventHandler.Invoke(Object sender, EventArgs e)
在 System.Web.UI.Control.OnLoad(EventArgs e)
在 System.Web.UI.Control.LoadRecursive()
在 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
出错时间:09/20/2023 10:14:47
出错文件:http://localhost:8513/Person/PersonEdit.aspx?PersonId=d0aa5149-1d64-4266-8861-379c9a903c72
IP地址:::1
操作人员:JT
出错时间:09/20/2023 10:14:47
+1 -1
View File
@@ -93,7 +93,7 @@
<Items>
<f:DropDownList ID="drpWorkPost" runat="server" Label="岗位" EnableEdit="true">
</f:DropDownList>
<f:RadioButtonList ID="rbPersonType" runat="server" Label="员工类别">
<f:RadioButtonList ID="rbPersonType" runat="server" Label="员工类别" Readonly="true">
</f:RadioButtonList>
<f:CheckBox runat="server" ID="ckIsOffice" Label="本部"></f:CheckBox>
</Items>
@@ -225,10 +225,26 @@ namespace FineUIPro.Web.Person
this.btnCertificateNew.Hidden = false;
this.btnTrainNew.Hidden = false;
this.btnInOutNew.Hidden = false;
if (this.CurrUser.RoleIds == null || this.CurrUser.RoleIds.Contains(Const.sysglyId))
{
this.rbPersonType.Readonly = false;
}
else
{
var getRoleNames = RoleService.getRoleNamesRoleIds(this.CurrUser.RoleIds);
if (getRoleNames != null && getRoleNames.Contains("管理员"))
{
this.rbPersonType.Readonly = false;
}
}
}
}
else
{
this.rbPersonType.Readonly = false;
if (this.Type == "Shunt")
{
this.ckIsPost.Checked = false;
@@ -166,7 +166,7 @@
<Items>
<f:DatePicker ID="txtInTime" runat="server" Label="入场时间" ShowRedStar="true" Required="true">
</f:DatePicker>
<f:RadioButtonList ID="rbPersonType" runat="server" Label="人员类型">
<f:RadioButtonList ID="rbPersonType" runat="server" Label="人员类型" Readonly="true">
</f:RadioButtonList>
<f:CheckBox runat="server" ID="ckIsSafetyMonitoring" Label="安全监护"></f:CheckBox>
</Items>
@@ -120,6 +120,27 @@ namespace FineUIPro.Web.Person
getInitGridTestRecord();
getInitGridInOut();
getInitGridContract();
var person = BLL.Person_PersonsService.GetPerson_PersonsById(this.PersonId);
if (person != null)
{
if (this.CurrUser.RoleIds == null || this.CurrUser.RoleIds.Contains(Const.sysglyId))
{
this.rbPersonType.Readonly = false;
}
else
{
var getRoleNames = RoleService.getRoleNamesRoleIds(this.CurrUser.RoleIds);
if (getRoleNames != null && getRoleNames.Contains("管理员"))
{
this.rbPersonType.Readonly = false;
}
}
}
else
{
this.rbPersonType.Readonly = false;
}
}
}