diff --git a/SGGL/BLL/API/APIPersonService.cs b/SGGL/BLL/API/APIPersonService.cs index a3cb573b..314fc305 100644 --- a/SGGL/BLL/API/APIPersonService.cs +++ b/SGGL/BLL/API/APIPersonService.cs @@ -118,7 +118,7 @@ namespace BLL } else { - var getAs = Person_PersonsService.GetUserListByProjectIdUnitIdRoleId(getProjectPerson.ProjectId, Const.UnitId_SEDIN, BLL.Const.HSSEManager + "," + BLL.Const.HSSEAssistantManager); + var getAs = Person_PersonsService.GetUserListByProjectIdUnitIdRoleId(getProjectPerson.ProjectId, CommonService.GetThisUnitId(), BLL.Const.HSSEManager + "," + BLL.Const.HSSEAssistantManager); if (getAs.Count() > 0) { var getA = getAs.FirstOrDefault(); @@ -445,7 +445,7 @@ namespace BLL && (strWorkPostId == null || x.WorkPostId == strWorkPostId) && x.States == states select x; - if (unitId != Const.UnitId_SEDIN && unitId != Const.UnitId_SEDINNB && !string.IsNullOrEmpty(unitId)) + if (unitId != CommonService.GetThisUnitId() && !string.IsNullOrEmpty(unitId)) { getViews = getViews.Where(x => x.UnitId == unitId); } @@ -1060,7 +1060,7 @@ namespace BLL ChangeTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ChangeTime), ChangeTimeD = x.ChangeTime, }; - if (!string.IsNullOrEmpty(unitId) && unitId != Const.UnitId_SEDIN) + if (!string.IsNullOrEmpty(unitId) && unitId != CommonService.GetThisUnitId()) { personInOuts = personInOuts.Where(x => x.UnitId == unitId); } @@ -1112,7 +1112,7 @@ namespace BLL ChangeTime = string.Format("{0:yyyy-MM-dd HH:mm}", x.ChangeTime), ChangeTimeD = x.ChangeTime, }; - if (!string.IsNullOrEmpty(userUnitId) && userUnitId != Const.UnitId_SEDIN) + if (!string.IsNullOrEmpty(userUnitId) && userUnitId != CommonService.GetThisUnitId()) { personInOuts = personInOuts.Where(x => x.UnitId == userUnitId); } diff --git a/SGGL/BLL/API/APIUserService.cs b/SGGL/BLL/API/APIUserService.cs index 438aa8e0..fec5b243 100644 --- a/SGGL/BLL/API/APIUserService.cs +++ b/SGGL/BLL/API/APIUserService.cs @@ -481,7 +481,7 @@ namespace BLL getDatas = getDatas.Where(x => x.PersonName.Contains(strParam)); } - string unitId = Const.UnitId_SEDIN; + string unitId = CommonService.GetThisUnitId(); var unitList = (from x in db.Person_Persons where userList.Contains(x.PersonId) select x.UnitId).Distinct().ToList(); if (unitList.Count() == 1) { diff --git a/SGGL/BLL/API/HSSE/APIReceiveFileManagerService.cs b/SGGL/BLL/API/HSSE/APIReceiveFileManagerService.cs index f5de29f5..f24ffc15 100644 --- a/SGGL/BLL/API/HSSE/APIReceiveFileManagerService.cs +++ b/SGGL/BLL/API/HSSE/APIReceiveFileManagerService.cs @@ -87,7 +87,7 @@ namespace BLL }).AsEnumerable(); if (getReceiveFileManagerItem.Count() > 0) { - if (!string.IsNullOrEmpty(unitId) && unitId != Const.UnitId_SEDIN) + if (!string.IsNullOrEmpty(unitId) && unitId != CommonService.GetThisUnitId()) { getReceiveFileManagerItem = getReceiveFileManagerItem.Where(x => x.FileUnitId == unitId || (x.UnitIds != null && x.UnitIds.Contains(unitId))); } diff --git a/SGGL/BLL/API/HTGL/APIHTGLPersonService.cs b/SGGL/BLL/API/HTGL/APIHTGLPersonService.cs index b6bdd1fd..6ba8761c 100644 --- a/SGGL/BLL/API/HTGL/APIHTGLPersonService.cs +++ b/SGGL/BLL/API/HTGL/APIHTGLPersonService.cs @@ -26,6 +26,7 @@ namespace BLL data = new List() }; + string thisUnitId = CommonService.GetThisUnitId(); foreach (PersonDataItem item in rb.data) { try @@ -113,7 +114,7 @@ namespace BLL JobNum = item.UserCode, PersonName = item.UserName, IdentityCard = item.IdentityCard, - UnitId = Const.UnitId_SEDIN, + UnitId = thisUnitId, DataFrom = "API" }; @@ -212,4 +213,4 @@ namespace BLL // pb.Image = ReadImage((byte[]) ri.Result.Rows[i]["image"]); } -} \ No newline at end of file +} diff --git a/SGGL/BLL/Common/CommonService.cs b/SGGL/BLL/Common/CommonService.cs index 99ac3f9f..2874d3ae 100644 --- a/SGGL/BLL/Common/CommonService.cs +++ b/SGGL/BLL/Common/CommonService.cs @@ -327,13 +327,28 @@ namespace BLL #endregion #region 得到本单位信息 + /// + /// 获取系统环境中配置的本系统单位ID + /// + public static string GetThisUnitId() + { + var unitId = Funs.DB.Sys_Const.Where(x => x.ConstText == "系统单位") + .Select(x => x.ConstValue).FirstOrDefault(); + if (string.IsNullOrWhiteSpace(unitId)) + { + return ""; + //throw new InvalidOperationException(UiText.Message("请先在公司级环境设置的系统环境中配置系统单位!")); + } + return unitId; + } + /// /// 得到本单位信息 /// /// public static Model.Base_Unit GetIsThisUnit() { - string thisUnitId = BLL.Const.UnitId_SEDIN; + string thisUnitId = BLL.CommonService.GetThisUnitId(); var base_Unit = BLL.UnitService.GetUnitByUnitId(thisUnitId); return base_Unit; } @@ -348,7 +363,7 @@ namespace BLL public static bool IsSedinOrSub(string unitId) { bool result = false; - if (unitId == Const.UnitId_SEDIN) + if (unitId == CommonService.GetThisUnitId()) { result = true; } @@ -378,7 +393,7 @@ namespace BLL else { var user = Person_PersonsService.GetPerson_PersonsById(userId); - if (user != null && user.UnitId == Const.UnitId_SEDIN) + if (user != null && user.UnitId == CommonService.GetThisUnitId()) { result = true; } @@ -394,20 +409,7 @@ namespace BLL /// public static bool IsMainUnitOrAdmin2(string userId) { - bool result = false; - if (userId == Const.sysglyId || userId == Const.hfnbdId) - { - result = true; - } - else - { - var user = Person_PersonsService.GetPerson_PersonsById(userId); - if (user != null && (user.UnitId == Const.UnitId_SEDIN || user.UnitId == Const.UnitId_SEDINNB || user.UnitId == Const.UnitId_SEDINJH)) - { - result = true; - } - } - return result; + return IsMainUnitOrAdmin(userId); } #endregion @@ -676,7 +678,7 @@ namespace BLL var user = Person_PersonsService.GetPerson_PersonsById(userId); - if ((userId == Const.hfnbdId || userId == Const.sysglyId) || (!string.IsNullOrEmpty(user.UnitId) && user.UnitId == BLL.Const.UnitId_SEDIN))//公司级别 + if ((userId == Const.hfnbdId || userId == Const.sysglyId) || (!string.IsNullOrEmpty(user.UnitId) && user.UnitId == BLL.CommonService.GetThisUnitId()))//公司级别 { result = 0; } diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index ec065c11..38e722ac 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -167,21 +167,6 @@ namespace BLL #endregion #region 系统与组织标识 - /// - /// 陕化建单位id - /// - public const string UnitId_SEDIN = "37095edf-3815-4e92-8b8d-b8cefe64c8de"; - - /// - /// 赛鼎宁波单位id - /// - public const string UnitId_SEDINNB = "274fc39e-66e2-4bb9-8080-acb808499e82"; - - /// - /// 赛鼎焦化单位id - /// - public const string UnitId_SEDINJH = "2d2ffdfb-e2f7-430e-888a-240de2b12c06"; - /// /// 集团公司单位id /// diff --git a/SGGL/BLL/DropListService.cs b/SGGL/BLL/DropListService.cs index 04e74c39..d0434309 100644 --- a/SGGL/BLL/DropListService.cs +++ b/SGGL/BLL/DropListService.cs @@ -271,7 +271,7 @@ namespace BLL if (states == Const.State_0 || string.IsNullOrEmpty(states)) ///待提交 { var getA = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.ProjectId == projectId - && x.UnitId == Const.UnitId_SEDIN && x.RoleIds.Contains(Const.ProjectSafetyDirector)); + && x.UnitId == CommonService.GetThisUnitId() && x.RoleIds.Contains(Const.ProjectSafetyDirector)); if (getA != null) { ListItem[] list = new ListItem[1]; diff --git a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs index ff070a81..ca071261 100644 --- a/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs +++ b/SGGL/BLL/HSSE/SitePerson/SitePerson_PersonService.cs @@ -1049,7 +1049,7 @@ namespace BLL { info += "身份证号码不能为空!"; } - if (!IDCardValid.CheckIDCard(person.IdentityCard) && person.UnitId != Const.UnitId_SEDIN) + if (!IDCardValid.CheckIDCard(person.IdentityCard) && person.UnitId != CommonService.GetThisUnitId()) { info += "身份证号码不正确!"; } diff --git a/SGGL/BLL/PZHGL/InformationProject/ReceiveFileManagerService.cs b/SGGL/BLL/PZHGL/InformationProject/ReceiveFileManagerService.cs index b578b0b6..e016d5e8 100644 --- a/SGGL/BLL/PZHGL/InformationProject/ReceiveFileManagerService.cs +++ b/SGGL/BLL/PZHGL/InformationProject/ReceiveFileManagerService.cs @@ -105,7 +105,7 @@ namespace BLL public static void CreateReceiveFile(Model.InformationProject_Notice notice) { var getProjects = Funs.GetStrListByStr(notice.AccessProjectId, ','); - string unitId = Const.UnitId_SEDIN; + string unitId = CommonService.GetThisUnitId(); var getAtt = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == notice.NoticeId); foreach (var item in getProjects) { diff --git a/SGGL/BLL/Person/Person_PersonsService.cs b/SGGL/BLL/Person/Person_PersonsService.cs index 94b24388..3ceef2f9 100644 --- a/SGGL/BLL/Person/Person_PersonsService.cs +++ b/SGGL/BLL/Person/Person_PersonsService.cs @@ -1271,7 +1271,7 @@ namespace BLL public static string ValidPersonInfo(Model.Person_Persons person) { string info = string.Empty; - if (!IDCardValid.CheckIDCard(person.IdentityCard) && person.UnitId != Const.UnitId_SEDIN) + if (!IDCardValid.CheckIDCard(person.IdentityCard) && person.UnitId != CommonService.GetThisUnitId()) { info += "身份证号码不正确!"; } @@ -1288,7 +1288,7 @@ namespace BLL { info += "输入的身份证号码人员库已存在!"; } - if (person.UnitId != Const.UnitId_SEDIN && (string.IsNullOrEmpty(person.PhotoUrl) || person.PhotoUrl == "~/res/images/blank.png")) + if (person.UnitId != CommonService.GetThisUnitId() && (string.IsNullOrEmpty(person.PhotoUrl) || person.PhotoUrl == "~/res/images/blank.png")) { info += "照片不能为空!"; } diff --git a/SGGL/BLL/Person/Person_ShuntService.cs b/SGGL/BLL/Person/Person_ShuntService.cs index de559300..27977d1b 100644 --- a/SGGL/BLL/Person/Person_ShuntService.cs +++ b/SGGL/BLL/Person/Person_ShuntService.cs @@ -32,7 +32,7 @@ namespace BLL { Model.SGGLDB db = Funs.DB; IQueryable getDataList = from x in db.Person_Persons - where x.PersonId != Const.sysglyId && x.PersonId != Const.hfnbdId && x.UnitId == Const.UnitId_SEDIN + where x.PersonId != Const.sysglyId && x.PersonId != Const.hfnbdId && x.UnitId == CommonService.GetThisUnitId() && x.DepartId == Const.Depart_constructionId && x.CurrentProjectId == null && (!x.IsOffice.HasValue || x.IsOffice == false) select x; diff --git a/SGGL/BLL/ProjectData/ProjectService.cs b/SGGL/BLL/ProjectData/ProjectService.cs index 93e84209..90de9de9 100644 --- a/SGGL/BLL/ProjectData/ProjectService.cs +++ b/SGGL/BLL/ProjectData/ProjectService.cs @@ -744,7 +744,7 @@ /// 是否显示请选择 public static void InitProjectDropDownList(FineUIPro.DropDownList dropName, string unitId, bool isShowPlease) { - var IsThisUnit = BLL.Const.UnitId_SEDIN == unitId ? true : false; + var IsThisUnit = BLL.CommonService.GetThisUnitId() == unitId ? true : false; dropName.DataValueField = "ProjectId"; dropName.DataTextField = "ProjectName"; if (IsThisUnit) @@ -774,7 +774,7 @@ where (x.ProjectState == null || x.ProjectState == BLL.Const.ProjectState_1) select x; - if (unitId == BLL.Const.UnitId_SEDIN) + if (unitId == BLL.CommonService.GetThisUnitId()) { getDatas = getDatas.Where(x => x.UnitId == unitId || x.UnitId == null); } diff --git a/SGGL/BLL/ProjectData/ProjectUnitService.cs b/SGGL/BLL/ProjectData/ProjectUnitService.cs index 9620d275..9115730b 100644 --- a/SGGL/BLL/ProjectData/ProjectUnitService.cs +++ b/SGGL/BLL/ProjectData/ProjectUnitService.cs @@ -128,7 +128,7 @@ public static bool GetProjectUnitTypeByProjectIdUnitId(string projectId, string unitId) { bool isShow = false; - if (unitId != Const.UnitId_SEDIN) + if (unitId != CommonService.GetThisUnitId()) { var pUnit = Funs.DB.Project_ProjectUnit.FirstOrDefault(e => e.ProjectId == projectId && e.UnitId == unitId); if (pUnit != null) diff --git a/SGGL/BLL/SysManage/SysConstSetService.cs b/SGGL/BLL/SysManage/SysConstSetService.cs index c1d86199..3e77630c 100644 --- a/SGGL/BLL/SysManage/SysConstSetService.cs +++ b/SGGL/BLL/SysManage/SysConstSetService.cs @@ -5,6 +5,17 @@ public static class SysConstSetService { + public static bool IsMultiLanguageEnabled + { + get + { + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + return db.Sys_Const.Any(x => x.ConstText == "是否加载多语言" && x.ConstValue == "1"); + } + } + } + private static string _CNCECPath; private static string _CncecEsbPath; private static string _CNCECToken; diff --git a/SGGL/BLL/SysManage/UnitService.cs b/SGGL/BLL/SysManage/UnitService.cs index beb28306..3ab04967 100644 --- a/SGGL/BLL/SysManage/UnitService.cs +++ b/SGGL/BLL/SysManage/UnitService.cs @@ -171,7 +171,7 @@ namespace BLL /// public static List GetThisUnitDropDownList() { - var list = (from x in Funs.DB.Base_Unit where x.UnitId == Const.UnitId_SEDIN select x).ToList(); + var list = (from x in Funs.DB.Base_Unit where x.UnitId == CommonService.GetThisUnitId() select x).ToList(); return list; } @@ -184,7 +184,7 @@ namespace BLL List unitList = new List(); if (string.IsNullOrEmpty(unitId)) { - unitId = Const.UnitId_SEDIN; + unitId = CommonService.GetThisUnitId(); } var unitIdList = GetChildrenUnitId(unitId); unitList = (from x in Funs.DB.Base_Unit where unitIdList.Contains(x.UnitId) || x.UnitId == unitId select x).ToList(); @@ -222,7 +222,7 @@ namespace BLL if (isThisUnit) { list = (from x in Funs.DB.Base_Unit - where x.IsBranch == true || x.UnitId == Const.UnitId_SEDIN + where x.IsBranch == true || x.UnitId == CommonService.GetThisUnitId() select x).OrderBy(x => x.UnitCode).ToList(); } return list; @@ -660,7 +660,7 @@ namespace BLL dropName.DataValueField = "UnitId"; dropName.DataTextField = "UnitName"; dropName.DataSource = (from x in Funs.DB.Base_Unit - where x.UnitId == Const.UnitId_SEDIN || x.UnitId == Const.UnitId_CNCEC + where x.UnitId == CommonService.GetThisUnitId() || x.UnitId == Const.UnitId_CNCEC select x).OrderByDescending(x => x.UnitCode).ToList(); dropName.DataBind(); if (isShowPlease) @@ -1008,7 +1008,7 @@ namespace BLL /// public static List GetMainAndSubUnitList() { - return (from x in Funs.DB.Base_Unit where x.UnitId == BLL.Const.UnitId_SEDIN || x.IsBranch == true select x).ToList(); + return (from x in Funs.DB.Base_Unit where x.UnitId == BLL.CommonService.GetThisUnitId() || x.IsBranch == true select x).ToList(); } } } diff --git a/SGGL/BLL/WebService/CNCECHSSEWebService.cs b/SGGL/BLL/WebService/CNCECHSSEWebService.cs index f270c695..f9e349df 100644 --- a/SGGL/BLL/WebService/CNCECHSSEWebService.cs +++ b/SGGL/BLL/WebService/CNCECHSSEWebService.cs @@ -28,7 +28,7 @@ { ProjectId = x.ProjectId, MasterSysId = x.MasterSysId, - UnitId = BLL.Const.UnitId_SEDIN, + UnitId = BLL.CommonService.GetThisUnitId(), ProjectCode = x.ProjectCode, ProjectName = x.ProjectName, StartDate = x.StartDate, @@ -61,7 +61,7 @@ MonitorPW = "", MonitorId = "", ProjectAttribute = "", - SourceUnitId = BLL.Const.UnitId_SEDIN, + SourceUnitId = BLL.CommonService.GetThisUnitId(), } ); diff --git a/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs b/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs index 3910e66c..e64db33b 100644 --- a/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs +++ b/SGGL/BLL/ZHGL/DataSync/CQMSDataService.cs @@ -720,7 +720,7 @@ namespace BLL IdentityCard = x.IdentityCard, WorkPostName = y.WorkPostName == null ? "" : y.WorkPostName, Phone = z.Telephone, - IsOffice = (u.UnitId == BLL.Const.UnitId_SEDIN ? true : false) + IsOffice = (u.UnitId == BLL.CommonService.GetThisUnitId() ? true : false) }).ToList(); result = result .GroupBy(x => x.IdentityCard) diff --git a/SGGL/FineUIPro.Web/App_GlobalResources/UiText.en.resx b/SGGL/FineUIPro.Web/App_GlobalResources/UiText.en.resx index cf37182b..f9c6edf2 100644 --- a/SGGL/FineUIPro.Web/App_GlobalResources/UiText.en.resx +++ b/SGGL/FineUIPro.Web/App_GlobalResources/UiText.en.resx @@ -26068,4 +26068,19 @@ 1 i18n:system-options - \ No newline at end of file + + System company + + + Please select a valid system company. + + + Please configure the system company in Company Environment Settings > System Environment first. + + + Administrator dashboard + + + Enable multiple languages + + diff --git a/SGGL/FineUIPro.Web/App_GlobalResources/UiText.resx b/SGGL/FineUIPro.Web/App_GlobalResources/UiText.resx index f74bdbfc..a6c8e574 100644 --- a/SGGL/FineUIPro.Web/App_GlobalResources/UiText.resx +++ b/SGGL/FineUIPro.Web/App_GlobalResources/UiText.resx @@ -26068,4 +26068,19 @@ 1 i18n:system-options - \ No newline at end of file + + 系统单位 + + + 请选择有效的系统单位! + + + 请先在公司级环境设置的系统环境中配置系统单位! + + + 管理员看板 + + + 是否加载多语言 + + diff --git a/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs index 48b4bb48..21a1b894 100644 --- a/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/BaseInfo/BaseFactoryEdit.aspx.cs @@ -59,7 +59,7 @@ namespace FineUIPro.Web.BaseInfo return; } Model.Base_Factory table = new Model.Base_Factory(); - table.UnitId = BLL.Const.UnitId_SEDIN; + table.UnitId = BLL.CommonService.GetThisUnitId(); table.FactoryCode = this.txtFactoryCode.Text; table.FactoryName = this.txtFactoryName.Text; table.Address = this.txtAddress.Text; diff --git a/SGGL/FineUIPro.Web/Controls/UnitProjectTControl.ascx.cs b/SGGL/FineUIPro.Web/Controls/UnitProjectTControl.ascx.cs index 7f8d77e3..4c8f6bc6 100644 --- a/SGGL/FineUIPro.Web/Controls/UnitProjectTControl.ascx.cs +++ b/SGGL/FineUIPro.Web/Controls/UnitProjectTControl.ascx.cs @@ -47,7 +47,7 @@ namespace FineUIPro.Web.Controls { if (!IsPostBack) { - this.UnitId = this.UnitId ?? BLL.Const.UnitId_SEDIN; + this.UnitId = this.UnitId ?? BLL.CommonService.GetThisUnitId(); this.ProjectId = this.ProjectId; ////加载树 SetSubUnitProjectTree(this.tvProject); @@ -97,7 +97,7 @@ namespace FineUIPro.Web.Controls public void SetSubUnitProjectTree(FineUIPro.Tree tvProject) { tvProject.Nodes.Clear(); - if (BLL.Const.UnitId_SEDIN == this.UnitId) + if (BLL.CommonService.GetThisUnitId() == this.UnitId) { var getSubUnit = from x in Funs.DB.Base_Unit where x.UnitId == this.UnitId || x.IsBranch == true diff --git a/SGGL/FineUIPro.Web/Global.asax.cs b/SGGL/FineUIPro.Web/Global.asax.cs index 5d697be1..20ce4e93 100644 --- a/SGGL/FineUIPro.Web/Global.asax.cs +++ b/SGGL/FineUIPro.Web/Global.asax.cs @@ -11,7 +11,14 @@ { protected void Application_BeginRequest(object sender, EventArgs e) { - UiLanguage.Apply(); + // 静态资源不使用界面语言,避免每个资源请求都读取配置。 + string extension = Request.CurrentExecutionFilePathExtension; + if (extension.Equals(".aspx", StringComparison.OrdinalIgnoreCase) || + extension.Equals(".ashx", StringComparison.OrdinalIgnoreCase) || + extension.Equals(".asmx", StringComparison.OrdinalIgnoreCase)) + { + UiLanguage.Apply(); + } } /// diff --git a/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentPersonQualityEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentPersonQualityEdit.aspx.cs index 95cbf81e..7540c5d3 100644 --- a/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentPersonQualityEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/QualityAudit/EquipmentPersonQualityEdit.aspx.cs @@ -88,7 +88,7 @@ namespace FineUIPro.Web.HSSE.QualityAudit var EquipmentPersonQuality = BLL.EquipmentPersonQualityService.GetEquipmentPersonQualityByPersonId(this.PersonId); if (EquipmentPersonQuality != null) { - Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, Const.UnitId_SEDIN, null, true); + Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, CommonService.GetThisUnitId(), null, true); this.EquipmentPersonQualityId = EquipmentPersonQuality.EquipmentPersonQualityId; this.txtCertificateNo.Text = EquipmentPersonQuality.CertificateNo; this.drpCertificate.SelectedValue = EquipmentPersonQuality.CertificateId; @@ -109,7 +109,7 @@ namespace FineUIPro.Web.HSSE.QualityAudit { this.txtSendDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); this.txtLimitDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); - Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, Const.UnitId_SEDIN, null, true); + Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, CommonService.GetThisUnitId(), null, true); } if (Request.Params["value"] == "0") diff --git a/SGGL/FineUIPro.Web/HSSE/QualityAudit/PersonQualityEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/QualityAudit/PersonQualityEdit.aspx.cs index 71fec809..4c65f772 100644 --- a/SGGL/FineUIPro.Web/HSSE/QualityAudit/PersonQualityEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/QualityAudit/PersonQualityEdit.aspx.cs @@ -66,7 +66,7 @@ namespace FineUIPro.Web.HSSE.QualityAudit this.PersonQualityId = Request.Params["PersonQualityId"]; this.ProjectId = this.CurrUser.LoginProjectId; CertificateService.InitCertificateDropDownList(this.drpCertificate, true); - Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, Const.UnitId_SEDIN, null, true); + Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, CommonService.GetThisUnitId(), null, true); if (!string.IsNullOrEmpty(this.PersonQualityId)) { var getData = BLL.PersonQualityService.GetDataById(this.PersonQualityId); diff --git a/SGGL/FineUIPro.Web/HSSE/QualityAudit/SafePersonQualityEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/QualityAudit/SafePersonQualityEdit.aspx.cs index 09983cce..06b4d5d9 100644 --- a/SGGL/FineUIPro.Web/HSSE/QualityAudit/SafePersonQualityEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/QualityAudit/SafePersonQualityEdit.aspx.cs @@ -87,7 +87,7 @@ namespace FineUIPro.Web.HSSE.QualityAudit var SafePersonQuality = BLL.SafePersonQualityService.GetSafePersonQualityByPersonId(this.PersonId); if (SafePersonQuality != null) { - Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, Const.UnitId_SEDIN, null, true); + Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, CommonService.GetThisUnitId(), null, true); this.SafePersonQualityId = SafePersonQuality.SafePersonQualityId; this.txtCertificateNo.Text = SafePersonQuality.CertificateNo; this.txtCertificateName.Text = SafePersonQuality.CertificateName; @@ -106,7 +106,7 @@ namespace FineUIPro.Web.HSSE.QualityAudit } else { - Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, Const.UnitId_SEDIN, null, true); + Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, CommonService.GetThisUnitId(), null, true); this.txtSendDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); this.txtLimitDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); } diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs index bb9e2034..56c95547 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonListEdit.aspx.cs @@ -275,7 +275,7 @@ namespace FineUIPro.Web.HSSE.SitePerson PostTitleService.InitPostTitleDropDownList(this.drpTitle, true); TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTeamGroup, this.ProjectId, this.UnitId, true); CertificateService.InitCertificateDropDownList(this.drpCertificate, true); - Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, Const.UnitId_SEDIN, BLL.Const.HSSEManager + "," + BLL.Const.HSSEAssistantManager, true); + Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.ProjectId, CommonService.GetThisUnitId(), BLL.Const.HSSEManager + "," + BLL.Const.HSSEAssistantManager, true); CNProfessionalService.InitCNProfessionalDownList(this.drpMainCNProfessional, true); CNProfessionalService.InitCNProfessionalDownList(this.drpViceCNProfessional, true); BasicDataService.InitBasicDataProjectUnitDropDownList(this.drpEduLevel, "EDU_LEVEL", true); diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonUnitList.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonUnitList.aspx.cs index a63808fd..be8f1c66 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonUnitList.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/PersonUnitList.aspx.cs @@ -48,7 +48,7 @@ namespace FineUIPro.Web.HSSE.SitePerson } else { - this.drpUnit.SelectedValue = Const.UnitId_SEDIN; + this.drpUnit.SelectedValue = CommonService.GetThisUnitId(); } // 绑定表格 BindGrid(); diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/SendCardView.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/SendCardView.aspx.cs index 1027282e..1a167727 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/SendCardView.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/SendCardView.aspx.cs @@ -24,7 +24,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { if (!IsPostBack) { - this.lbThisUnit.Text = UnitService.GetUnitNameByUnitId(Const.UnitId_SEDIN); + this.lbThisUnit.Text = UnitService.GetUnitNameByUnitId(CommonService.GetThisUnitId()); this.lbProject.Text = ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId); this.PersonId = Request.Params["PersonId"]; diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.cs index 9ebf49a2..a9eed737 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/SitePersonNowStatistic.aspx.cs @@ -35,7 +35,7 @@ namespace FineUIPro.Web.HSSE.SitePerson this.ProjectId = Request.Params["projectId"]; } UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); - this.drpUnit.SelectedValue = string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_SEDIN : this.CurrUser.UnitId; + this.drpUnit.SelectedValue = string.IsNullOrEmpty(this.CurrUser.UnitId) ? CommonService.GetThisUnitId() : this.CurrUser.UnitId; if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) { this.drpUnit.Enabled = false; diff --git a/SGGL/FineUIPro.Web/HSSE/SitePerson/WorkPostStatistic.aspx.cs b/SGGL/FineUIPro.Web/HSSE/SitePerson/WorkPostStatistic.aspx.cs index d5b8ba91..3d5bcd36 100644 --- a/SGGL/FineUIPro.Web/HSSE/SitePerson/WorkPostStatistic.aspx.cs +++ b/SGGL/FineUIPro.Web/HSSE/SitePerson/WorkPostStatistic.aspx.cs @@ -35,7 +35,7 @@ namespace FineUIPro.Web.HSSE.SitePerson this.ProjectId = Request.Params["projectId"]; } UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); - this.drpUnit.SelectedValue = string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_SEDIN : this.CurrUser.UnitId; + this.drpUnit.SelectedValue = string.IsNullOrEmpty(this.CurrUser.UnitId) ? CommonService.GetThisUnitId() : this.CurrUser.UnitId; if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) { this.drpUnit.Enabled = false; diff --git a/SGGL/FineUIPro.Web/Notice/NoticeEdit.aspx.cs b/SGGL/FineUIPro.Web/Notice/NoticeEdit.aspx.cs index 57e2d0a2..40d86ae0 100644 --- a/SGGL/FineUIPro.Web/Notice/NoticeEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Notice/NoticeEdit.aspx.cs @@ -138,7 +138,7 @@ namespace FineUIPro.Web.Notice private void InitDropDownList() { BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpCompileMan, this.ProjectId, - (string.IsNullOrEmpty(this.CurrUser.UnitId) ? Const.UnitId_SEDIN : this.CurrUser.UnitId), null, true); + (string.IsNullOrEmpty(this.CurrUser.UnitId) ? CommonService.GetThisUnitId() : this.CurrUser.UnitId), null, true); this.drpProjects.DataTextField = "ProjectName"; this.drpProjects.DataValueField = "ProjectId"; diff --git a/SGGL/FineUIPro.Web/Person/CompanyPerson.aspx.cs b/SGGL/FineUIPro.Web/Person/CompanyPerson.aspx.cs index 5b225dc5..cec1a3b3 100644 --- a/SGGL/FineUIPro.Web/Person/CompanyPerson.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/CompanyPerson.aspx.cs @@ -18,7 +18,7 @@ namespace FineUIPro.Web.Person Funs.DropDownPageSize(this.ddlPageSize); ////权限按钮方法 this.GetButtonPower(); - this.btnNew.OnClientClick = Window1.GetShowReference("PersonEdit.aspx?UnitId=" + Const.UnitId_SEDIN) + "return false;"; + this.btnNew.OnClientClick = Window1.GetShowReference("PersonEdit.aspx?UnitId=" + CommonService.GetThisUnitId()) + "return false;"; DepartService.InitDepartDropDownList(this.drpDepart, false); Funs.FineUIPleaseSelect(drpDepart, "按部门查询"); ProjectService.InitAllProjectDropDownList(this.drpProject, false); @@ -38,7 +38,7 @@ namespace FineUIPro.Web.Person /// private void BindGrid() { - var getData = Person_PersonsService.getListData(Const.UnitId_SEDIN, this.drpDepart.SelectedValue, this.drpProject.SelectedValue, + var getData = Person_PersonsService.getListData(CommonService.GetThisUnitId(), this.drpDepart.SelectedValue, this.drpProject.SelectedValue, this.txtPersonName.Text.Trim(), this.txtIdCard.Text.Trim(), this.drpIsPost.SelectedValue, this.drpPersonType.SelectedValue, null, null, Grid1); Grid1.RecordCount = Person_PersonsService.count; Grid1.DataSource = getData; diff --git a/SGGL/FineUIPro.Web/Person/DepartPerson.aspx.cs b/SGGL/FineUIPro.Web/Person/DepartPerson.aspx.cs index c9e92769..2e73cac8 100644 --- a/SGGL/FineUIPro.Web/Person/DepartPerson.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/DepartPerson.aspx.cs @@ -20,7 +20,7 @@ namespace FineUIPro.Web.Person Funs.DropDownPageSize(this.ddlPageSize); ////权限按钮方法 this.GetButtonPower(); - this.btnNew.OnClientClick = Window1.GetShowReference("PersonEdit.aspx?UnitId=" + Const.UnitId_SEDIN + "&DepartId=" + Const.Depart_constructionId) + "return false;"; + this.btnNew.OnClientClick = Window1.GetShowReference("PersonEdit.aspx?UnitId=" + CommonService.GetThisUnitId() + "&DepartId=" + Const.Depart_constructionId) + "return false;"; ProjectService.InitProjectShortNameDropDownList(this.drpProject, false); Funs.FineUIPleaseSelect(drpProject, "按项目查询"); DropListService.InitConstDropDownList(this.drpIsPost, DropListService.Group_IsPost, true); @@ -103,7 +103,7 @@ namespace FineUIPro.Web.Person private void BindGrid() { string[] workPostIds = this.drpWorkPost.SelectedValueArray.Where(x => x != Const._Null).ToArray(); - var getData = Person_PersonsService.getListData(Const.UnitId_SEDIN, Const.Depart_constructionId, this.drpProject.SelectedValue, + var getData = Person_PersonsService.getListData(CommonService.GetThisUnitId(), Const.Depart_constructionId, this.drpProject.SelectedValue, this.txtPersonName.Text.Trim(), this.txtIdCard.Text.Trim(), this.drpIsPost.SelectedValue, this.drpPersonType.SelectedValue, null, workPostIds, Grid1); Grid1.RecordCount = Person_PersonsService.count; Grid1.DataSource = getData; diff --git a/SGGL/FineUIPro.Web/Person/DepartPersonDutyAdd.aspx.cs b/SGGL/FineUIPro.Web/Person/DepartPersonDutyAdd.aspx.cs index 7a46b401..3463a55f 100644 --- a/SGGL/FineUIPro.Web/Person/DepartPersonDutyAdd.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/DepartPersonDutyAdd.aspx.cs @@ -26,7 +26,7 @@ namespace FineUIPro.Web.Person if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); - BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpSEDINUser, null, Const.UnitId_SEDIN, null, true); + BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpSEDINUser, null, CommonService.GetThisUnitId(), null, true); WorkPostService.InitMainWorkPostDropDownList(drpWorkPost, true); this.DutyId = Request.Params["DutyId"]; if (!string.IsNullOrEmpty(this.DutyId)) diff --git a/SGGL/FineUIPro.Web/Person/DepartPersonDutyEdit.aspx.cs b/SGGL/FineUIPro.Web/Person/DepartPersonDutyEdit.aspx.cs index 655938c1..cb587e79 100644 --- a/SGGL/FineUIPro.Web/Person/DepartPersonDutyEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/DepartPersonDutyEdit.aspx.cs @@ -26,9 +26,9 @@ namespace FineUIPro.Web.Person if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); - BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpSEDINUser, null, Const.UnitId_SEDIN, null, true); + BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpSEDINUser, null, CommonService.GetThisUnitId(), null, true); WorkPostService.InitMainWorkPostDropDownList(drpWorkPost, true); - BLL.Person_PersonsService.InitUserUnitIdDepartIdDropDownList(drpHandleMan, Const.UnitId_SEDIN, Const.Depart_constructionId, true); + BLL.Person_PersonsService.InitUserUnitIdDepartIdDropDownList(drpHandleMan, CommonService.GetThisUnitId(), Const.Depart_constructionId, true); this.DutyId = Request.Params["DutyId"]; if (!string.IsNullOrEmpty(this.DutyId)) { @@ -120,7 +120,7 @@ namespace FineUIPro.Web.Person if (this.rdbIsAgree.SelectedValue.Contains("false")) { this.drpHandleMan.Hidden = false; - BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpHandleMan, null, Const.UnitId_SEDIN, null, true); + BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpHandleMan, null, CommonService.GetThisUnitId(), null, true); this.drpHandleMan.SelectedValue = PersonDuty.DutyPersonId; this.drpHandleMan.Label = BLL.UiText.Message("打回责任人"); this.drpHandleMan.Readonly = true; diff --git a/SGGL/FineUIPro.Web/Person/DepartPersonDutyView.aspx.cs b/SGGL/FineUIPro.Web/Person/DepartPersonDutyView.aspx.cs index c93db50e..bcb43074 100644 --- a/SGGL/FineUIPro.Web/Person/DepartPersonDutyView.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/DepartPersonDutyView.aspx.cs @@ -10,7 +10,7 @@ namespace FineUIPro.Web.Person if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); - BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpSEDINUser, null, Const.UnitId_SEDIN, null, true); + BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpSEDINUser, null, CommonService.GetThisUnitId(), null, true); WorkPostService.InitMainWorkPostDropDownList(drpWorkPost, true); string DutyId = Request.Params["DutyId"]; if (!string.IsNullOrEmpty(DutyId)) diff --git a/SGGL/FineUIPro.Web/Person/DepartPersonShunt.aspx.cs b/SGGL/FineUIPro.Web/Person/DepartPersonShunt.aspx.cs index 9b6f745d..e5381e98 100644 --- a/SGGL/FineUIPro.Web/Person/DepartPersonShunt.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/DepartPersonShunt.aspx.cs @@ -20,7 +20,7 @@ namespace FineUIPro.Web.Person { Funs.DropDownPageSize(this.ddlPageSize); - this.btnNew.OnClientClick = Window1.GetShowReference("PersonEdit.aspx?Type=Shunt&UnitId=" + Const.UnitId_SEDIN + "&DepartId=" + Const.Depart_constructionId) + "return false;"; + this.btnNew.OnClientClick = Window1.GetShowReference("PersonEdit.aspx?Type=Shunt&UnitId=" + CommonService.GetThisUnitId() + "&DepartId=" + Const.Depart_constructionId) + "return false;"; ////权限按钮方法 this.GetButtonPower(); WorkPostService.InitWorkPostNameByTypeDropDownList2(this.drpWorkPost, "1", false); //加载管理岗位 @@ -351,7 +351,7 @@ namespace FineUIPro.Web.Person PersonId = getPerson.PersonId, PersonName = getPerson.PersonName, IdentityCard = getPerson.IdentityCard, - UnitId = getPerson.UnitId ?? Const.UnitId_SEDIN, + UnitId = getPerson.UnitId ?? CommonService.GetThisUnitId(), ProjectId = this.drpProject.SelectedValue, WorkPostId = workPostId, // RoleIds = Funs.GetStringByArray(this.drpProjectRole.SelectedValueArray), diff --git a/SGGL/FineUIPro.Web/Person/DepartPersonShuntDetailEdit.aspx.cs b/SGGL/FineUIPro.Web/Person/DepartPersonShuntDetailEdit.aspx.cs index 1e3bc2d8..0a58f557 100644 --- a/SGGL/FineUIPro.Web/Person/DepartPersonShuntDetailEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/DepartPersonShuntDetailEdit.aspx.cs @@ -56,8 +56,9 @@ namespace FineUIPro.Web.Person + @" From dbo.Person_Persons AS Users" + @" LEFT JOIN Base_Unit AS Unit ON Unit.UnitId=Users.UnitId" + @" LEFT JOIN Base_PostTitle AS PostTitle ON PostTitle.PostTitleId=Users.PostTitleId" - + @" WHERE Users.PersonId !='" + Const.sysglyId + "' AND Users.IsPost =1 AND Users.PersonId !='" + Const.hfnbdId + "' AND Users.PersonId !='" + Const.sedinId + "' AND Unit.UnitId='" + Const.UnitId_SEDIN + "' AND Users.DepartId='" + Const.Depart_constructionId + "' "; + + @" WHERE Users.PersonId !='" + Const.sysglyId + "' AND Users.IsPost =1 AND Users.PersonId !='" + Const.hfnbdId + "' AND Users.PersonId !='" + Const.sedinId + "' AND Unit.UnitId=@ThisUnitId AND Users.DepartId='" + Const.Depart_constructionId + "' "; List listStr = new List(); + listStr.Add(new SqlParameter("@ThisUnitId", CommonService.GetThisUnitId())); if (this.drpWorkPost.SelectedValue != BLL.Const._Null) { strSql += " AND CHARINDEX(@WorkPostId,Users.WorkPostId)>0 "; diff --git a/SGGL/FineUIPro.Web/Person/DepartPersonShuntEdit.aspx.cs b/SGGL/FineUIPro.Web/Person/DepartPersonShuntEdit.aspx.cs index c8fea009..5486b33c 100644 --- a/SGGL/FineUIPro.Web/Person/DepartPersonShuntEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/DepartPersonShuntEdit.aspx.cs @@ -81,7 +81,7 @@ namespace FineUIPro.Web.Person if (State != BLL.Const.Shunt_Complete) { Person_ShuntService.Init(drpHandleType, State, false); - Person_PersonsService.InitUserUnitIdDepartIdDropDownList(drpHandleMan, Const.UnitId_SEDIN, Const.Depart_constructionId, false); + Person_PersonsService.InitUserUnitIdDepartIdDropDownList(drpHandleMan, CommonService.GetThisUnitId(), Const.Depart_constructionId, false); } if (State == BLL.Const.Shunt_Compile) { @@ -102,7 +102,7 @@ namespace FineUIPro.Web.Person this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); State = BLL.Const.Shunt_Compile; Person_ShuntService.Init(drpHandleType, State, false); - Person_PersonsService.InitUserUnitIdDepartIdDropDownList(drpHandleMan, Const.UnitId_SEDIN, Const.Depart_constructionId, false); + Person_PersonsService.InitUserUnitIdDepartIdDropDownList(drpHandleMan, CommonService.GetThisUnitId(), Const.Depart_constructionId, false); } Model.Person_Shunt shunt1 = Person_ShuntService.GetShunt(ShuntId); if (shunt1 != null && !string.IsNullOrEmpty(shunt1.SaveHandleMan)) @@ -512,7 +512,7 @@ namespace FineUIPro.Web.Person } if (GetSelectedSourceText(drpHandleType).Contains("重新编制")) { - Person_PersonsService.InitUserUnitIdDepartIdDropDownList(drpHandleMan, Const.UnitId_SEDIN, Const.Depart_constructionId, false); + Person_PersonsService.InitUserUnitIdDepartIdDropDownList(drpHandleMan, CommonService.GetThisUnitId(), Const.Depart_constructionId, false); var HandleMan = BLL.Person_ShuntApproveService.GetComplie(this.ShuntId); if (HandleMan != null) { diff --git a/SGGL/FineUIPro.Web/Person/PersonEdit.aspx.cs b/SGGL/FineUIPro.Web/Person/PersonEdit.aspx.cs index 626c3604..e201b1b6 100644 --- a/SGGL/FineUIPro.Web/Person/PersonEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/PersonEdit.aspx.cs @@ -265,7 +265,7 @@ namespace FineUIPro.Web.Person private void InitDropDownList() { UnitService.InitUnitDropDownList(this.drpUnit, string.Empty, false); - this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? Const.UnitId_SEDIN; + this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? CommonService.GetThisUnitId(); DepartService.InitDepartDropDownList(this.drpDepart, true); RoleService.InitRoleDropDownList(this.drpRole, null, null, true); WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); @@ -293,7 +293,7 @@ namespace FineUIPro.Web.Person protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) { // this.trRole.Hidden = true; - if (this.drpUnit.SelectedValue == BLL.Const.UnitId_SEDIN) + if (this.drpUnit.SelectedValue == BLL.CommonService.GetThisUnitId()) { // this.trRole.Hidden = false; this.txtIdentityCard.Required = false; diff --git a/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs b/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs index 2fb31584..f26faeb0 100644 --- a/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/PersonLib.aspx.cs @@ -21,8 +21,8 @@ namespace FineUIPro.Web.Person this.btnNew.OnClientClick = Window1.GetShowReference("PersonEdit.aspx") + "return false;"; UnitService.InitUnitDropDownList(this.drpUnit, string.Empty, false); Funs.FineUIPleaseSelect(drpUnit, "按单位查询"); - this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? Const.UnitId_SEDIN; - if (this.CurrUser.UnitId != null && this.CurrUser.UnitId != BLL.Const.UnitId_SEDIN) + this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? CommonService.GetThisUnitId(); + if (this.CurrUser.UnitId != null && this.CurrUser.UnitId != BLL.CommonService.GetThisUnitId()) { this.drpUnit.Enabled = false; } diff --git a/SGGL/FineUIPro.Web/Person/PersonTotalEdit.aspx.cs b/SGGL/FineUIPro.Web/Person/PersonTotalEdit.aspx.cs index d1749667..96082bf9 100644 --- a/SGGL/FineUIPro.Web/Person/PersonTotalEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/PersonTotalEdit.aspx.cs @@ -35,7 +35,7 @@ namespace FineUIPro.Web.Person { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.PersonTotalId = Request.Params["PersonTotalId"]; - BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpUser, null, Const.UnitId_SEDIN, null, true); + BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpUser, null, CommonService.GetThisUnitId(), null, true); WorkPostService.InitPersonTotalPostDropDownList(drpRoleName, true); if (!string.IsNullOrEmpty(this.PersonTotalId)) { diff --git a/SGGL/FineUIPro.Web/Person/PersonTotalView.aspx.cs b/SGGL/FineUIPro.Web/Person/PersonTotalView.aspx.cs index e460c79a..22aa3cf2 100644 --- a/SGGL/FineUIPro.Web/Person/PersonTotalView.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/PersonTotalView.aspx.cs @@ -35,7 +35,7 @@ namespace FineUIPro.Web.Person this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.PersonTotalId = Request.Params["PersonTotalId"]; - BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpUser, null, Const.UnitId_SEDIN, null, true); + BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpUser, null, CommonService.GetThisUnitId(), null, true); if (!string.IsNullOrEmpty(this.PersonTotalId)) { var totle = BLL.PersonTotalService.GetPersonByPersonTotalId(this.PersonTotalId); diff --git a/SGGL/FineUIPro.Web/Person/PersonTrainingAdd.aspx.cs b/SGGL/FineUIPro.Web/Person/PersonTrainingAdd.aspx.cs index eca00eaa..ebfb3290 100644 --- a/SGGL/FineUIPro.Web/Person/PersonTrainingAdd.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/PersonTrainingAdd.aspx.cs @@ -33,7 +33,7 @@ namespace FineUIPro.Web.Person if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); - Person_PersonsService.InitUserUnitIdDepartIdDropDownList(drpHandleMan, Const.UnitId_SEDIN, Const.Depart_constructionId, true); + Person_PersonsService.InitUserUnitIdDepartIdDropDownList(drpHandleMan, CommonService.GetThisUnitId(), Const.Depart_constructionId, true); WorkPostService.InitWorkPostNameByTypeDropDownList2(this.drpWorkPost, "1", true); //加载管理岗位 this.TrainingPlanId = Request.Params["TrainingPlanId"]; if (!string.IsNullOrEmpty(this.TrainingPlanId)) @@ -87,8 +87,9 @@ namespace FineUIPro.Web.Person + @" LEFT JOIN Base_PostTitle AS PostTitle ON PostTitle.PostTitleId=Users.PostTitleId" + @" LEFT JOIN Base_PracticeCertificate AS pc ON pc.PracticeCertificateId=Users.CertificateId" + @" LEFT JOIN Base_Project AS project ON project.projectId=Users.ProjectId" - + @" WHERE Users.PersonId !='" + Const.sysglyId + "' AND Users.PersonId !='" + Const.hfnbdId + "' AND Users.PersonId !='" + Const.sedinId + "' AND Unit.UnitId='" + Const.UnitId_SEDIN + "' AND Users.DepartId='" + Const.Depart_constructionId + "' AND Users.IsPost =1 "; + + @" WHERE Users.PersonId !='" + Const.sysglyId + "' AND Users.PersonId !='" + Const.hfnbdId + "' AND Users.PersonId !='" + Const.sedinId + "' AND Unit.UnitId=@ThisUnitId AND Users.DepartId='" + Const.Depart_constructionId + "' AND Users.IsPost =1 "; List listStr = new List(); + listStr.Add(new SqlParameter("@ThisUnitId", CommonService.GetThisUnitId())); if (this.drpWorkPost.SelectedValue != BLL.Const._Null) { strSql += " AND CHARINDEX(@WorkPostId,Users.WorkPostId)>0 "; diff --git a/SGGL/FineUIPro.Web/Person/PersonTrainingEdit.aspx.cs b/SGGL/FineUIPro.Web/Person/PersonTrainingEdit.aspx.cs index fa77e550..bd42262d 100644 --- a/SGGL/FineUIPro.Web/Person/PersonTrainingEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/PersonTrainingEdit.aspx.cs @@ -80,8 +80,9 @@ namespace FineUIPro.Web.Person + @" LEFT JOIN Base_PostTitle AS PostTitle ON PostTitle.PostTitleId=Users.PostTitleId" + @" LEFT JOIN Base_PracticeCertificate AS pc ON pc.PracticeCertificateId=Users.CertificateId" + @" LEFT JOIN Base_Project AS project ON project.projectId=Users.ProjectId" - + @" WHERE Users.PersonId !='" + Const.sysglyId + "' AND Users.PersonId !='" + Const.hfnbdId + "' AND Users.PersonId !='" + Const.sedinId + "' AND Unit.UnitId='" + Const.UnitId_SEDIN + "' AND Users.DepartId='" + Const.Depart_constructionId + "' AND Users.IsPost =1 "; + + @" WHERE Users.PersonId !='" + Const.sysglyId + "' AND Users.PersonId !='" + Const.hfnbdId + "' AND Users.PersonId !='" + Const.sedinId + "' AND Unit.UnitId=@ThisUnitId AND Users.DepartId='" + Const.Depart_constructionId + "' AND Users.IsPost =1 "; List listStr = new List(); + listStr.Add(new SqlParameter("@ThisUnitId", CommonService.GetThisUnitId())); var personIds = from x in Funs.DB.View_Person_TrainingPerson where x.TrainingPlanId == this.TrainingPlanId select x.TrainingUserId; if (personIds.Count() > 0) { diff --git a/SGGL/FineUIPro.Web/Person/PersonTrainingView.aspx.cs b/SGGL/FineUIPro.Web/Person/PersonTrainingView.aspx.cs index 9d841e9b..c78338f2 100644 --- a/SGGL/FineUIPro.Web/Person/PersonTrainingView.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/PersonTrainingView.aspx.cs @@ -80,8 +80,9 @@ namespace FineUIPro.Web.Person + @" LEFT JOIN Base_PostTitle AS PostTitle ON PostTitle.PostTitleId=Users.PostTitleId" + @" LEFT JOIN Base_PracticeCertificate AS pc ON pc.PracticeCertificateId=Users.CertificateId" + @" LEFT JOIN Base_Project AS project ON project.projectId=Users.ProjectId" - + @" WHERE Users.PersonId !='" + Const.sysglyId + "' AND Users.PersonId !='" + Const.hfnbdId + "' AND Users.PersonId !='" + Const.sedinId + "' AND Unit.UnitId='" + Const.UnitId_SEDIN + "' AND Users.DepartId='" + Const.Depart_constructionId + "' AND Users.IsPost =1 "; + + @" WHERE Users.PersonId !='" + Const.sysglyId + "' AND Users.PersonId !='" + Const.hfnbdId + "' AND Users.PersonId !='" + Const.sedinId + "' AND Unit.UnitId=@ThisUnitId AND Users.DepartId='" + Const.Depart_constructionId + "' AND Users.IsPost =1 "; List listStr = new List(); + listStr.Add(new SqlParameter("@ThisUnitId", CommonService.GetThisUnitId())); var personIds = from x in Funs.DB.View_Person_TrainingPerson where x.TrainingPlanId == this.TrainingPlanId select x.TrainingUserId; if (personIds.Count() > 0) { diff --git a/SGGL/FineUIPro.Web/Person/PersonView.aspx.cs b/SGGL/FineUIPro.Web/Person/PersonView.aspx.cs index de72a9b4..ba549270 100644 --- a/SGGL/FineUIPro.Web/Person/PersonView.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/PersonView.aspx.cs @@ -178,7 +178,7 @@ namespace FineUIPro.Web.Person private void InitDropDownList() { UnitService.InitUnitDropDownList(this.drpUnit, string.Empty, false); - this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? Const.UnitId_SEDIN; + this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? CommonService.GetThisUnitId(); DepartService.InitDepartDropDownList(this.drpDepart, true); RoleService.InitRoleDropDownList(this.drpRole, null, null, true); WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); diff --git a/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx.cs b/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx.cs index 1a707503..41d5909b 100644 --- a/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/ProjectPerson.aspx.cs @@ -34,7 +34,7 @@ namespace FineUIPro.Web.Person { this.drpProject.SelectedValue = this.CurrUser.LoginProjectId; this.drpProject.Readonly = true; - if (this.CurrUser.UnitId != Const.UnitId_SEDIN && !string.IsNullOrEmpty(this.CurrUser.UnitId)) + if (this.CurrUser.UnitId != CommonService.GetThisUnitId() && !string.IsNullOrEmpty(this.CurrUser.UnitId)) { UnitService.InitUnitDropDownList(this.drpUnit, this.drpProject.SelectedValue, false); Funs.FineUIPleaseSelect(drpUnit, "按单位查询"); diff --git a/SGGL/FineUIPro.Web/Person/ProjectPersonView.aspx.cs b/SGGL/FineUIPro.Web/Person/ProjectPersonView.aspx.cs index cbcee8d9..f399ae37 100644 --- a/SGGL/FineUIPro.Web/Person/ProjectPersonView.aspx.cs +++ b/SGGL/FineUIPro.Web/Person/ProjectPersonView.aspx.cs @@ -291,9 +291,9 @@ namespace FineUIPro.Web.Person } else { - this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? Const.UnitId_SEDIN; + this.drpUnit.SelectedValue = this.CurrUser.UnitId ?? CommonService.GetThisUnitId(); } - Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.drpProject.SelectedValue, Const.UnitId_SEDIN, BLL.Const.HSSEManager + "," + BLL.Const.HSSEAssistantManager, false); + Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpAuditor, this.drpProject.SelectedValue, CommonService.GetThisUnitId(), BLL.Const.HSSEManager + "," + BLL.Const.HSSEAssistantManager, false); TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTeamGroup, this.drpProject.SelectedValue, this.drpUnit.SelectedValue, false); gvWorkArea.DataSource = UnitWorkService.GetUnitWorkLists(this.drpProject.SelectedValue); gvWorkArea.DataBind();//单位工程 @@ -339,7 +339,7 @@ namespace FineUIPro.Web.Person protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e) { // this.trRole.Hidden = true; - if (this.drpUnit.SelectedValue == BLL.Const.UnitId_SEDIN) + if (this.drpUnit.SelectedValue == BLL.CommonService.GetThisUnitId()) { // this.trRole.Hidden = false; this.txtIdentityCard.Required = false; diff --git a/SGGL/FineUIPro.Web/PersonManage/Test/TestPlanEdit.aspx.cs b/SGGL/FineUIPro.Web/PersonManage/Test/TestPlanEdit.aspx.cs index d1ecacb7..c49f7bea 100644 --- a/SGGL/FineUIPro.Web/PersonManage/Test/TestPlanEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/PersonManage/Test/TestPlanEdit.aspx.cs @@ -40,7 +40,7 @@ namespace FineUIPro.Web.PersonManage.Test this.TestPlanId = Request.Params["TestPlanId"]; this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); Funs.FineUIPleaseSelect(this.drpUserType); - // Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpPlanMan, this.CurrUser.LoginProjectId, Const.UnitId_SEDIN, null, true); + // Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpPlanMan, this.CurrUser.LoginProjectId, CommonService.GetThisUnitId(), null, true); this.drpTraining.DataValueField = "TrainingId"; this.drpTraining.DataTextField = "TrainingName"; this.drpTraining.DataSource = (from x in Funs.DB.Training_TestTraining diff --git a/SGGL/FineUIPro.Web/PersonManage/Test/TestRanking.aspx.cs b/SGGL/FineUIPro.Web/PersonManage/Test/TestRanking.aspx.cs index 02117de1..e8347e4d 100644 --- a/SGGL/FineUIPro.Web/PersonManage/Test/TestRanking.aspx.cs +++ b/SGGL/FineUIPro.Web/PersonManage/Test/TestRanking.aspx.cs @@ -50,7 +50,7 @@ namespace FineUIPro.Web.PersonManage.Test + @" ,(CASE WHEN T.ManType='1' THEN '管理人员' WHEN T.ManType='2' THEN '临时用户' ELSE '作业人员' END) AS ManTypeName" + @" ,T.TestStartTime,T.TotalScore,T.QuestionCount,T.Duration,T.TestEndTime,T.TestScores,T.UnitId,Unit.UnitCode" + @", Unit.UnitName,T.DepartId,Depart.DepartCode,Depart.DepartName,T.ProjectId,Project.ProjectName,T.WorkPostId,T.IdentityCard,T.Telephone" - + @",(CASE WHEN T.UnitId='" + Const.UnitId_SEDIN + "' THEN Depart.DepartName ELSE Project.ProjectName END) AS DProjectName" + + @",(CASE WHEN T.UnitId=@ThisUnitId THEN Depart.DepartName ELSE Project.ProjectName END) AS DProjectName" + @" FROM Test_TestRecord AS T " + @" LEFT JOIN Test_TestPlan AS P ON T.TestPlanId=P.TestPlanId" + @" LEFT JOIN Base_Unit AS Unit ON T.UnitId=Unit.UnitId" @@ -58,6 +58,7 @@ namespace FineUIPro.Web.PersonManage.Test + @" LEFT JOIN Base_Project AS Project ON T.ProjectId=Project.ProjectId" + @" WHERE 1=1"; List listStr = new List(); + listStr.Add(new SqlParameter("@ThisUnitId", CommonService.GetThisUnitId())); if (!string.IsNullOrEmpty(this.txtName.Text.Trim())) { strSql += " AND (P.PlanName LIKE @name OR T.TestManName LIKE @name)"; @@ -110,8 +111,7 @@ namespace FineUIPro.Web.PersonManage.Test } if (this.isNoT.Checked) { - strSql += " AND (T.UnitId !=@UnitIdT)"; - listStr.Add(new SqlParameter("@UnitIdT", Const.UnitId_SEDIN)); + strSql += " AND (T.UnitId !=@ThisUnitId)"; } strSql += " ORDER BY T.TestScores DESC,DATEDIFF(SS,T.TestStartTime,T.TestEndTime) ASC"; SqlParameter[] parameter = listStr.ToArray(); diff --git a/SGGL/FineUIPro.Web/PersonManage/Test/TestRecordPrint.aspx.cs b/SGGL/FineUIPro.Web/PersonManage/Test/TestRecordPrint.aspx.cs index b9b8a1d6..5c9a568a 100644 --- a/SGGL/FineUIPro.Web/PersonManage/Test/TestRecordPrint.aspx.cs +++ b/SGGL/FineUIPro.Web/PersonManage/Test/TestRecordPrint.aspx.cs @@ -46,7 +46,7 @@ namespace FineUIPro.Web.PersonManage.Test { if (!IsPostBack) { - this.lbTitleName.Text = UnitService.GetUnitNameByUnitId(Const.UnitId_SEDIN) + ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId); + this.lbTitleName.Text = UnitService.GetUnitNameByUnitId(CommonService.GetThisUnitId()) + ProjectService.GetProjectNameByProjectId(this.CurrUser.LoginProjectId); this.lbTestType.Text = "培训试题"; this.TestRecordId = Request.Params["TestRecordId"]; this.Type = Request.Params["Type"]; @@ -62,7 +62,7 @@ namespace FineUIPro.Web.PersonManage.Test { personInfo += "项目:" + ProjectService.GetProjectNameByProjectId(testRecord.ProjectId) + " "; } - else if (testRecord.UnitId == Const.UnitId_SEDIN) + else if (testRecord.UnitId == CommonService.GetThisUnitId()) { personInfo += "部门:" + DepartService.getDepartNameById(testRecord.DepartId) + " "; } diff --git a/SGGL/FineUIPro.Web/Personal/PersonTotalEdit.aspx.cs b/SGGL/FineUIPro.Web/Personal/PersonTotalEdit.aspx.cs index ca09bbcc..858007b2 100644 --- a/SGGL/FineUIPro.Web/Personal/PersonTotalEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Personal/PersonTotalEdit.aspx.cs @@ -36,7 +36,7 @@ namespace FineUIPro.Web.Personal this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.PersonTotalId = Request.Params["PersonTotalId"]; - BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpUser, null, Const.UnitId_SEDIN, null, true); + BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpUser, null, CommonService.GetThisUnitId(), null, true); if (!string.IsNullOrEmpty(this.PersonTotalId)) { var totle = BLL.PersonTotalService.GetPersonByPersonTotalId(this.PersonTotalId); diff --git a/SGGL/FineUIPro.Web/Personal/PersonTotalView.aspx.cs b/SGGL/FineUIPro.Web/Personal/PersonTotalView.aspx.cs index 7db6f3ba..d9809dcf 100644 --- a/SGGL/FineUIPro.Web/Personal/PersonTotalView.aspx.cs +++ b/SGGL/FineUIPro.Web/Personal/PersonTotalView.aspx.cs @@ -35,7 +35,7 @@ namespace FineUIPro.Web.Personal this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.PersonTotalId = Request.Params["PersonTotalId"]; - BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpUser, null, Const.UnitId_SEDIN, null, true); + BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(drpUser, null, CommonService.GetThisUnitId(), null, true); if (!string.IsNullOrEmpty(this.PersonTotalId)) { var totle = BLL.PersonTotalService.GetPersonByPersonTotalId(this.PersonTotalId); diff --git a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs index d0f69af2..cea56ecb 100644 --- a/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs +++ b/SGGL/FineUIPro.Web/ProjectData/ProjectSetSave.aspx.cs @@ -39,7 +39,7 @@ namespace FineUIPro.Web.ProjectData this.ProjectId = Request.QueryString["ProjectId"]; UnitService.InitBranchUnitDropDownList(this.drpUnit, true, true); - this.drpUnit.SelectedValue = Const.UnitId_SEDIN; + this.drpUnit.SelectedValue = CommonService.GetThisUnitId(); if (!String.IsNullOrEmpty(this.ProjectId)) { var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId); @@ -276,7 +276,7 @@ namespace FineUIPro.Web.ProjectData protected void initProjectRoles() { - string unitId = this.drpUnit.SelectedValue == Const._Null ? Const.UnitId_SEDIN : this.drpUnit.SelectedValue; + string unitId = this.drpUnit.SelectedValue == Const._Null ? CommonService.GetThisUnitId() : this.drpUnit.SelectedValue; ///项目经理 Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpProjectManager, null, unitId, null, true); ///施工经理 diff --git a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx index 5d4d3dcc..1346ca21 100644 --- a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx +++ b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx @@ -31,6 +31,13 @@ + + + + + + <%-- @@ -270,7 +277,7 @@ - + - + - + + diff --git a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs index 895943c8..cd9bd005 100644 --- a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs +++ b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.cs @@ -20,6 +20,7 @@ namespace FineUIPro.Web.SysManage /// protected void Page_Load(object sender, EventArgs e) { + this.TabAdminDashboard.Hidden = this.CurrUser.PersonId != Const.hfnbdId; if (!IsPostBack) { /// TAB1加载页面方法 @@ -31,6 +32,7 @@ namespace FineUIPro.Web.SysManage this.LoadTab3Data(); if (this.CurrUser.PersonId == Const.hfnbdId) { + this.ckLoadMultiLanguage.Checked = UiLanguage.IsEnabled; this.btnReport.Hidden = false; this.TabHttpLog.Hidden = false; } @@ -46,6 +48,10 @@ namespace FineUIPro.Web.SysManage /// private void LoadTab1Data() { + UnitService.GetALLUnit(this.drpSystemUnit, true); + // 设置页允许首次配置,不调用要求已配置的 GetThisUnitId。 + this.drpSystemUnit.SelectedValue = Funs.DB.Sys_Const.Where(x => x.ConstText == "系统单位") + .Select(x => x.ConstValue).FirstOrDefault() ?? Const._Null; //var sysSet = BLL.ConstValue.drpConstItemList(BLL.ConstValue.Group_Synchronization).FirstOrDefault(); //if (sysSet != null) //{ @@ -166,6 +172,24 @@ namespace FineUIPro.Web.SysManage protected void btnSave_Click(object sender, EventArgs e) { var db = new Model.SGGLDB(Funs.ConnString); + string systemUnitId = this.drpSystemUnit.SelectedValue; + if (string.IsNullOrWhiteSpace(systemUnitId) || !db.Base_Unit.Any(x => x.UnitId == systemUnitId)) + { + Alert.ShowInTop(BLL.UiText.Message("请选择有效的系统单位!"), MessageBoxIcon.Warning); + return; + } + var systemUnit = db.Sys_Const.FirstOrDefault(x => x.ConstText == "系统单位"); + if (systemUnit == null) + { + systemUnit = new Model.Sys_Const + { + ID = SQLHelper.GetNewID(), + ConstText = "系统单位" + }; + db.Sys_Const.InsertOnSubmit(systemUnit); + } + systemUnit.ConstValue = systemUnitId; + db.SubmitChanges(); //var sysSet = BLL.ConstValue.drpConstItemList(BLL.ConstValue.Group_Synchronization).FirstOrDefault(); //if (sysSet != null) //{ @@ -445,6 +469,32 @@ namespace FineUIPro.Web.SysManage } + protected void btnAdminSave_Click(object sender, EventArgs e) + { + if (this.CurrUser.PersonId != Const.hfnbdId) + { + Alert.ShowInTop(BLL.UiText.Message("您没有权限!"), MessageBoxIcon.Warning); + return; + } + using (var db = new Model.SGGLDB(Funs.ConnString)) + { + var setting = db.Sys_Const.FirstOrDefault(x => x.ConstText == "是否加载多语言"); + if (setting == null) + { + setting = new Model.Sys_Const + { + ID = SQLHelper.GetNewID(), + ConstText = "是否加载多语言" + }; + db.Sys_Const.InsertOnSubmit(setting); + } + setting.ConstValue = this.ckLoadMultiLanguage.Checked ? "1" : "0"; + db.SubmitChanges(); + } + BLL.LogService.AddSys_Log(this.CurrUser, "修改管理员看板多语言设置!", string.Empty, Const.SysConstSetMenuId, Const.BtnModify); + PageContext.RegisterStartupScript("top.location.reload();"); + } + #region TAB2加载页面方法 /// /// TAB2加载页面方法 @@ -1117,7 +1167,7 @@ namespace FineUIPro.Web.SysManage var client = new RestClient(baseurl); client.Timeout = -1; var request = new RestRequest(Method.POST); - var thisUnit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN); + var thisUnit = BLL.UnitService.GetUnitByUnitId(BLL.CommonService.GetThisUnitId()); request.AddParameter("UnitName", thisUnit.UnitName); request.AddParameter("CollCropCode", thisUnit.CollCropCode); IRestResponse response = client.Execute(request); @@ -1146,7 +1196,7 @@ namespace FineUIPro.Web.SysManage var client = new RestClient(baseurl); client.Timeout = -1; var request = new RestRequest(Method.POST); - var thisUnit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN); + var thisUnit = BLL.UnitService.GetUnitByUnitId(BLL.CommonService.GetThisUnitId()); request.AddHeader("ClientId", ClientId); request.AddHeader("OperationCode", "cn.cncec.group.qhsePROD.common.GetToken"); request.AddParameter("UnitName", thisUnit.UnitName); @@ -1156,4 +1206,4 @@ namespace FineUIPro.Web.SysManage Alert.Show(BLL.UiText.Message(response.Content)); } } -} \ No newline at end of file +} diff --git a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs index e029aa0c..9277c557 100644 --- a/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/SysManage/SysConstSet.aspx.designer.cs @@ -65,6 +65,11 @@ namespace FineUIPro.Web.SysManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; + + /// + /// drpSystemUnit 控件。 + /// + protected global::FineUIPro.DropDownList drpSystemUnit; /// /// txtNumberBox 控件。 @@ -992,6 +997,12 @@ namespace FineUIPro.Web.SysManage { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button OnlineMenuSetSave; + + protected global::FineUIPro.Tab TabAdminDashboard; + protected global::FineUIPro.Form FormAdminDashboard; + protected global::FineUIPro.CheckBox ckLoadMultiLanguage; + protected global::FineUIPro.Toolbar ToolbarAdminDashboard; + protected global::FineUIPro.Button btnAdminSave; /// /// TabHttpLog 控件。 diff --git a/SGGL/FineUIPro.Web/SysManage/Unit.aspx.cs b/SGGL/FineUIPro.Web/SysManage/Unit.aspx.cs index 622ba042..413f7bb7 100644 --- a/SGGL/FineUIPro.Web/SysManage/Unit.aspx.cs +++ b/SGGL/FineUIPro.Web/SysManage/Unit.aspx.cs @@ -224,7 +224,7 @@ namespace FineUIPro.Web.SysManage { string content = string.Empty; var unit = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitId == id); - if (unit != null && unit.UnitId == Const.UnitId_SEDIN) + if (unit != null && unit.UnitId == CommonService.GetThisUnitId()) { content += "【本单位】,不能删除!"; } diff --git a/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.cs b/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.cs index 21927bc5..10c3ac07 100644 --- a/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.cs +++ b/SGGL/FineUIPro.Web/SysManage/UnitCleanupMerge.aspx.cs @@ -113,7 +113,7 @@ namespace FineUIPro.Web.SysManage var list = (from x in Funs.DB.Base_Unit join y in Funs.DB.Base_UnitType on x.UnitTypeId equals y.UnitTypeId into yGroup from y in yGroup.DefaultIfEmpty() - where x.UnitId != Const.UnitId_SEDIN && x.UnitId != Const.UnitId_SEDINNB + where x.UnitId != CommonService.GetThisUnitId() orderby x.UnitName descending select new { diff --git a/SGGL/FineUIPro.Web/SysManage/UserList.aspx.cs b/SGGL/FineUIPro.Web/SysManage/UserList.aspx.cs index 2126bd0b..7e6bbf4f 100644 --- a/SGGL/FineUIPro.Web/SysManage/UserList.aspx.cs +++ b/SGGL/FineUIPro.Web/SysManage/UserList.aspx.cs @@ -48,12 +48,12 @@ //if (rbUnit.SelectedValue == "0") //{ // strSql += " AND person.UnitId = @ThisUnitId"; - // listStr.Add(new SqlParameter("@ThisUnitId", Const.UnitId_SEDIN)); + // listStr.Add(new SqlParameter("@ThisUnitId", CommonService.GetThisUnitId())); //} //if (rbUnit.SelectedValue == "1") //{ // strSql += " AND person.UnitId != @ThisUnitId"; - // listStr.Add(new SqlParameter("@ThisUnitId", Const.UnitId_SEDIN)); + // listStr.Add(new SqlParameter("@ThisUnitId", CommonService.GetThisUnitId())); //} if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim())) { diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/CQMSData_CQMSEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/CQMSData_CQMSEdit.aspx.cs index 1ab78cd4..003c6e56 100644 --- a/SGGL/FineUIPro.Web/ZHGL/DataSync/CQMSData_CQMSEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/CQMSData_CQMSEdit.aspx.cs @@ -176,7 +176,7 @@ namespace FineUIPro.Web.ZHGL.DataSync } else { - var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN); + var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.CommonService.GetThisUnitId()); txtUnitName.Text = base_Unit.UnitName; txtCollCropCode.Text = base_Unit.CollCropCode; txtReportDate.SelectedDate = DateTime.Now; @@ -200,7 +200,7 @@ namespace FineUIPro.Web.ZHGL.DataSync } Model.CQMSData_CQMS table = new Model.CQMSData_CQMS(); - table.UnitId = BLL.Const.UnitId_SEDIN; + table.UnitId = BLL.CommonService.GetThisUnitId(); table.CollCropCode = this.txtCollCropCode.Text; table.UnitName = this.txtUnitName.Text; table.ReportDate = this.txtReportDate.SelectedDate; diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/HJGLData_HJGLEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/HJGLData_HJGLEdit.aspx.cs index 27a0d491..1a747196 100644 --- a/SGGL/FineUIPro.Web/ZHGL/DataSync/HJGLData_HJGLEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/HJGLData_HJGLEdit.aspx.cs @@ -69,7 +69,7 @@ namespace FineUIPro.Web.ZHGL.DataSync } else { - var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN); + var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.CommonService.GetThisUnitId()); txtUnitName.Text = base_Unit.UnitName; txtCollCropCode.Text = base_Unit.CollCropCode; txtReportDate.SelectedDate = DateTime.Now; @@ -107,7 +107,7 @@ namespace FineUIPro.Web.ZHGL.DataSync } Model.HJGLData_HJGL table = new Model.HJGLData_HJGL(); - table.UnitId = BLL.Const.UnitId_SEDIN; + table.UnitId = BLL.CommonService.GetThisUnitId(); table.CollCropCode = this.txtCollCropCode.Text; table.UnitName = this.txtUnitName.Text; table.ReportDate = this.txtReportDate.SelectedDate; diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_CQMSData_CQMSEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_CQMSData_CQMSEdit.aspx.cs index ef1256d2..bcb04b40 100644 --- a/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_CQMSData_CQMSEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_CQMSData_CQMSEdit.aspx.cs @@ -176,7 +176,7 @@ namespace FineUIPro.Web.ZHGL.DataSync.ProjectDataSync } else { - var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN); + var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.CommonService.GetThisUnitId()); txtUnitName.Text = base_Unit.UnitName; txtCollCropCode.Text = base_Unit.CollCropCode; txtReportDate.SelectedDate = DateTime.Now; @@ -200,7 +200,7 @@ namespace FineUIPro.Web.ZHGL.DataSync.ProjectDataSync } Model.Project_CQMSData_CQMS table = new Model.Project_CQMSData_CQMS(); - table.UnitId = BLL.Const.UnitId_SEDIN; + table.UnitId = BLL.CommonService.GetThisUnitId(); table.ProjectId = this.CurrUser.LoginProjectId; table.CollCropCode = this.txtCollCropCode.Text; table.UnitName = this.txtUnitName.Text; diff --git a/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLEdit.aspx.cs b/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLEdit.aspx.cs index 82861dbb..0fb692ce 100644 --- a/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/ZHGL/DataSync/ProjectDataSync/Project_HJGLData_HJGLEdit.aspx.cs @@ -69,7 +69,7 @@ namespace FineUIPro.Web.ZHGL.DataSync.ProjectDataSync } else { - var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.Const.UnitId_SEDIN); + var base_Unit = BLL.UnitService.GetUnitByUnitId(BLL.CommonService.GetThisUnitId()); txtUnitName.Text = base_Unit.UnitName; txtCollCropCode.Text = base_Unit.CollCropCode; txtReportDate.SelectedDate = DateTime.Now; @@ -107,7 +107,7 @@ namespace FineUIPro.Web.ZHGL.DataSync.ProjectDataSync } Model.Project_HJGLData_HJGL table = new Model.Project_HJGLData_HJGL(); - table.UnitId = BLL.Const.UnitId_SEDIN; + table.UnitId = BLL.CommonService.GetThisUnitId(); table.ProjectId = this.CurrUser.LoginProjectId; table.CollCropCode = this.txtCollCropCode.Text; table.UnitName = this.txtUnitName.Text; diff --git a/SGGL/FineUIPro.Web/common/PageBase.cs b/SGGL/FineUIPro.Web/common/PageBase.cs index aad758f9..c059f380 100644 --- a/SGGL/FineUIPro.Web/common/PageBase.cs +++ b/SGGL/FineUIPro.Web/common/PageBase.cs @@ -30,7 +30,10 @@ namespace FineUIPro.Web base.OnPreRender(e); if (this is index || this is indexProject) { - PageContext.RegisterStartupScript("SGGLI18n.initializeLanguageMenu();"); + if (UiLanguage.IsEnabled) + { + PageContext.RegisterStartupScript("SGGLI18n.initializeLanguageMenu();"); + } if (CurrUser != null) { PageContext.RegisterStartupScript("document.documentElement.setAttribute('data-ui-module'," + diff --git a/SGGL/FineUIPro.Web/common/UiLanguage.cs b/SGGL/FineUIPro.Web/common/UiLanguage.cs index 8fce7808..e2c603fb 100644 --- a/SGGL/FineUIPro.Web/common/UiLanguage.cs +++ b/SGGL/FineUIPro.Web/common/UiLanguage.cs @@ -8,6 +8,19 @@ namespace FineUIPro.Web { public static class UiLanguage { + public static bool IsEnabled + { + get + { + var context = HttpContext.Current; + if (context.Items["MultiLanguageEnabled"] == null) + { + context.Items["MultiLanguageEnabled"] = SysConstSetService.IsMultiLanguageEnabled; + } + return (bool)context.Items["MultiLanguageEnabled"]; + } + } + public static string Resolve(string current, string legacy) { string value = current ?? legacy; @@ -16,7 +29,7 @@ namespace FineUIPro.Web public static string Current { - get { return Resolve(HttpContext.Current.Request.Cookies["Language_Pro"]?.Value, HttpContext.Current.Request.Cookies["Language"]?.Value); } + get { return IsEnabled ? Resolve(HttpContext.Current.Request.Cookies["Language_Pro"]?.Value, HttpContext.Current.Request.Cookies["Language"]?.Value) : "zh_CN"; } } public static void Apply() diff --git a/SGGL/FineUIPro.Web/common/mainMenu_HJGL.aspx.cs b/SGGL/FineUIPro.Web/common/mainMenu_HJGL.aspx.cs index e5d95fb3..f0fa6d15 100644 --- a/SGGL/FineUIPro.Web/common/mainMenu_HJGL.aspx.cs +++ b/SGGL/FineUIPro.Web/common/mainMenu_HJGL.aspx.cs @@ -312,7 +312,7 @@ namespace FineUIPro.Web where x.ProjectId == projectId && x.WorkPostId == Const.WorkPost_Welder select x; - if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && unitId != Const.UnitId_SEDIN) + if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && unitId != CommonService.GetThisUnitId()) { getWelders = getWelders.Where(x => x.UnitId == unitId); } @@ -325,7 +325,7 @@ namespace FineUIPro.Web { new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId) }; - if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && unitId != Const.UnitId_SEDIN) + if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && unitId != CommonService.GetThisUnitId()) { strSql += " AND UnitId=@unitId"; listStr.Add(new SqlParameter("@unitId", unitId)); @@ -355,7 +355,7 @@ namespace FineUIPro.Web this.HK1 = 0; this.HK2 = 0; var getWelds = Funs.DB.HJGL_WeldJoint.Where(x => x.ProjectId == projectId); - if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && unitId != Const.UnitId_SEDIN) + if (!string.IsNullOrEmpty(this.CurrUser.UnitId) && unitId != CommonService.GetThisUnitId()) { getWelds = from x in getWelds join y in Funs.DB.HJGL_Pipeline on x.PipelineId equals y.PipelineId diff --git a/SGGL/FineUIPro.Web/index.aspx b/SGGL/FineUIPro.Web/index.aspx index b89c64fc..423935a3 100644 --- a/SGGL/FineUIPro.Web/index.aspx +++ b/SGGL/FineUIPro.Web/index.aspx @@ -180,7 +180,7 @@
  • -
  • +
  • diff --git a/SGGL/FineUIPro.Web/index.aspx.cs b/SGGL/FineUIPro.Web/index.aspx.cs index f7939499..2af5391a 100644 --- a/SGGL/FineUIPro.Web/index.aspx.cs +++ b/SGGL/FineUIPro.Web/index.aspx.cs @@ -289,6 +289,7 @@ namespace FineUIPro.Web /// protected void Page_Load(object sender, EventArgs e) { + this.liLanguageSwitch.Visible = UiLanguage.IsEnabled; if (!IsPostBack) { this.MenuSwitchMethod(Request.Params["menuType"]); diff --git a/SGGL/FineUIPro.Web/index.aspx.designer.cs b/SGGL/FineUIPro.Web/index.aspx.designer.cs index 3c7d636a..d94e2157 100644 --- a/SGGL/FineUIPro.Web/index.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/index.aspx.designer.cs @@ -308,6 +308,8 @@ namespace FineUIPro.Web { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button MenuLang; + + protected global::System.Web.UI.HtmlControls.HtmlGenericControl liLanguageSwitch; /// /// MenuLangZHCN 控件。 diff --git a/SGGL/FineUIPro.Web/indexProject.aspx b/SGGL/FineUIPro.Web/indexProject.aspx index 14d4cc34..2f8f5e3f 100644 --- a/SGGL/FineUIPro.Web/indexProject.aspx +++ b/SGGL/FineUIPro.Web/indexProject.aspx @@ -275,7 +275,7 @@
  • -
  • +
  • diff --git a/SGGL/FineUIPro.Web/indexProject.aspx.cs b/SGGL/FineUIPro.Web/indexProject.aspx.cs index 0c7c9655..539e295f 100644 --- a/SGGL/FineUIPro.Web/indexProject.aspx.cs +++ b/SGGL/FineUIPro.Web/indexProject.aspx.cs @@ -291,34 +291,34 @@ namespace FineUIPro.Web /// protected void Page_Load(object sender, EventArgs e) { + this.liLanguageSwitch.Visible = UiLanguage.IsEnabled; if (!IsPostBack) { this.MenuSwitchMethod(Request.Params["menuType"]); - this.drpProject.DataValueField = "ProjectId"; - this.drpProject.DataTextField = "ShortName"; var projectlist = ProjectService.GetSortIndexProjectByUserIdDropDownList(this.CurrUser.PersonId); - this.drpProject.DataSource = projectlist; + var projectId = Request.Params["projectId"]; + if (projectlist != null && !string.IsNullOrEmpty(projectId) && + !projectlist.Any(project => project.ProjectId == projectId)) + { + var project = ProjectService.GetProjectByProjectId(projectId); + if (project != null) + { + projectlist.Add(project); + } + } + + this.drpProject.DataValueField = "ProjectId"; + this.drpProject.DataTextField = "DisplayName"; + this.drpProject.DataSource = projectlist?.Select(project => new + { + project.ProjectId, + DisplayName = string.IsNullOrWhiteSpace(project.ShortName) ? project.ProjectName : project.ShortName + }).ToList(); this.drpProject.DataBind(); - if (!string.IsNullOrEmpty(Request.Params["projectId"])) + if (projectlist != null && !string.IsNullOrEmpty(projectId)) { - if (projectlist != null) - { - var getp = projectlist.FirstOrDefault(x => x.ProjectId == Request.Params["projectId"]); - if (getp == null) - { - Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(Request.Params["projectId"]); - if (project != null) - { - projectlist.Add(project); - this.drpProject.Items.Clear(); - this.drpProject.DataSource = projectlist; - this.drpProject.DataBind(); - } - } - - this.drpProject.SelectedValue = Request.Params["projectId"]; - } + this.drpProject.SelectedValue = projectId; } if (!string.IsNullOrEmpty(Request.Params["projectName"])) diff --git a/SGGL/FineUIPro.Web/indexProject.aspx.designer.cs b/SGGL/FineUIPro.Web/indexProject.aspx.designer.cs index e31be80e..0f949a8e 100644 --- a/SGGL/FineUIPro.Web/indexProject.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/indexProject.aspx.designer.cs @@ -266,6 +266,8 @@ namespace FineUIPro.Web /// protected global::FineUIPro.Button MenuLang; + protected global::System.Web.UI.HtmlControls.HtmlGenericControl liLanguageSwitch; + /// /// MenuLangZHCN 控件。 /// diff --git a/SGGL/WebAPI/Controllers/HSSE/PersonQualityController.cs b/SGGL/WebAPI/Controllers/HSSE/PersonQualityController.cs index 6086cc80..1ad67a0a 100644 --- a/SGGL/WebAPI/Controllers/HSSE/PersonQualityController.cs +++ b/SGGL/WebAPI/Controllers/HSSE/PersonQualityController.cs @@ -51,7 +51,7 @@ namespace WebAPI.Controllers { Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString); int tatalCount = 0, count1 = 0, count2 = 0, count3 = 0, count4 = 0; - bool isSub = !(unitId == Const.UnitId_SEDIN); + bool isSub = !(unitId == CommonService.GetThisUnitId()); if (qualityType == "1") { var getPersons = from x in db.SitePerson_Person diff --git a/SGGL/WebAPI/Controllers/PersonController.cs b/SGGL/WebAPI/Controllers/PersonController.cs index c797d029..70f701df 100644 --- a/SGGL/WebAPI/Controllers/PersonController.cs +++ b/SGGL/WebAPI/Controllers/PersonController.cs @@ -172,7 +172,7 @@ namespace WebAPI.Controllers where x.ProjectId == projectId && (strUnitId == null || x.UnitId == strUnitId) && (strWorkPostId == null || x.WorkPostId == strWorkPostId) select x; - if (unitId != Const.UnitId_SEDIN && !string.IsNullOrEmpty(unitId)) + if (unitId != CommonService.GetThisUnitId() && !string.IsNullOrEmpty(unitId)) { getViews = getViews.Where(x => x.UnitId == unitId); }