diff --git a/SUBQHSE/FineUIPro.Web/Customization/CNCCG/HSSE/QualityAudit/SafePersonQuality.aspx.cs b/SUBQHSE/FineUIPro.Web/Customization/CNCCG/HSSE/QualityAudit/SafePersonQuality.aspx.cs index 2b50fe8..9a5beed 100644 --- a/SUBQHSE/FineUIPro.Web/Customization/CNCCG/HSSE/QualityAudit/SafePersonQuality.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/Customization/CNCCG/HSSE/QualityAudit/SafePersonQuality.aspx.cs @@ -32,10 +32,6 @@ namespace FineUIPro.Web.Customization.CNCCG.HSSE.QualityAudit } public string MenuId= Const.CompanySafePersonMenuId; #endregion - - - - #region 加载 /// @@ -54,18 +50,13 @@ namespace FineUIPro.Web.Customization.CNCCG.HSSE.QualityAudit { this.ProjectId = Request.Params["projectId"]; } + this.InitDropDownList(); this.ucTree.UnitId = this.CurrUser.UnitId; 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; - } Funs.DropDownPageSize(this.ddlPageSize); // 绑定表格 this.BindGrid(); - if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId) && CommonService.GetThisUnitId() != Const.CncecFccId) + if (!string.IsNullOrEmpty(this.ProjectId) && CommonService.GetThisUnitId() != Const.CncecFccId) { MenuId = Const.SafePersonQualityMenuId; this.panelLeftRegion.Hidden = true; @@ -78,7 +69,17 @@ namespace FineUIPro.Web.Customization.CNCCG.HSSE.QualityAudit protected void changeTree(object sender, EventArgs e) { this.ProjectId = this.ucTree.ProjectId; - this.BindGrid(); + this.InitDropDownList(); + this.BindGrid(); + } + 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; + } } /// /// 绑定数据 @@ -291,7 +292,7 @@ namespace FineUIPro.Web.Customization.CNCCG.HSSE.QualityAudit /// private void GetButtonPower() { - var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, MenuId); + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, MenuId); if (buttonList.Count() > 0) { if (buttonList.Contains(BLL.Const.BtnModify)) diff --git a/SUBQHSE/FineUIPro.Web/FineUIPro.Web.csproj b/SUBQHSE/FineUIPro.Web/FineUIPro.Web.csproj index 7a4b1a7..5ed2cb5 100644 --- a/SUBQHSE/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SUBQHSE/FineUIPro.Web/FineUIPro.Web.csproj @@ -2478,7 +2478,6 @@ - diff --git a/SUBQHSE/FineUIPro.Web/HSSE/QualityAudit/PersonQuality.aspx b/SUBQHSE/FineUIPro.Web/HSSE/QualityAudit/PersonQuality.aspx index be5d370..40a8233 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/QualityAudit/PersonQuality.aspx +++ b/SUBQHSE/FineUIPro.Web/HSSE/QualityAudit/PersonQuality.aspx @@ -1,4 +1,7 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonQuality.aspx.cs" Inherits="FineUIPro.Web.HSSE.QualityAudit.PersonQuality" %> + +<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %> + @@ -7,90 +10,105 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- @@ -103,40 +121,44 @@ HeaderTextAlign="Center" TextAlign="Center"> --%> - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - +  行数据吗?", Grid1.GetSelectedCountReference()); this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); @@ -70,6 +77,22 @@ namespace FineUIPro.Web.HSSE.SitePerson } } + /// + /// 公司级树加载 + /// + /// + /// + protected void changeTree(object sender, EventArgs e) + { + this.ProjectId = this.ucTree.ProjectId; + this.InitTreeMenu(); + this.BindGrid(); + this.GetButtonPower(); + if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + btnNew.Hidden = true; + } + } /// /// 加载树 /// @@ -168,6 +191,11 @@ namespace FineUIPro.Web.HSSE.SitePerson ///
private void BindGrid() { + if (string.IsNullOrEmpty(this.ProjectId)) + { + return; + } + using (Model.SUBQHSEDB db = new Model.SUBQHSEDB(Funs.ConnString)) { if (this.tvProjectAndUnit != null && !string.IsNullOrEmpty(this.tvProjectAndUnit.SelectedNodeID)) @@ -184,9 +212,9 @@ namespace FineUIPro.Web.HSSE.SitePerson string strSql = "select * from View_SitePerson_Person Where ProjectId=@ProjectId "; List listStr = new List - { - new SqlParameter("@ProjectId", this.ProjectId) - }; + { + new SqlParameter("@ProjectId", this.ProjectId) + }; if (!string.IsNullOrEmpty(unitId) && unitId != "0") { strSql += " AND UnitId =@UnitId "; @@ -518,7 +546,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { return; } - var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.PersonListMenuId); + var buttonList = BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.PersonListMenuId); if (buttonList.Count() > 0) { if (buttonList.Contains(BLL.Const.BtnAdd)) @@ -563,7 +591,7 @@ namespace FineUIPro.Web.HSSE.SitePerson // Alert.ShowInTop("请选择单位!", MessageBoxIcon.Warning); // return; //} - PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("PersonIn.aspx?ProjectId={0}", this.CurrUser.LoginProjectId, "导入 - "))); + PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("PersonIn.aspx?ProjectId={0}", this.ProjectId, "导入 - "))); } /// @@ -625,7 +653,7 @@ namespace FineUIPro.Web.HSSE.SitePerson } if (column.ColumnID == "tfI") { - html = (row.FindControl("lbI") as AspNet.Label).Text; + html = (row.FindControl("lbI") as AspNet.Label).Text; } //sb.AppendFormat("{0}", html); sb.AppendFormat("{0}", html); @@ -648,9 +676,9 @@ namespace FineUIPro.Web.HSSE.SitePerson /// protected void btnPersonOut_Click(object sender, EventArgs e) { - PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("PersonOut.aspx?ProjectId={0}", this.CurrUser.LoginProjectId, "批量出场 - "))); - } - + PageContext.RegisterStartupScript(Window3.GetShowReference(String.Format("PersonOut.aspx?ProjectId={0}", this.ProjectId, "批量出场 - "))); + } + /// /// 批量单位转换 /// @@ -689,8 +717,8 @@ namespace FineUIPro.Web.HSSE.SitePerson { this.BindGrid(); } - #endregion - + #endregion + /// /// 批量生成二维码 /// @@ -699,14 +727,14 @@ namespace FineUIPro.Web.HSSE.SitePerson protected void btnQR_Click(object sender, EventArgs e) { var getPersons = from x in Funs.DB.SitePerson_Person - where x.ProjectId == this.CurrUser.LoginProjectId && x.IdentityCard != null && x.QRCodeAttachUrl == null + where x.ProjectId == this.ProjectId && x.IdentityCard != null && x.QRCodeAttachUrl == null select x; int num = 0; if (getPersons.Count() > 0) { foreach (var item in getPersons) { - string url = CreateQRCodeService.CreateCode_Simple("person$" + item.IdentityCard); + string url = CreateQRCodeService.CreateCode_Simple("person$" + item.IdentityCard); if (!string.IsNullOrEmpty(url)) { item.QRCodeAttachUrl = url; @@ -715,7 +743,7 @@ namespace FineUIPro.Web.HSSE.SitePerson } } } - ShowNotify("操作完成,新生成二维码"+ num.ToString()+"条", MessageBoxIcon.Success); + ShowNotify("操作完成,新生成二维码" + num.ToString() + "条", MessageBoxIcon.Success); } /// /// 年龄 diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs index f490cf6..b820728 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonList.aspx.designer.cs @@ -41,6 +41,33 @@ namespace FineUIPro.Web.HSSE.SitePerson /// protected global::FineUIPro.Panel Panel1; + /// + /// panelLeftRegion1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion1; + + /// + /// ContentPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ContentPanel ContentPanel1; + + /// + /// ucTree 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree; + /// /// panelLeftRegion 控件。 /// diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx index f193277..21c521e 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx +++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx @@ -1,5 +1,7 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PersonStatistic.aspx.cs" Inherits="FineUIPro.Web.HSSE.SitePerson.PersonStatistic" %> +<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %> + @@ -8,75 +10,98 @@
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- --%> - - - - + + + + + + + + + diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx.cs b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx.cs index ac3800e..fd55f01 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx.cs @@ -33,21 +33,63 @@ namespace FineUIPro.Web.HSSE.SitePerson { this.ProjectId = Request.Params["projectId"]; } - UnitService.InitUnitDropDownList(this.drpUnit, this.ProjectId, true); - if (ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId)) + this.InitDropDownList(); + this.ucTree.UnitId = this.CurrUser.UnitId; + this.ucTree.ProjectId = this.ProjectId; + if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) { - this.drpUnit.SelectedValue = this.CurrUser.UnitId; - this.drpUnit.Enabled = false; + this.panelLeftRegion.Hidden = true; + //////权限按钮方法 + //this.GetButtonPower(); } + this.BindGrid(); + } + } - WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); - var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId); - if (project != null) - { - this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", project.StartDate); - this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1)); - GetPersonStatistic(); - } + /// + /// 公司级树加载 + /// + /// + /// + protected void changeTree(object sender, EventArgs e) + { + this.ProjectId = this.ucTree.ProjectId; + this.InitDropDownList(); + this.BindGrid(); + + //this.GetButtonPower(); + //if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + //{ + // btnNew.Hidden = true; + //} + } + + + 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; + } + WorkPostService.InitWorkPostDropDownList(this.drpWorkPost, true); + } + + + private void BindGrid() + { + if (string.IsNullOrEmpty(this.ProjectId)) + { + return; + } + + var project = BLL.ProjectService.GetProjectByProjectId(this.ProjectId); + if (project != null) + { + this.txtStartDate.Text = string.Format("{0:yyyy-MM-dd}", project.StartDate); + this.txtEndDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now.AddDays(1)); + this.GetPersonStatistic(); } } @@ -66,12 +108,12 @@ namespace FineUIPro.Web.HSSE.SitePerson if (!string.IsNullOrEmpty(this.txtStartDate.Text.Trim())) { startTime = this.txtStartDate.Text.Trim(); - } + } if (!string.IsNullOrEmpty(this.txtEndDate.Text.Trim())) { endTime = this.txtEndDate.Text.Trim(); } - if (this.drpUnit.SelectedValue != Const._Null) + if (this.drpUnit.SelectedValue != null && this.drpUnit.SelectedValue != Const._Null) { unitId = this.drpUnit.SelectedValue; } @@ -79,7 +121,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { unitId = null; } - if (this.drpWorkPost.SelectedValue != Const._Null) + if (this.drpWorkPost.SelectedValue != null && this.drpWorkPost.SelectedValue != Const._Null) { workPostId = this.drpWorkPost.SelectedValue; } @@ -172,7 +214,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { html = (row.FindControl("labNumber") as AspNet.Label).Text; } - + sb.AppendFormat("{0}", html); } diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx.designer.cs b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx.designer.cs index d263303..0052287 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx.designer.cs +++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/PersonStatistic.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.HSSE.SitePerson { - - - public partial class PersonStatistic { - +namespace FineUIPro.Web.HSSE.SitePerson +{ + + + public partial class PersonStatistic + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,52 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 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 控件。 /// @@ -38,7 +85,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -47,7 +94,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -56,7 +103,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// drpUnit 控件。 /// @@ -65,7 +112,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpUnit; - + /// /// drpWorkPost 控件。 /// @@ -74,7 +121,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList drpWorkPost; - + /// /// txtStartDate 控件。 /// @@ -83,7 +130,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtStartDate; - + /// /// txtEndDate 控件。 /// @@ -92,7 +139,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DatePicker txtEndDate; - + /// /// Toolbar1 控件。 /// @@ -101,7 +148,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// rblIsUsed 控件。 /// @@ -110,7 +157,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.RadioButtonList rblIsUsed; - + /// /// btnSearch 控件。 /// @@ -119,7 +166,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSearch; - + /// /// btnOut 控件。 /// @@ -128,7 +175,7 @@ namespace FineUIPro.Web.HSSE.SitePerson { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnOut; - + /// /// labNumber 控件。 /// diff --git a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/ProjectWorkPersonStatistic.aspx b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/ProjectWorkPersonStatistic.aspx index 3562656..5aca502 100644 --- a/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/ProjectWorkPersonStatistic.aspx +++ b/SUBQHSE/FineUIPro.Web/HSSE/SitePerson/ProjectWorkPersonStatistic.aspx @@ -1,5 +1,7 @@ <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectWorkPersonStatistic.aspx.cs" Inherits="FineUIPro.Web.HSSE.SitePerson.ProjectWorkPersonStatistic" %> +<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %> + @@ -8,70 +10,90 @@
- - + + - - <%--OnRowDoubleClick="Grid1_RowDoubleClick"--%> - - + + + + + + + + + + - - - - - - + + <%--OnRowDoubleClick="Grid1_RowDoubleClick"--%> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + +