From a37909b6087830cddc33512e9f6ca255fa9249b9 Mon Sep 17 00:00:00 2001 From: xiaju <1784803958@qq.com> Date: Tue, 8 Apr 2025 18:30:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=AE=A1=E7=90=86=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E5=85=AC=E5=8F=B8=E7=BA=A7=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FineUIPro.Web/Door/AbsenceDuty.aspx.cs | 10 +- SUBQHSE/FineUIPro.Web/Door/InOutList.aspx.cs | 10 +- .../FineUIPro.Web/Door/InOutManHours.aspx.cs | 11 +- .../FineUIPro.Web/Door/InOutRecord.aspx.cs | 11 +- .../Door/InOutRecordStatistics.aspx.cs | 10 +- .../HSSE/EduTrain/TaskNotice.aspx | 175 ++++++++++-------- .../HSSE/EduTrain/TaskNotice.aspx.cs | 81 ++++++-- .../HSSE/EduTrain/TaskNotice.aspx.designer.cs | 45 +++++ .../HSSE/EduTrain/TestPlan.aspx.cs | 18 +- .../HSSE/EduTrain/TestRecord.aspx.cs | 12 +- .../HSSE/EduTrain/TrainFind.aspx.cs | 19 +- .../HSSE/EduTrain/TrainFindWorkPost.aspx.cs | 18 +- .../HSSE/EduTrain/TrainRecord.aspx.cs | 20 +- .../HSSE/SitePerson/PersonInfo.aspx.cs | 21 ++- 14 files changed, 312 insertions(+), 149 deletions(-) diff --git a/SUBQHSE/FineUIPro.Web/Door/AbsenceDuty.aspx.cs b/SUBQHSE/FineUIPro.Web/Door/AbsenceDuty.aspx.cs index 50de31c..1fddd66 100644 --- a/SUBQHSE/FineUIPro.Web/Door/AbsenceDuty.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/Door/AbsenceDuty.aspx.cs @@ -33,11 +33,11 @@ namespace FineUIPro.Web.Door { this.ProjectId = Request.Params["projectId"]; } + this.InitDropDownList(); this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.ProjectId = this.ProjectId; Funs.DropDownPageSize(this.ddlPageSize); - UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); @@ -48,11 +48,15 @@ namespace FineUIPro.Web.Door } } } + + private void InitDropDownList() + { + UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); + } protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; - UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); - WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); + this.InitDropDownList(); this.GetPersonStatistic(); } /// diff --git a/SUBQHSE/FineUIPro.Web/Door/InOutList.aspx.cs b/SUBQHSE/FineUIPro.Web/Door/InOutList.aspx.cs index b392116..76ba13d 100644 --- a/SUBQHSE/FineUIPro.Web/Door/InOutList.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/Door/InOutList.aspx.cs @@ -35,11 +35,10 @@ namespace FineUIPro.Web.Door { this.ProjectId = Request.Params["projectId"]; } - + this.InitDropDownList(); this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.ProjectId = this.ProjectId; Funs.DropDownPageSize(this.ddlPageSize); - UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); if (this.CurrUser != null && this.CurrUser.PageSize.HasValue) @@ -57,9 +56,14 @@ namespace FineUIPro.Web.Door protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; + this.InitDropDownList(); this.GetPersonStatistic(); } + private void InitDropDownList() + { + UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); + } #region 删除 /// @@ -240,7 +244,7 @@ namespace FineUIPro.Web.Door { if (registrationId != null) { - var registration = (from x in Funs.DB.T_d_facerecord where x.NewID == registrationId select x).FirstOrDefault(); + var registration = (from x in Funs.DB.T_d_facerecord where x.NewID == registrationId.ToString() select x).FirstOrDefault(); // registration.Des1 = "FileUpload/Registration/20247/2024-07/638556302997373049_QQ截图20220817171229_-_副本.png"; if (registration != null) { diff --git a/SUBQHSE/FineUIPro.Web/Door/InOutManHours.aspx.cs b/SUBQHSE/FineUIPro.Web/Door/InOutManHours.aspx.cs index 20fb1f5..f353e3d 100644 --- a/SUBQHSE/FineUIPro.Web/Door/InOutManHours.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/Door/InOutManHours.aspx.cs @@ -33,11 +33,11 @@ namespace FineUIPro.Web.Door { this.ProjectId = Request.Params["projectId"]; } + this.InitDropDownList(); this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.ProjectId = this.ProjectId; Funs.DropDownPageSize(this.ddlPageSize); - - UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); + WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); @@ -49,11 +49,14 @@ namespace FineUIPro.Web.Door } } } + private void InitDropDownList() + { + UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); + } protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; - UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); - WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); + this.InitDropDownList(); this.GetPersonStatistic(); } /// diff --git a/SUBQHSE/FineUIPro.Web/Door/InOutRecord.aspx.cs b/SUBQHSE/FineUIPro.Web/Door/InOutRecord.aspx.cs index e5b2d06..aa7e075 100644 --- a/SUBQHSE/FineUIPro.Web/Door/InOutRecord.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/Door/InOutRecord.aspx.cs @@ -33,11 +33,10 @@ namespace FineUIPro.Web.Door { this.ProjectId = Request.Params["projectId"]; } - + this.InitDropDownList(); this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.ProjectId = this.ProjectId; Funs.DropDownPageSize(this.ddlPageSize); - UnitService.InitUnitDownList(this.drpUnit, this.ProjectId, true); Funs.FineUIPleaseSelect(this.drpWorkTeam); WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); @@ -55,12 +54,14 @@ namespace FineUIPro.Web.Door } } } + private void InitDropDownList() + { + UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); + } protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; - UnitService.InitUnitDownList(this.drpUnit, this.ProjectId, true); - Funs.FineUIPleaseSelect(this.drpWorkTeam); - WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); + this.InitDropDownList(); this.GetPersonStatistic(); } /// diff --git a/SUBQHSE/FineUIPro.Web/Door/InOutRecordStatistics.aspx.cs b/SUBQHSE/FineUIPro.Web/Door/InOutRecordStatistics.aspx.cs index 4eecc16..7d2e64d 100644 --- a/SUBQHSE/FineUIPro.Web/Door/InOutRecordStatistics.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/Door/InOutRecordStatistics.aspx.cs @@ -35,9 +35,10 @@ namespace FineUIPro.Web.Door { this.ProjectId = Request.Params["projectId"]; } + this.InitDropDownList(); + WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, false); this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.ProjectId = this.ProjectId; - UnitService.InitUnitDownList(this.drpUnit, this.ProjectId, true); this.txtDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); Search(); if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) @@ -47,11 +48,14 @@ namespace FineUIPro.Web.Door } } } + private void InitDropDownList() + { + UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); + } protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; - UnitService.InitUnitDownList(this.drpUnit, this.ProjectId, false); - WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, false); + this.InitDropDownList(); } #region 查询 diff --git a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TaskNotice.aspx b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TaskNotice.aspx index a3f1f70..8386a6c 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TaskNotice.aspx +++ b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TaskNotice.aspx @@ -1,5 +1,7 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TaskNotice.aspx.cs" Inherits="FineUIPro.Web.HSSE.EduTrain.TaskNotice" %> +<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %> + @@ -9,23 +11,38 @@
- - + + - - - + + + + + + + + + + - - - <%-- + + + + + + <%-- --%> - - - - - - - - - - - - - <%-- + + + + + + + + + + + + <%-- --%> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ public string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + #endregion #region 加载页面 /// @@ -25,19 +40,47 @@ namespace FineUIPro.Web.HSSE.EduTrain if (!IsPostBack) { Funs.DropDownPageSize(this.ddlPageSize); - ////权限按钮方法 - this.GetButtonPower(); + this.ProjectId = this.CurrUser.LoginProjectId; + if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId) + { + this.ProjectId = Request.Params["projectId"]; + } + this.ucTree.UnitId = this.CurrUser.UnitId; + this.ucTree.ProjectId = this.ProjectId; + if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + this.panelLeftRegion.Hidden = true; + ////权限按钮方法 + this.GetButtonPower(); + } + this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!"); this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的  行数据吗?", Grid1.GetSelectedCountReference()); //单位 - // BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true); + // BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true); //培训类型 BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true); ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); // 绑定表格 BindGrid(); - + + } + } + /// + /// 公司级树加载 + /// + /// + /// + protected void changeTree(object sender, EventArgs e) + { + this.ProjectId = this.ucTree.ProjectId; + this.BindGrid(); + + this.GetButtonPower(); + if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + btnNew.Hidden = true; } } @@ -46,8 +89,12 @@ namespace FineUIPro.Web.HSSE.EduTrain /// private void BindGrid() { - string projectId = this.CurrUser.LoginProjectId; - + if (string.IsNullOrEmpty(this.ProjectId)) + { + return; + } + //string projectId = this.CurrUser.LoginProjectId; + string strSql = @"SELECT task.TaskNoticeId, task.TrainTitle, task.TrainType, @@ -69,14 +116,14 @@ namespace FineUIPro.Web.HSSE.EduTrain LEFT JOIN dbo.Sys_User AS users ON users.UserId = task.CreatMan where 1=1 "; List listStr = new List(); strSql += " AND task.ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", projectId)); - if (drpTrainType.SelectedValue!=Const._Null) + listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + if (drpTrainType.SelectedValue != Const._Null) { strSql += " AND task.TrainType = @TrainType"; listStr.Add(new SqlParameter("@TrainType", drpTrainType.SelectedValue)); } - + SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); Grid1.RecordCount = tb.Rows.Count; @@ -97,7 +144,7 @@ namespace FineUIPro.Web.HSSE.EduTrain //}; // Grid1.SummaryData = summary; - + } #endregion @@ -184,9 +231,9 @@ namespace FineUIPro.Web.HSSE.EduTrain var model = EduTrain_TaskNoticeService.GetEduTrain_TaskNoticeById(TaskNoticeId); if (model != null) { - - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TaskNoticeEdit.aspx?TaskNoticeId={0}", TaskNoticeId, "编辑 - "))); - + + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TaskNoticeEdit.aspx?TaskNoticeId={0}", TaskNoticeId, "编辑 - "))); + } } #endregion @@ -295,7 +342,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { return; } - var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainRecordMenuId); + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.ProjectTrainRecordMenuId); if (buttonList.Count() > 0) { if (buttonList.Contains(BLL.Const.BtnAdd)) @@ -361,7 +408,7 @@ namespace FineUIPro.Web.HSSE.EduTrain return ""; } - protected string ConvertUserName(object users) + protected string ConvertUserName(object users) { string userName = string.Empty; if (users != null) @@ -399,6 +446,6 @@ namespace FineUIPro.Web.HSSE.EduTrain } #endregion - + } } \ No newline at end of file diff --git a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TaskNotice.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TaskNotice.aspx.designer.cs index 16c9bab..03d353a 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TaskNotice.aspx.designer.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TaskNotice.aspx.designer.cs @@ -32,6 +32,51 @@ namespace FineUIPro.Web.HSSE.EduTrain /// protected global::FineUIPro.PageManager PageManager1; + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ucTree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + /// /// Panel1 控件。 /// diff --git a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TestPlan.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TestPlan.aspx.cs index 58537c0..1853773 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TestPlan.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TestPlan.aspx.cs @@ -53,6 +53,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { this.ProjectId = Request.Params["projectId"]; } + this.InitDropDownList(); this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.ProjectId = this.ProjectId; if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) @@ -63,12 +64,6 @@ namespace FineUIPro.Web.HSSE.EduTrain Funs.DropDownPageSize(this.ddlPageSize); this.GetButtonPower(); - var data = APIBaseInfoService.getWorkPost(CurrUser.ProjectId, null); - this.drpWorkPost.DataValueField = "BaseInfoId"; - this.drpWorkPost.DataTextField = "BaseInfoName"; - this.drpWorkPost.DataSource = data; - this.drpWorkPost.DataBind(); - Funs.FineUIPleaseSelect(drpWorkPost); ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); // 绑定表格 BindGrid(); @@ -82,9 +77,20 @@ namespace FineUIPro.Web.HSSE.EduTrain } } + private void InitDropDownList() + { + var data = APIBaseInfoService.getWorkPost(this.ProjectId, null); + this.drpWorkPost.DataValueField = "BaseInfoId"; + this.drpWorkPost.DataTextField = "BaseInfoName"; + this.drpWorkPost.DataSource = data; + this.drpWorkPost.DataBind(); + Funs.FineUIPleaseSelect(drpWorkPost); + } + protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; + this.InitDropDownList(); //新增UnitId this.UnitId = this.ucTree.UnitId; //判断 当有projectId的时候单位id为空 diff --git a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.cs index 99c4175..cf3e9b9 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TestRecord.aspx.cs @@ -59,6 +59,7 @@ namespace FineUIPro.Web.HSSE.EduTrain { this.ProjectId = Request.Params["projectId"]; } + this.InitDropDownList(); this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.ProjectId = this.ProjectId; if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) @@ -66,14 +67,10 @@ namespace FineUIPro.Web.HSSE.EduTrain this.panelLeftRegion.Hidden = true; // this.Grid1.Columns[0].Hidden = true; } - Funs.DropDownPageSize(this.ddlPageSize); ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); GetButtonPower(); - //单位 - BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true); - ///更新没有结束时间且超时的考试记录 GetDataService.UpdateTestPlanStates(); @@ -89,10 +86,15 @@ namespace FineUIPro.Web.HSSE.EduTrain } } #endregion - + private void InitDropDownList() + { + //单位 + BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true); + } protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; + this.InitDropDownList(); //新增UnitId this.UnitId = this.ucTree.UnitId; //判断 当有projectId的时候单位id为空 diff --git a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainFind.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainFind.aspx.cs index 5c4543e..622733b 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainFind.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainFind.aspx.cs @@ -60,12 +60,7 @@ namespace FineUIPro.Web.HSSE.EduTrain this.ucTree.ProjectId = this.ProjectId; //单位 - BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true); - if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) - { - this.drpUnitId.SelectedValue = this.CurrUser.UnitId; - this.drpUnitId.Enabled = false; - } + this.InitDropDownList(); //培训类型 BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true); //培训级别; @@ -81,9 +76,21 @@ namespace FineUIPro.Web.HSSE.EduTrain } } + private void InitDropDownList() + { + //单位 + BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true); + if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) + { + this.drpUnitId.SelectedValue = this.CurrUser.UnitId; + this.drpUnitId.Enabled = false; + } + } + protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; + this.InitDropDownList(); //新增UnitId this.UnitId = this.ucTree.UnitId; //判断 当有projectId的时候单位id为空 diff --git a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx.cs index 263d292..011620f 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainFindWorkPost.aspx.cs @@ -60,12 +60,7 @@ namespace FineUIPro.Web.HSSE.EduTrain this.ucTree.ProjectId = this.ProjectId; //单位 - BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true); - if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) - { - this.drpUnitId.SelectedValue = this.CurrUser.UnitId; - this.drpUnitId.Enabled = false; - } + this.InitDropDownList(); //培训类型 BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true); //培训级别; @@ -82,9 +77,20 @@ namespace FineUIPro.Web.HSSE.EduTrain } } + private void InitDropDownList() + { + //单位 + BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true); + if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) + { + this.drpUnitId.SelectedValue = this.CurrUser.UnitId; + this.drpUnitId.Enabled = false; + } + } protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; + this.InitDropDownList(); //新增UnitId this.UnitId = this.ucTree.UnitId; //判断 当有projectId的时候单位id为空 diff --git a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.cs index c46d5db..e8ee144 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/EduTrain/TrainRecord.aspx.cs @@ -74,12 +74,12 @@ namespace FineUIPro.Web.HSSE.EduTrain this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.ProjectId = this.ProjectId; Funs.DropDownPageSize(this.ddlPageSize); - ////权限按钮方法 - this.GetButtonPower(); + //////权限按钮方法 + //this.GetButtonPower(); this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!"); this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的  行数据吗?", Grid1.GetSelectedCountReference()); - //单位 - BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.CurrUser.LoginProjectId, true); + + this.InitDropDownList(); //培训类型 BLL.TrainTypeService.InitTrainTypeDropDownList(this.drpTrainType, true); trainType = Request.Params["trainType"]; @@ -109,6 +109,7 @@ namespace FineUIPro.Web.HSSE.EduTrain protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; + this.InitDropDownList(); //新增UnitId this.UnitId = this.ucTree.UnitId; //判断 当有projectId的时候单位id为空 @@ -116,13 +117,20 @@ namespace FineUIPro.Web.HSSE.EduTrain { this.UnitId = ""; } - this.BindGrid(); + this.BindGrid(); this.GetButtonPower(); if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) { btnNew.Hidden = true; } } + + private void InitDropDownList() + { + //单位 + BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true); + } + /// /// 绑定数据 /// @@ -159,7 +167,7 @@ namespace FineUIPro.Web.HSSE.EduTrain strSql += " AND TrainRecord.TrainTitle LIKE @TrainTitle"; listStr.Add(new SqlParameter("@TrainTitle", "%" + this.txtName.Text + "%")); } - + if (!string.IsNullOrEmpty(this.ProjectId)) { diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs index 2386a91..053ba37 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonInfo.aspx.cs @@ -43,7 +43,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { this.ProjectId = Request.Params["projectId"]; } - + this.InitDropDownList(); this.ucTree.UnitId = this.CurrUser.UnitId; this.ucTree.ProjectId = this.ProjectId; ////权限按钮方法 @@ -61,23 +61,28 @@ namespace FineUIPro.Web.HSSE.SitePerson BindGrid(); if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId) ) { - UnitService.InitUnitDropDownList(this.drpUnit, this.CurrUser.LoginProjectId, true); - if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId)) - { - this.drpUnit.SelectedValue = this.CurrUser.UnitId; - this.drpUnit.Enabled = false; - } this.panelLeftRegion.Hidden = true; ////权限按钮方法 this.GetButtonPower(); } } } + + private void InitDropDownList() + { + //单位 + UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); + if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) + { + this.drpUnit.SelectedValue = this.CurrUser.UnitId; + this.drpUnit.Enabled = false; + } + } protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; + this.InitDropDownList(); this.BindGrid(); - this.GetButtonPower(); } #endregion