From 4c28c0514b757b911831ae4b61a46504cc373589 Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Thu, 16 Jan 2025 17:02:02 +0800 Subject: [PATCH] =?UTF-8?q?20250116=20key=20Quantity=E3=80=81=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E7=8A=B6=E6=80=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BaseInfo/QuantityDesctiptionService.cs | 92 +++++ .../BLL/EditorManage/KeyQuantityService.cs | 12 +- .../EditorManage/KeyQuantityEditor.aspx | 12 +- .../EditorManage/KeyQuantityEditorEdit.aspx | 28 +- .../KeyQuantityEditorEdit.aspx.cs | 335 ++++++++++++------ .../KeyQuantityEditorEdit.aspx.designer.cs | 79 +---- .../EditorManage/KeyQuantityEditorList.aspx | 12 +- .../EditorManage/PMEditorEdit.aspx.cs | 4 +- .../EditorManage/TDCEditorEdit.aspx.cs | 4 +- EProject/Model/Model.cs | 96 +++++ 10 files changed, 461 insertions(+), 213 deletions(-) diff --git a/EProject/BLL/BaseInfo/QuantityDesctiptionService.cs b/EProject/BLL/BaseInfo/QuantityDesctiptionService.cs index e3c1e6f..ed9967b 100644 --- a/EProject/BLL/BaseInfo/QuantityDesctiptionService.cs +++ b/EProject/BLL/BaseInfo/QuantityDesctiptionService.cs @@ -81,5 +81,97 @@ namespace BLL return false; } } + + #region Identifier下拉值加载 + public static void InitIdentifierDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease) + { + dropName.DataValueField = "DisciplinesWBSCode"; + dropName.DataTextField = "DisciplinesWBSCode"; + dropName.DataSource = GetDisciplinesWBSCodeList(); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + + public static List GetDisciplinesWBSCodeList() + { + return (from x in Funs.DB.Base_QuantityDesctiption + join y in Funs.DB.Base_DisciplinesWBS on x.DisciplinesWBSId equals y.DisciplinesWBSId + orderby y.DisciplinesWBSCode + select y.DisciplinesWBSCode).Distinct().ToList(); + } + #endregion + + #region Descipline下拉值加载 + public static void InitDesciplineDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease, string disciplinesWBSCode) + { + dropName.DataValueField = "DisciplinesWBSName"; + dropName.DataTextField = "DisciplinesWBSName"; + dropName.DataSource = GetDesciplineList(disciplinesWBSCode); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + + public static List GetDesciplineList(string disciplinesWBSCode) + { + return (from x in Funs.DB.Base_QuantityDesctiption + join y in Funs.DB.Base_DisciplinesWBS on x.DisciplinesWBSId equals y.DisciplinesWBSId + where y.DisciplinesWBSCode == disciplinesWBSCode + orderby y.DisciplinesWBSName + select y.DisciplinesWBSName).Distinct().ToList(); + } + #endregion + + #region Quantity Desctiption 下拉值加载 + public static void InitQuantityDesctiptionDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease, string disciplinesWBSCode, string disciplinesWBSName) + { + dropName.DataValueField = "QuantityDesctiption"; + dropName.DataTextField = "QuantityDesctiption"; + dropName.DataSource = GetQuantityDesctiptionList(disciplinesWBSCode, disciplinesWBSName); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + + public static List GetQuantityDesctiptionList(string disciplinesWBSCode, string disciplinesWBSName) + { + return (from x in Funs.DB.Base_QuantityDesctiption + join y in Funs.DB.Base_DisciplinesWBS on x.DisciplinesWBSId equals y.DisciplinesWBSId + where y.DisciplinesWBSCode == disciplinesWBSCode && y.DisciplinesWBSName == disciplinesWBSName + orderby x.QuantityDesctiption + select x.QuantityDesctiption).Distinct().ToList(); + } + #endregion + + #region PlanMHRsUnit 下拉值加载 + public static void InitPlanMHRsUnitDropDownList(FineUIPro.DropDownList dropName, bool isShowPlease, string disciplinesWBSCode, string disciplinesWBSName, string quantityDesctiption) + { + dropName.DataValueField = "PlanMHRsUnit"; + dropName.DataTextField = "PlanMHRsUnit"; + dropName.DataSource = GetPlanMHRsUnitList(disciplinesWBSCode, disciplinesWBSName, quantityDesctiption); + dropName.DataBind(); + if (isShowPlease) + { + Funs.FineUIPleaseSelect(dropName); + } + } + + public static List GetPlanMHRsUnitList(string disciplinesWBSCode, string disciplinesWBSName, string quantityDesctiption) + { + return (from x in Funs.DB.Base_QuantityDesctiption + join y in Funs.DB.Base_DisciplinesWBS on x.DisciplinesWBSId equals y.DisciplinesWBSId + where y.DisciplinesWBSCode == disciplinesWBSCode && y.DisciplinesWBSName == disciplinesWBSName + && x.QuantityDesctiption == quantityDesctiption + orderby x.PlanMHRsUnit + select x.PlanMHRsUnit.ToString()).Distinct().ToList(); + } + #endregion } } diff --git a/EProject/BLL/EditorManage/KeyQuantityService.cs b/EProject/BLL/EditorManage/KeyQuantityService.cs index d5d135e..5cc2fc1 100644 --- a/EProject/BLL/EditorManage/KeyQuantityService.cs +++ b/EProject/BLL/EditorManage/KeyQuantityService.cs @@ -23,10 +23,10 @@ namespace BLL return Funs.DB.Editor_KeyQuantity.FirstOrDefault(e => e.KeyQuantityId == keyQuantityId); } - public static decimal? GetSumPlanMHRsByKeyId(string keyId) + public static decimal? GetSumPlanMHRsByKeyId(string eprojectId, string identifier, string descipline) { decimal? sum = 0; - sum = (from x in Funs.DB.Editor_KeyQuantity where x.KeyId == keyId select x.PlanMHRs).Sum(); + sum = (from x in Funs.DB.Editor_KeyQuantity where x.EProjectId == eprojectId && x.Identifier == identifier && x.Descipline == descipline select x.PlanMHRs).Sum(); return sum; } @@ -42,6 +42,10 @@ namespace BLL newKeyQuantity.KeyId = keyQuantity.KeyId; newKeyQuantity.InputQuantity = keyQuantity.InputQuantity; newKeyQuantity.PlanMHRs = keyQuantity.PlanMHRs; + newKeyQuantity.Identifier = keyQuantity.Identifier; + newKeyQuantity.Descipline = keyQuantity.Descipline; + newKeyQuantity.QuantityDesctiption = keyQuantity.QuantityDesctiption; + newKeyQuantity.PlanMHRsUnit = keyQuantity.PlanMHRsUnit; Funs.DB.Editor_KeyQuantity.InsertOnSubmit(newKeyQuantity); Funs.DB.SubmitChanges(); } @@ -58,6 +62,10 @@ namespace BLL newKeyQuantity.KeyId = keyQuantity.KeyId; newKeyQuantity.InputQuantity = keyQuantity.InputQuantity; newKeyQuantity.PlanMHRs = keyQuantity.PlanMHRs; + newKeyQuantity.Identifier = keyQuantity.Identifier; + newKeyQuantity.Descipline = keyQuantity.Descipline; + newKeyQuantity.QuantityDesctiption = keyQuantity.QuantityDesctiption; + newKeyQuantity.PlanMHRsUnit = keyQuantity.PlanMHRsUnit; Funs.DB.SubmitChanges(); } } diff --git a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditor.aspx b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditor.aspx index 2ea8ed5..16e141a 100644 --- a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditor.aspx +++ b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditor.aspx @@ -135,20 +135,20 @@ - + --%> + - - -
- + + runat="server" RedStarPosition="BeforeText" LabelAlign="Right" BodyPadding="10px"> - + <%-- - - + --%> + + - - + + - - + + <%----%> + - - - - - - - + diff --git a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.cs b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.cs index 3190ca7..ea17984 100644 --- a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.cs +++ b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.cs @@ -53,7 +53,7 @@ namespace FineUIPro.Web.EditorManage if (!IsPostBack) { this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); - BindGrid(); + //BindGrid(); string view = Request.Params["view"]; if (view == "1") { @@ -63,6 +63,12 @@ namespace FineUIPro.Web.EditorManage { GetButtonPower(); } + + BLL.QuantityDesctiptionService.InitIdentifierDropDownList(this.drpIdentifier, true); + Funs.FineUIPleaseSelect(this.drpDescipline); + Funs.FineUIPleaseSelect(this.drpQuantityDesctiption); + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit); + this.ProjectId = Request.Params["eProjectId"]; this.KeyQuantityId = Request.Params["keyQuantityId"]; if (!string.IsNullOrEmpty(this.KeyQuantityId)) @@ -71,31 +77,64 @@ namespace FineUIPro.Web.EditorManage if (keyQuantity != null) { this.ProjectId = keyQuantity.EProjectId; - this.drpKeyId.Value = keyQuantity.KeyId; - var key = BLL.QuantityDesctiptionService.GetQuantityDesctiptionById(this.drpKeyId.Value); - if (key != null) - { - if (!string.IsNullOrEmpty(key.DisciplinesWBSId)) - { - var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSById(key.DisciplinesWBSId); - if (wbs != null) - { - this.txtIdentifier.Text = wbs.DisciplinesWBSCode; - this.txtDescipline.Text = wbs.DisciplinesWBSName; - } + //this.drpKeyId.Value = keyQuantity.KeyId; + //var key = BLL.QuantityDesctiptionService.GetQuantityDesctiptionById(this.drpKeyId.Value); + //if (key != null) + //{ + // if (!string.IsNullOrEmpty(key.DisciplinesWBSId)) + // { + // var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSById(key.DisciplinesWBSId); + // if (wbs != null) + // { + // this.txtIdentifier.Text = wbs.DisciplinesWBSCode; + // this.txtDescipline.Text = wbs.DisciplinesWBSName; + // } - this.txtPlanMHRsSummary.Text = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value).ToString(); - double? actualHoursSum = (from x in Funs.DB.ManHours_Actual - where x.EProjectId == this.ProjectId - && x.Discipline == wbs.DisciplinesWBSName - select x.Hours).Sum(); - this.txtActualMHRs.Text = actualHoursSum.ToString(); + // this.txtPlanMHRsSummary.Text = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value).ToString(); + // double? actualHoursSum = (from x in Funs.DB.ManHours_Actual + // where x.EProjectId == this.ProjectId + // && x.Discipline == wbs.DisciplinesWBSName + // select x.Hours).Sum(); + // this.txtActualMHRs.Text = actualHoursSum.ToString(); + // } + // txtQuantityDesctiption.Text = key.QuantityDesctiption; + // txtPlanMHRsUnit.Text = key.PlanMHRsUnit.HasValue ? key.PlanMHRsUnit.ToString() : ""; + //} + if (!string.IsNullOrEmpty(keyQuantity.Identifier)) + { + this.drpIdentifier.Items.Clear(); + BLL.QuantityDesctiptionService.InitIdentifierDropDownList(this.drpIdentifier, true); + this.drpIdentifier.SelectedValue = keyQuantity.Identifier; + + if (!string.IsNullOrEmpty(keyQuantity.Descipline)) + { + this.drpDescipline.Items.Clear(); + BLL.QuantityDesctiptionService.InitDesciplineDropDownList(this.drpDescipline, true, keyQuantity.Identifier); + this.drpDescipline.SelectedValue = keyQuantity.Descipline; + + if (!string.IsNullOrEmpty(keyQuantity.QuantityDesctiption)) + { + this.drpQuantityDesctiption.Items.Clear(); + BLL.QuantityDesctiptionService.InitQuantityDesctiptionDropDownList(this.drpQuantityDesctiption, true, keyQuantity.Identifier, keyQuantity.Descipline); + this.drpQuantityDesctiption.SelectedValue = keyQuantity.QuantityDesctiption; + + if (keyQuantity.PlanMHRsUnit.HasValue) + { + this.drpPlanMHRsUnit.Items.Clear(); + BLL.QuantityDesctiptionService.InitPlanMHRsUnitDropDownList(this.drpPlanMHRsUnit, true, keyQuantity.Identifier, keyQuantity.Descipline, keyQuantity.QuantityDesctiption); + this.drpPlanMHRsUnit.SelectedValue = keyQuantity.PlanMHRsUnit.ToString(); + } + } } - txtQuantityDesctiption.Text = key.QuantityDesctiption; - txtPlanMHRsUnit.Text = key.PlanMHRsUnit.HasValue ? key.PlanMHRsUnit.ToString() : ""; } + this.txtPlanMHRsSummary.Text = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(keyQuantity.EProjectId,keyQuantity.Identifier, keyQuantity.Descipline).ToString(); this.txtInputQuantity.Text = keyQuantity.InputQuantity.HasValue ? keyQuantity.InputQuantity.ToString() : ""; this.txtPlanMHRs.Text = keyQuantity.PlanMHRs.HasValue ? keyQuantity.PlanMHRs.ToString() : ""; + double? actualHoursSum = (from x in Funs.DB.ManHours_Actual + where x.EProjectId == this.ProjectId + && x.Discipline == keyQuantity.Descipline + select x.Hours).Sum(); + this.txtActualMHRs.Text = actualHoursSum.ToString(); } } } @@ -106,34 +145,34 @@ namespace FineUIPro.Web.EditorManage /// /// 数据绑定 /// - private void BindGrid() - { - string strSql = @"SELECT qd.KeyId, - qd.DepartId, - qd.DisciplinesWBSId, - qd.QuantityDesctiption, - qd.PlanMHRsUnit, - d.DepartName, - wbs.DisciplinesWBSCode, - wbs.DisciplinesWBSName - FROM Base_QuantityDesctiption qd - left join Base_Depart as d on qd.DepartId = d.DepartId - left join Base_DisciplinesWBS as wbs on wbs.DisciplinesWBSId = qd.DisciplinesWBSId WHERE 1=1"; - List listStr = new List(); - if (!string.IsNullOrEmpty(this.txtSearch.Text.Trim())) - { - strSql += " AND d.DepartName like @DepartName "; - listStr.Add(new SqlParameter("@DepartName", "%" + this.txtSearch.Text.Trim() + "%")); - } - SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - // 2.获取当前分页数据 - //var table = this.GetPagedDataTable(Grid1, tb1); - Grid1.RecordCount = tb.Rows.Count; - var table = this.GetPagedDataTable(Grid1, tb); - Grid1.DataSource = table; - Grid1.DataBind(); - } + //private void BindGrid() + //{ + // string strSql = @"SELECT qd.KeyId, + // qd.DepartId, + // qd.DisciplinesWBSId, + // qd.QuantityDesctiption, + // qd.PlanMHRsUnit, + // d.DepartName, + // wbs.DisciplinesWBSCode, + // wbs.DisciplinesWBSName + // FROM Base_QuantityDesctiption qd + // left join Base_Depart as d on qd.DepartId = d.DepartId + // left join Base_DisciplinesWBS as wbs on wbs.DisciplinesWBSId = qd.DisciplinesWBSId WHERE 1=1"; + // List listStr = new List(); + // if (!string.IsNullOrEmpty(this.txtSearch.Text.Trim())) + // { + // strSql += " AND d.DepartName like @DepartName "; + // listStr.Add(new SqlParameter("@DepartName", "%" + this.txtSearch.Text.Trim() + "%")); + // } + // SqlParameter[] parameter = listStr.ToArray(); + // DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + // // 2.获取当前分页数据 + // //var table = this.GetPagedDataTable(Grid1, tb1); + // Grid1.RecordCount = tb.Rows.Count; + // var table = this.GetPagedDataTable(Grid1, tb); + // Grid1.DataSource = table; + // Grid1.DataBind(); + //} #endregion #region 分页、排序 @@ -142,59 +181,73 @@ namespace FineUIPro.Web.EditorManage /// /// /// - protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) - { - Grid1.PageIndex = e.NewPageIndex; - BindGrid(); - } + //protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + //{ + // Grid1.PageIndex = e.NewPageIndex; + // BindGrid(); + //} /// /// 分页显示条数下拉框 /// /// /// - protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) - { - Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); - BindGrid(); - } + //protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + //{ + // Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + // BindGrid(); + //} /// /// 排序 /// /// /// - protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) - { - Grid1.SortDirection = e.SortDirection; - Grid1.SortField = e.SortField; - BindGrid(); - } + //protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e) + //{ + // Grid1.SortDirection = e.SortDirection; + // Grid1.SortField = e.SortField; + // BindGrid(); + //} /// /// 筛选 /// /// /// - protected void txtSearch_TextChanged(object sender, EventArgs e) - { - BindGrid(); - } + //protected void txtSearch_TextChanged(object sender, EventArgs e) + //{ + // BindGrid(); + //} #endregion #region 保存 protected void btnSave_Click(object sender, EventArgs e) { - if (this.drpKeyId.Value == BLL.Const._Null || string.IsNullOrEmpty(this.drpKeyId.Value)) + if (this.drpIdentifier.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpIdentifier.SelectedValue)) { - ShowAlert("Please select Type!", MessageBoxIcon.Warning); + ShowAlert("Please select Identifier!", MessageBoxIcon.Warning); + return; + } + if (this.drpDescipline.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpDescipline.SelectedValue)) + { + ShowAlert("Please select Descipline!", MessageBoxIcon.Warning); + return; + } + if (this.drpQuantityDesctiption.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpQuantityDesctiption.SelectedValue)) + { + ShowAlert("Please select Quantity Desctiption!", MessageBoxIcon.Warning); return; } Model.Editor_KeyQuantity newKeyQuantity = new Model.Editor_KeyQuantity(); - newKeyQuantity.KeyId = this.drpKeyId.Value; + //newKeyQuantity.KeyId = this.drpKeyId.Value; newKeyQuantity.InputQuantity = Funs.GetNewDecimal(this.txtInputQuantity.Text); newKeyQuantity.PlanMHRs = Funs.GetNewDecimal(this.txtPlanMHRs.Text); - + newKeyQuantity.Identifier = this.drpIdentifier.SelectedText; + newKeyQuantity.Descipline = this.drpDescipline.SelectedText; + newKeyQuantity.QuantityDesctiption = this.drpQuantityDesctiption.SelectedText; + newKeyQuantity.PlanMHRsUnit = Funs.GetNewDecimal(this.drpPlanMHRsUnit.SelectedText); + if (!string.IsNullOrEmpty(this.KeyQuantityId)) { newKeyQuantity.KeyQuantityId = this.KeyQuantityId; @@ -221,41 +274,41 @@ namespace FineUIPro.Web.EditorManage /// /// /// - protected void drpKeyId_TextChanged(object sender, EventArgs e) - { - this.txtIdentifier.Text = string.Empty; - this.txtDescipline.Text = string.Empty; - this.txtQuantityDesctiption.Text = string.Empty; - this.txtPlanMHRsUnit.Text = string.Empty; - this.txtPlanMHRsSummary.Text = string.Empty; - if (!string.IsNullOrEmpty(this.drpKeyId.Value)) - { - var key = BLL.QuantityDesctiptionService.GetQuantityDesctiptionById(this.drpKeyId.Value); - if (key != null) - { - if (!string.IsNullOrEmpty(key.DisciplinesWBSId)) - { - var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSById(key.DisciplinesWBSId); - if (wbs != null) - { - this.txtIdentifier.Text = wbs.DisciplinesWBSCode; - this.txtDescipline.Text = wbs.DisciplinesWBSName; - } + //protected void drpKeyId_TextChanged(object sender, EventArgs e) + //{ + // this.txtIdentifier.Text = string.Empty; + // this.txtDescipline.Text = string.Empty; + // this.txtQuantityDesctiption.Text = string.Empty; + // this.txtPlanMHRsUnit.Text = string.Empty; + // this.txtPlanMHRsSummary.Text = string.Empty; + // if (!string.IsNullOrEmpty(this.drpKeyId.Value)) + // { + // var key = BLL.QuantityDesctiptionService.GetQuantityDesctiptionById(this.drpKeyId.Value); + // if (key != null) + // { + // if (!string.IsNullOrEmpty(key.DisciplinesWBSId)) + // { + // var wbs = BLL.DisciplinesWBSService.GetDisciplinesWBSById(key.DisciplinesWBSId); + // if (wbs != null) + // { + // this.txtIdentifier.Text = wbs.DisciplinesWBSCode; + // this.txtDescipline.Text = wbs.DisciplinesWBSName; + // } - decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value); - this.txtPlanMHRsSummary.Text = (s + Funs.GetNewDecimal(this.txtPlanMHRs.Text)).ToString(); + // decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value); + // this.txtPlanMHRsSummary.Text = (s + Funs.GetNewDecimal(this.txtPlanMHRs.Text)).ToString(); - double? actualHoursSum = (from x in Funs.DB.ManHours_Actual - where x.EProjectId == this.ProjectId - && x.Discipline == wbs.DisciplinesWBSName - select x.Hours).Sum(); - this.txtActualMHRs.Text = actualHoursSum.ToString(); - } - txtQuantityDesctiption.Text = key.QuantityDesctiption; - txtPlanMHRsUnit.Text = key.PlanMHRsUnit.HasValue ? key.PlanMHRsUnit.ToString() : ""; - } - } - } + // double? actualHoursSum = (from x in Funs.DB.ManHours_Actual + // where x.EProjectId == this.ProjectId + // && x.Discipline == wbs.DisciplinesWBSName + // select x.Hours).Sum(); + // this.txtActualMHRs.Text = actualHoursSum.ToString(); + // } + // txtQuantityDesctiption.Text = key.QuantityDesctiption; + // txtPlanMHRsUnit.Text = key.PlanMHRsUnit.HasValue ? key.PlanMHRsUnit.ToString() : ""; + // } + // } + //} /// /// Input Quantity输入事件 @@ -268,9 +321,9 @@ namespace FineUIPro.Web.EditorManage this.txtPlanMHRsSummary.Text = string.Empty; if (!string.IsNullOrEmpty(this.txtInputQuantity.Text.Trim())) { - this.txtPlanMHRs.Text = (Funs.GetNewDecimal(this.txtInputQuantity.Text) * Funs.GetNewDecimal(this.txtPlanMHRsUnit.Text)).ToString(); + this.txtPlanMHRs.Text = (Funs.GetNewDecimal(this.txtInputQuantity.Text) * Funs.GetNewDecimal(this.drpPlanMHRsUnit.SelectedText)).ToString(); - decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.drpKeyId.Value); + decimal? s = BLL.KeyQuantityService.GetSumPlanMHRsByKeyId(this.ProjectId ,this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue); if (s > 0) { this.txtPlanMHRsSummary.Text = (s + Funs.GetNewDecimal(this.txtPlanMHRs.Text)).ToString(); @@ -281,6 +334,70 @@ namespace FineUIPro.Web.EditorManage } } } + + /// + /// Identifier 下拉选择 + /// + /// + /// + protected void drpIdentifier_SelectedIndexChanged(object sender, EventArgs e) + { + drpDescipline.Items.Clear(); + if (this.drpIdentifier.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpIdentifier.SelectedValue)) + { + BLL.QuantityDesctiptionService.InitDesciplineDropDownList(this.drpDescipline, true, this.drpIdentifier.SelectedValue); + } + else + { + Funs.FineUIPleaseSelect(this.drpDescipline); + } + this.drpDescipline.SelectedIndex = 0; + } + + /// + /// Descipline下拉选择 + /// + /// + /// + protected void drpDescipline_SelectedIndexChanged(object sender, EventArgs e) + { + this.txtActualMHRs.Text = string.Empty; + drpQuantityDesctiption.Items.Clear(); + if (this.drpDescipline.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpDescipline.SelectedValue)) + { + BLL.QuantityDesctiptionService.InitQuantityDesctiptionDropDownList(this.drpQuantityDesctiption, true, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue); + + double? actualHoursSum = (from x in Funs.DB.ManHours_Actual + where x.EProjectId == this.ProjectId + && x.Discipline == this.drpDescipline.SelectedValue + select x.Hours).Sum(); + this.txtActualMHRs.Text = actualHoursSum.ToString(); + } + else + { + Funs.FineUIPleaseSelect(this.drpQuantityDesctiption); + } + this.drpQuantityDesctiption.SelectedIndex = 0; + } + + /// + /// Quantity Desctiption下拉选择 + /// + /// + /// + protected void drpQuantityDesctiption_SelectedIndexChanged(object sender, EventArgs e) + { + this.drpPlanMHRsUnit.Items.Clear(); + if (this.drpQuantityDesctiption.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpQuantityDesctiption.SelectedValue)) + { + BLL.QuantityDesctiptionService.InitPlanMHRsUnitDropDownList(this.drpPlanMHRsUnit, true, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue, this.drpQuantityDesctiption.SelectedValue); + } + else + { + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit); + } + this.drpPlanMHRsUnit.SelectedIndex = 0; + } #endregion #region 权限设置 @@ -298,6 +415,6 @@ namespace FineUIPro.Web.EditorManage } } } - #endregion + #endregion } } \ No newline at end of file diff --git a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.designer.cs b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.designer.cs index 306698e..3afbc4d 100644 --- a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.designer.cs +++ b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.designer.cs @@ -51,85 +51,40 @@ namespace FineUIPro.Web.EditorManage protected global::FineUIPro.Form Form2; /// - /// drpKeyId 控件。 + /// drpIdentifier 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownBox drpKeyId; + protected global::FineUIPro.DropDownList drpIdentifier; /// - /// Grid1 控件。 + /// drpDescipline 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Grid Grid1; + protected global::FineUIPro.DropDownList drpDescipline; /// - /// ToolbarSeparator1 控件。 + /// drpQuantityDesctiption 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + protected global::FineUIPro.DropDownList drpQuantityDesctiption; /// - /// ToolbarText1 控件。 + /// drpPlanMHRsUnit 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarText ToolbarText1; - - /// - /// ddlPageSize 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DropDownList ddlPageSize; - - /// - /// txtSearch 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtSearch; - - /// - /// txtIdentifier 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtIdentifier; - - /// - /// txtDescipline 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtDescipline; - - /// - /// txtQuantityDesctiption 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtQuantityDesctiption; + protected global::FineUIPro.DropDownList drpPlanMHRsUnit; /// /// txtInputQuantity 控件。 @@ -140,15 +95,6 @@ namespace FineUIPro.Web.EditorManage /// protected global::FineUIPro.NumberBox txtInputQuantity; - /// - /// txtPlanMHRsUnit 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.NumberBox txtPlanMHRsUnit; - /// /// txtPlanMHRs 控件。 /// @@ -176,15 +122,6 @@ namespace FineUIPro.Web.EditorManage /// protected global::FineUIPro.NumberBox txtActualMHRs; - /// - /// Label1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label Label1; - /// /// Toolbar1 控件。 /// diff --git a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorList.aspx b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorList.aspx index da41fdb..29363d2 100644 --- a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorList.aspx +++ b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorList.aspx @@ -15,7 +15,7 @@ @@ -36,13 +36,13 @@ - + --%> + - - - 0) + var con_na = from x in Funs.DB.Editor_TDC where x.EProjectId == epro.EProjectId && x.Type == "D01_IFC" && x.Disc == "90_NA" && x.ReceiveHC.HasValue select x; + if (epro.ProjectControl_JobType != "Other" && epro.PM_MA_ProjectApproval.HasValue && (con_all.Count() > 0 || con_na.Count() > 0)) { if (eproject.ProjectControl_JobStatus == null || eproject.ProjectControl_JobStatus == "" || eproject.ProjectControl_JobStatus == "Detailed Design" || eproject.ProjectControl_JobStatus == "On Going" || eproject.ProjectControl_JobStatus == "Study" || eproject.ProjectControl_JobStatus == "Not Start") { diff --git a/EProject/FineUIPro.Web/EditorManage/TDCEditorEdit.aspx.cs b/EProject/FineUIPro.Web/EditorManage/TDCEditorEdit.aspx.cs index 8bce810..0b7cf71 100644 --- a/EProject/FineUIPro.Web/EditorManage/TDCEditorEdit.aspx.cs +++ b/EProject/FineUIPro.Web/EditorManage/TDCEditorEdit.aspx.cs @@ -223,14 +223,14 @@ namespace FineUIPro.Web.EditorManage // 后加:当PM中Milestone(Actual)的Project Approval不为空并且IFC ALL的ReceiveHC不为空,状态为In Procurement var con_all = from x in Funs.DB.Editor_TDC where x.EProjectId == eproject.EProjectId && x.Type == "D01_IFC" && x.Disc == "00_ALL" && x.ReceiveHC.HasValue select x; - if (eproject.ProjectControl_JobType != "Other" && eproject.PM_MA_ProjectApproval.HasValue && con_all.Count() > 0) + var con_na = from x in Funs.DB.Editor_TDC where x.EProjectId == eproject.EProjectId && x.Type == "D01_IFC" && x.Disc == "90_NA" && x.ReceiveHC.HasValue select x; + if (eproject.ProjectControl_JobType != "Other" && eproject.PM_MA_ProjectApproval.HasValue && (con_all.Count() > 0 || con_na.Count() > 0)) { if (eproject.ProjectControl_JobStatus == null || eproject.ProjectControl_JobStatus == "" || eproject.ProjectControl_JobStatus == "Detailed Design" || eproject.ProjectControl_JobStatus == "On Going" || eproject.ProjectControl_JobStatus == "Study" || eproject.ProjectControl_JobStatus == "Not Start") { eproject.ProjectControl_JobStatus = "In Procurement"; } } - #endregion if ((eproject.Permit_PS_SafetyFinalAcc.HasValue && eproject.Permit_PA_SafetyFinalACC.HasValue diff --git a/EProject/Model/Model.cs b/EProject/Model/Model.cs index d03ab89..86731bc 100644 --- a/EProject/Model/Model.cs +++ b/EProject/Model/Model.cs @@ -11584,6 +11584,14 @@ namespace Model private System.Nullable _PlanMHRs; + private string _Identifier; + + private string _Descipline; + + private string _QuantityDesctiption; + + private System.Nullable _PlanMHRsUnit; + private EntityRef _Base_QuantityDesctiption; private EntityRef _Editor_EProject; @@ -11602,6 +11610,14 @@ namespace Model partial void OnInputQuantityChanged(); partial void OnPlanMHRsChanging(System.Nullable value); partial void OnPlanMHRsChanged(); + partial void OnIdentifierChanging(string value); + partial void OnIdentifierChanged(); + partial void OnDesciplineChanging(string value); + partial void OnDesciplineChanged(); + partial void OnQuantityDesctiptionChanging(string value); + partial void OnQuantityDesctiptionChanged(); + partial void OnPlanMHRsUnitChanging(System.Nullable value); + partial void OnPlanMHRsUnitChanged(); #endregion public Editor_KeyQuantity() @@ -11719,6 +11735,86 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Identifier", DbType="NVarChar(50)")] + public string Identifier + { + get + { + return this._Identifier; + } + set + { + if ((this._Identifier != value)) + { + this.OnIdentifierChanging(value); + this.SendPropertyChanging(); + this._Identifier = value; + this.SendPropertyChanged("Identifier"); + this.OnIdentifierChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Descipline", DbType="NVarChar(50)")] + public string Descipline + { + get + { + return this._Descipline; + } + set + { + if ((this._Descipline != value)) + { + this.OnDesciplineChanging(value); + this.SendPropertyChanging(); + this._Descipline = value; + this.SendPropertyChanged("Descipline"); + this.OnDesciplineChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_QuantityDesctiption", DbType="NVarChar(200)")] + public string QuantityDesctiption + { + get + { + return this._QuantityDesctiption; + } + set + { + if ((this._QuantityDesctiption != value)) + { + this.OnQuantityDesctiptionChanging(value); + this.SendPropertyChanging(); + this._QuantityDesctiption = value; + this.SendPropertyChanged("QuantityDesctiption"); + this.OnQuantityDesctiptionChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanMHRsUnit", DbType="Decimal(18,2)")] + public System.Nullable PlanMHRsUnit + { + get + { + return this._PlanMHRsUnit; + } + set + { + if ((this._PlanMHRsUnit != value)) + { + this.OnPlanMHRsUnitChanging(value); + this.SendPropertyChanging(); + this._PlanMHRsUnit = value; + this.SendPropertyChanged("PlanMHRsUnit"); + this.OnPlanMHRsUnitChanged(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Editor_KeyQuantity_Base_QuantityDesctiption", Storage="_Base_QuantityDesctiption", ThisKey="KeyId", OtherKey="KeyId", IsForeignKey=true)] public Base_QuantityDesctiption Base_QuantityDesctiption {