From fbcfd95f7327ca89b054daf5b19fe86b4a900532 Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Thu, 5 Jun 2025 10:36:47 +0800 Subject: [PATCH] 20250605 --- FCL/BLL/Common/CommonService.cs | 22 +++++++--- FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx | 2 +- FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx.cs | 41 +++++++++++++++---- FCL/FineUIPro.Web/Web.config | 2 +- FCL/FineUIPro.Web/index.aspx.cs | 33 ++++++++------- 5 files changed, 68 insertions(+), 32 deletions(-) diff --git a/FCL/BLL/Common/CommonService.cs b/FCL/BLL/Common/CommonService.cs index 7d48f01..59cf54f 100644 --- a/FCL/BLL/Common/CommonService.cs +++ b/FCL/BLL/Common/CommonService.cs @@ -125,11 +125,11 @@ namespace BLL return isPower; } - + #endregion #region 根据登陆id和系统id得到菜单列表 - + /// /// 本项目用这个方法来获取权限(不按项目角色和项目用户来获取权限) @@ -145,8 +145,11 @@ namespace BLL { if (user.UserId == Const.GlyId) //// 如果是管理员或者本部人员返回所有菜单 { - var sysMenu = from x in Funs.DB.Sys_Menu orderby x.SortIndex select x; - reMenuList = sysMenu.ToList(); + var sysMenu = from x in Funs.DB.Sys_Menu orderby x.SortIndex select x; + if (sysMenu.Count() > 0) + { + reMenuList = sysMenu.ToList(); + } } else { @@ -155,7 +158,10 @@ namespace BLL where y.RoleId == user.RoleId orderby x.SortIndex select x; - reMenuList = sysMenuRole.ToList(); + if (sysMenuRole.Count() > 0) + { + reMenuList = sysMenuRole.ToList(); + } // 对主协调员权限特殊处理 List mc = (from x in Funs.DB.FC_SESRelatedData select x.Main_Coordinator).ToList(); @@ -163,11 +169,15 @@ namespace BLL { Model.Sys_Menu addSupMenu = (from x in Funs.DB.Sys_Menu where x.MenuId == "21FCD41E-2E96-4DE0-8F5F-BDD0C967134F" select x).First(); Model.Sys_Menu addMenu = (from x in Funs.DB.Sys_Menu where x.MenuId == Const.ContractorQualificationMenuId select x).First(); - reMenuList.Add(addMenu); + if (addMenu != null) + { + reMenuList.Add(addMenu); + } } } } reMenuList = reMenuList.Distinct().OrderBy(x => x.SortIndex).ToList(); + return reMenuList; } #endregion diff --git a/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx b/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx index ef01dab..0f1fd59 100644 --- a/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx +++ b/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx @@ -70,7 +70,7 @@ - + diff --git a/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx.cs b/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx.cs index 8063e9c..03fe229 100644 --- a/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx.cs +++ b/FCL/FineUIPro.Web/SES/CSafePunishEdit.aspx.cs @@ -8,6 +8,7 @@ using System.Web.UI.WebControls; using FineUIPro.Web.common; using BLL.Common; using BLL; +using Org.BouncyCastle.Asn1.Sec; namespace FineUIPro.Web.SES { @@ -36,7 +37,7 @@ namespace FineUIPro.Web.SES { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); string view = Request.Params["view"]; - + var role = BLL.Sys_RoleService.GetRole(CurrUser.RoleId); if (role != null && role.RoleName == "Contract Administrator") { @@ -85,7 +86,7 @@ namespace FineUIPro.Web.SES BLL.SESRelatedDataService.InitFONoDropDownList(this.drpFO_No, drpContractor.SelectedValue, true);//合同号 this.drpFO_No.SelectedValue = punishment.FO_NO; } - + this.txtDiscispline.Text = punishment.Discipline; this.txtLocation.Text = punishment.Location; this.txtDescription.Text = punishment.Description; @@ -98,7 +99,7 @@ namespace FineUIPro.Web.SES { drpViolationDegree.SelectedValue = pun.ViolationDegree; } - + txtContractAdmin.Text = punishment.Contract_Admin; txtMainCoordinator.Text = punishment.Main_Coordinator; txtMCDept.Text = punishment.MCDept; @@ -112,11 +113,16 @@ namespace FineUIPro.Web.SES drpSelectYesNo.SelectedValue = ""; } - txtDef.Text= punishment.Def; + txtDef.Text = punishment.Def; if (!string.IsNullOrEmpty(punishment.BYC_RU)) { this.drpBYC_RU.SelectedValue = punishment.BYC_RU; + //BYC Resp. Dept.选择NA时,End User(BYC Resp. Dept.部门)填写部分灰化 + if (this.drpBYC_RU.SelectedText == "NA") + { + GPDep.Enabled = false; + } } if (!string.IsNullOrEmpty(punishment.Violation_Inspector)) { @@ -126,7 +132,7 @@ namespace FineUIPro.Web.SES txtInspectionDep.Text = depName; } - if (this.CurrUser.DepartId == punishment.BYC_RU || this.CurrUser.Account==Const.Gly) + if (this.CurrUser.DepartId == punishment.BYC_RU || this.CurrUser.Account == Const.Gly) { btnSave.Hidden = false; txtViolationRelatedSes.Enabled = true; @@ -155,7 +161,7 @@ namespace FineUIPro.Web.SES } else { - + } if (view == "1") @@ -266,7 +272,7 @@ namespace FineUIPro.Web.SES { Save(); } - + } private void Save() @@ -328,7 +334,7 @@ namespace FineUIPro.Web.SES var vses = (from x in Funs.DB.EMC_Punishment where (x.RelatedSesMailIsSend == null || x.RelatedSesMailIsSend == false) && x.BYC_RU != null && x.BYC_RU.ToUpper() != "NA" && x.Flag == "1" - && x.PunishmentId== punishment.PunishmentId + && x.PunishmentId == punishment.PunishmentId select x).ToList(); if (vses.Count() > 0) { @@ -517,8 +523,25 @@ namespace FineUIPro.Web.SES SetReadonly(false); } } - + } #endregion + + /// + /// BYC Resp. Dept.选择NA时,End User(BYC Resp. Dept.部门)填写部分灰化 + /// + /// + /// + protected void drpBYC_RU_SelectedIndexChanged(object sender, EventArgs e) + { + if (this.drpBYC_RU.SelectedText == "NA") + { + this.GPDep.Enabled = false; + } + else + { + this.GPDep.Enabled = true; + } + } } } \ No newline at end of file diff --git a/FCL/FineUIPro.Web/Web.config b/FCL/FineUIPro.Web/Web.config index 4a08f09..0d634cd 100644 --- a/FCL/FineUIPro.Web/Web.config +++ b/FCL/FineUIPro.Web/Web.config @@ -9,7 +9,7 @@
- + diff --git a/FCL/FineUIPro.Web/index.aspx.cs b/FCL/FineUIPro.Web/index.aspx.cs index 45caaab..adfb41a 100644 --- a/FCL/FineUIPro.Web/index.aspx.cs +++ b/FCL/FineUIPro.Web/index.aspx.cs @@ -125,24 +125,27 @@ namespace FineUIPro.Web leftPanel.Items.Add(accordionMenu); var dt = GetNewMenu("0"); - foreach (var dr in dt) + if (dt.Count() > 0) { - AccordionPane accordionPane = new AccordionPane(); - accordionPane.Title = dr.MenuName; - //accordionPane.Layout = Layout.Fit; - accordionPane.ShowBorder = false; - accordionPane.BodyPadding = "2px 0 0 0"; - accordionMenu.Items.Add(accordionPane); + foreach (var dr in dt) + { + AccordionPane accordionPane = new AccordionPane(); + accordionPane.Title = dr.MenuName; + //accordionPane.Layout = Layout.Fit; + accordionPane.ShowBorder = false; + accordionPane.BodyPadding = "2px 0 0 0"; + accordionMenu.Items.Add(accordionPane); - Tree innerTree = new Tree(); - innerTree.ShowBorder = false; - innerTree.ShowHeader = false; - innerTree.EnableIcons = true; - innerTree.AutoScroll = true; - innerTree.EnableSingleClickExpand = true; - accordionPane.Items.Add(innerTree); + Tree innerTree = new Tree(); + innerTree.ShowBorder = false; + innerTree.ShowHeader = false; + innerTree.EnableIcons = true; + innerTree.AutoScroll = true; + innerTree.EnableSingleClickExpand = true; + accordionPane.Items.Add(innerTree); - BoundTree(innerTree.Nodes, dr.MenuId); + BoundTree(innerTree.Nodes, dr.MenuId); + } } return accordionMenu; }