diff --git a/EProject/BLL/BaseInfo/QuantityDesctiptionService.cs b/EProject/BLL/BaseInfo/QuantityDesctiptionService.cs index 8bc48ec..4ad0a3d 100644 --- a/EProject/BLL/BaseInfo/QuantityDesctiptionService.cs +++ b/EProject/BLL/BaseInfo/QuantityDesctiptionService.cs @@ -91,7 +91,7 @@ namespace BLL dropName.DataBind(); if (isShowPlease) { - Funs.FineUIPleaseSelect(dropName); + Funs.FineUIPleaseSelect(dropName,"-请选择-"); } } @@ -114,7 +114,7 @@ namespace BLL dropName.DataBind(); if (isShowPlease) { - Funs.FineUIPleaseSelect(dropName); + Funs.FineUIPleaseSelect(dropName, "-请选择-"); } } @@ -137,7 +137,7 @@ namespace BLL dropName.DataBind(); if (isShowPlease) { - Funs.FineUIPleaseSelect(dropName); + Funs.FineUIPleaseSelect(dropName, "-请选择-"); } } @@ -160,7 +160,7 @@ namespace BLL dropName.DataBind(); if (isShowPlease) { - Funs.FineUIPleaseSelect(dropName); + Funs.FineUIPleaseSelect(dropName, "-请选择-"); } } diff --git a/EProject/FineUIPro.Web/BaseInfo/QuantityDesctiption.aspx b/EProject/FineUIPro.Web/BaseInfo/QuantityDesctiption.aspx index 217049d..7f928aa 100644 --- a/EProject/FineUIPro.Web/BaseInfo/QuantityDesctiption.aspx +++ b/EProject/FineUIPro.Web/BaseInfo/QuantityDesctiption.aspx @@ -34,10 +34,10 @@ FieldType="String" HeaderText="Identifier" HeaderTextAlign="Center" TextAlign="Center"> + FieldType="String" HeaderText="Discipline" HeaderTextAlign="Center" TextAlign="Left"> + FieldType="String" HeaderText="Quantity Description" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true"> @@ -67,11 +67,11 @@ - + - diff --git a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditor.aspx b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditor.aspx index c6832c2..234ca86 100644 --- a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditor.aspx +++ b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditor.aspx @@ -149,10 +149,10 @@ SortField="Identifier" FieldType="String" HeaderText="Identifier" HeaderTextAlign="Center" TextAlign="Left"> + FieldType="String" HeaderText="Discipline" HeaderTextAlign="Center" TextAlign="Left"> + FieldType="String" HeaderText="Quantity Description" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true"> diff --git a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx index 11deb96..b107aae 100644 --- a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx +++ b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx @@ -62,8 +62,8 @@ - - + + diff --git a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.cs b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.cs index 7de4fc7..d4ae6da 100644 --- a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.cs +++ b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorEdit.aspx.cs @@ -71,11 +71,11 @@ namespace FineUIPro.Web.EditorManage } else { - Funs.FineUIPleaseSelect(this.drpIdentifier); + Funs.FineUIPleaseSelect(this.drpIdentifier,"-请选择-"); } - Funs.FineUIPleaseSelect(this.drpDescipline); - Funs.FineUIPleaseSelect(this.drpQuantityDesctiption); - Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit); + Funs.FineUIPleaseSelect(this.drpDescipline, "-请选择-"); + Funs.FineUIPleaseSelect(this.drpQuantityDesctiption, "-请选择-"); + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit, "-请选择-"); this.ProjectId = Request.Params["eProjectId"]; this.KeyQuantityId = Request.Params["keyQuantityId"]; @@ -367,12 +367,71 @@ namespace FineUIPro.Web.EditorManage if (this.drpType.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpType.SelectedValue)) { BLL.QuantityDesctiptionService.InitIdentifierDropDownList(this.drpIdentifier, this.drpType.SelectedValue, true); + if (this.drpIdentifier.Items.Count == 2) + { + this.drpIdentifier.SelectedIndex = 1; + + BLL.QuantityDesctiptionService.InitDesciplineDropDownList(this.drpDescipline, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue); + if (this.drpDescipline.Items.Count == 2) + { + this.drpDescipline.SelectedIndex = 1; + BLL.QuantityDesctiptionService.InitQuantityDesctiptionDropDownList(this.drpQuantityDesctiption, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue); + if (this.drpQuantityDesctiption.Items.Count == 2) + { + this.drpQuantityDesctiption.SelectedIndex = 1; + BLL.QuantityDesctiptionService.InitPlanMHRsUnitDropDownList(this.drpPlanMHRsUnit, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue, this.drpQuantityDesctiption.SelectedValue); + if (this.drpPlanMHRsUnit.Items.Count == 2) + { + this.drpPlanMHRsUnit.SelectedIndex = 1; + 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 + { + this.drpPlanMHRsUnit.SelectedIndex = 0; + } + } + else + { + this.drpQuantityDesctiption.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit, "-请选择-"); + this.drpPlanMHRsUnit.SelectedIndex = 0; + } + } + else + { + this.drpDescipline.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpQuantityDesctiption, "-请选择-"); + this.drpQuantityDesctiption.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit, "-请选择-"); + this.drpPlanMHRsUnit.SelectedIndex = 0; + } + } + else + { + this.drpIdentifier.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpDescipline, "-请选择-"); + this.drpDescipline.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpQuantityDesctiption, "-请选择-"); + this.drpQuantityDesctiption.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit, "-请选择-"); + this.drpPlanMHRsUnit.SelectedIndex = 0; + } } else { - Funs.FineUIPleaseSelect(this.drpIdentifier); + Funs.FineUIPleaseSelect(this.drpIdentifier, "-请选择-"); + this.drpIdentifier.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpDescipline, "-请选择-"); + this.drpDescipline.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpQuantityDesctiption, "-请选择-"); + this.drpQuantityDesctiption.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit, "-请选择-"); + this.drpPlanMHRsUnit.SelectedIndex = 0; } - this.drpIdentifier.SelectedIndex = 0; } /// @@ -388,12 +447,61 @@ namespace FineUIPro.Web.EditorManage if (this.drpIdentifier.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpIdentifier.SelectedValue) && this.drpType.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpType.SelectedValue)) { BLL.QuantityDesctiptionService.InitDesciplineDropDownList(this.drpDescipline, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue); + if (this.drpDescipline.Items.Count == 2) + { + this.drpDescipline.SelectedIndex = 1; + + 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(); + + BLL.QuantityDesctiptionService.InitQuantityDesctiptionDropDownList(this.drpQuantityDesctiption, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue); + if (this.drpQuantityDesctiption.Items.Count == 2) + { + this.drpQuantityDesctiption.SelectedIndex = 1; + BLL.QuantityDesctiptionService.InitPlanMHRsUnitDropDownList(this.drpPlanMHRsUnit, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue, this.drpQuantityDesctiption.SelectedValue); + if (this.drpPlanMHRsUnit.Items.Count == 2) + { + this.drpPlanMHRsUnit.SelectedIndex = 1; + + double? actualHoursSum2 = (from x in Funs.DB.ManHours_Actual + where x.EProjectId == this.ProjectId + && x.Discipline == this.drpDescipline.SelectedValue + select x.Hours).Sum(); + this.txtActualMHRs.Text = actualHoursSum2.ToString(); + } + else + { + this.drpPlanMHRsUnit.SelectedIndex = 0; + } + } + else + { + this.drpQuantityDesctiption.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit, "-请选择-"); + this.drpPlanMHRsUnit.SelectedIndex = 0; + } + } + else + { + this.drpDescipline.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpQuantityDesctiption, "-请选择-"); + this.drpQuantityDesctiption.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit, "-请选择-"); + this.drpPlanMHRsUnit.SelectedIndex = 0; + } } else { - Funs.FineUIPleaseSelect(this.drpDescipline); + Funs.FineUIPleaseSelect(this.drpDescipline, "-请选择-"); + this.drpDescipline.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpQuantityDesctiption, "-请选择-"); + this.drpQuantityDesctiption.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit, "-请选择-"); + this.drpPlanMHRsUnit.SelectedIndex = 0; } - this.drpDescipline.SelectedIndex = 0; } /// @@ -409,6 +517,25 @@ namespace FineUIPro.Web.EditorManage if (this.drpType.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpType.SelectedValue) && this.drpIdentifier.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpIdentifier.SelectedValue) && this.drpDescipline.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpDescipline.SelectedValue)) { BLL.QuantityDesctiptionService.InitQuantityDesctiptionDropDownList(this.drpQuantityDesctiption, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue); + if (this.drpQuantityDesctiption.Items.Count == 2) + { + this.drpQuantityDesctiption.SelectedIndex = 1; + BLL.QuantityDesctiptionService.InitPlanMHRsUnitDropDownList(this.drpPlanMHRsUnit, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue, this.drpQuantityDesctiption.SelectedValue); + if (this.drpPlanMHRsUnit.Items.Count == 2) + { + this.drpPlanMHRsUnit.SelectedIndex = 1; + } + else + { + this.drpPlanMHRsUnit.SelectedIndex = 0; + } + } + else + { + this.drpQuantityDesctiption.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit, "-请选择-"); + this.drpPlanMHRsUnit.SelectedIndex = 0; + } double? actualHoursSum = (from x in Funs.DB.ManHours_Actual where x.EProjectId == this.ProjectId @@ -418,9 +545,11 @@ namespace FineUIPro.Web.EditorManage } else { - Funs.FineUIPleaseSelect(this.drpQuantityDesctiption); + Funs.FineUIPleaseSelect(this.drpQuantityDesctiption, "-请选择-"); + this.drpQuantityDesctiption.SelectedIndex = 0; + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit, "-请选择-"); + this.drpPlanMHRsUnit.SelectedIndex = 0; } - this.drpQuantityDesctiption.SelectedIndex = 0; } /// @@ -434,12 +563,20 @@ namespace FineUIPro.Web.EditorManage if (this.drpType.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpType.SelectedValue) && this.drpIdentifier.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpIdentifier.SelectedValue) && this.drpDescipline.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpDescipline.SelectedValue) && this.drpQuantityDesctiption.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpQuantityDesctiption.SelectedValue)) { BLL.QuantityDesctiptionService.InitPlanMHRsUnitDropDownList(this.drpPlanMHRsUnit, true, this.drpType.SelectedValue, this.drpIdentifier.SelectedValue, this.drpDescipline.SelectedValue, this.drpQuantityDesctiption.SelectedValue); + if (this.drpPlanMHRsUnit.Items.Count == 2) + { + this.drpPlanMHRsUnit.SelectedIndex = 1; + } + else + { + this.drpPlanMHRsUnit.SelectedIndex = 0; + } } else { - Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit); + Funs.FineUIPleaseSelect(this.drpPlanMHRsUnit, "-请选择-"); + this.drpPlanMHRsUnit.SelectedIndex = 0; } - this.drpPlanMHRsUnit.SelectedIndex = 0; } #endregion diff --git a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorList.aspx b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorList.aspx index 77ec08e..691a28f 100644 --- a/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorList.aspx +++ b/EProject/FineUIPro.Web/EditorManage/KeyQuantityEditorList.aspx @@ -43,10 +43,10 @@ SortField="Identifier" FieldType="String" HeaderText="Identifier" HeaderTextAlign="Center" TextAlign="Left"> + FieldType="String" HeaderText="Discipline" HeaderTextAlign="Center" TextAlign="Left"> + FieldType="String" HeaderText="Quantity Description" HeaderTextAlign="Center" TextAlign="Left" ExpandUnusedSpace="true">