diff --git a/SGGL/FineUIPro.Web/Controls/ChartControl.ascx.cs b/SGGL/FineUIPro.Web/Controls/ChartControl.ascx.cs index 9cb24382..cb6c6d73 100644 --- a/SGGL/FineUIPro.Web/Controls/ChartControl.ascx.cs +++ b/SGGL/FineUIPro.Web/Controls/ChartControl.ascx.cs @@ -231,7 +231,7 @@ namespace Web.Controls for (int i = 0; i < chart1.Series["本月计划工作预算费用-BCWS"].Points.Count; i++) { - chart1.Series["本月计划工作预算费用-BCWS"].Points[i].ToolTip = "#VALX,#VALY"; + chart1.Series["本月计划工作预算费用-BCWS"].Points[i].ToolTip = "本月计划工作预算费用-BCWS\n#VALX\n#VALY"; } chart1.Series["本月已完工作预算费用-BCWP"].Points.DataBindXY(dv, "月份", dv, "本月已完工作预算费用-BCWP"); @@ -239,7 +239,7 @@ namespace Web.Controls for (int i = 0; i < chart1.Series["本月已完工作预算费用-BCWP"].Points.Count; i++) { - chart1.Series["本月已完工作预算费用-BCWP"].Points[i].ToolTip = "#VALX,#VALY"; + chart1.Series["本月已完工作预算费用-BCWP"].Points[i].ToolTip = "本月已完工作预算费用-BCWP\n#VALX\n#VALY"; } chart1.Series["本月已完工作实际费用-ACWP"].Points.DataBindXY(dv, "月份", dv, "本月已完工作实际费用-ACWP"); @@ -247,7 +247,7 @@ namespace Web.Controls for (int i = 0; i < chart1.Series["本月已完工作实际费用-ACWP"].Points.Count; i++) { - chart1.Series["本月已完工作实际费用-ACWP"].Points[i].ToolTip = "#VALX,#VALY"; + chart1.Series["本月已完工作实际费用-ACWP"].Points[i].ToolTip = "本月已完工作实际费用-ACWP\n#VALX\n#VALY"; } chart1.Series["累计计划工作预算费用-BCWS"].Points.DataBindXY(dv, "月份", dv, "累计计划工作预算费用-BCWS"); @@ -257,7 +257,7 @@ namespace Web.Controls for (int i = 0; i < chart1.Series["累计计划工作预算费用-BCWS"].Points.Count; i++) { - chart1.Series["累计计划工作预算费用-BCWS"].Points[i].ToolTip = "#VALX,#VALY"; + chart1.Series["累计计划工作预算费用-BCWS"].Points[i].ToolTip = "累计计划工作预算费用-BCWS\n#VALX\n#VALY"; } chart1.Series["累计已完工作预算费用-BCWP"].Points.DataBindXY(dv, "月份", dv, "累计已完工作预算费用-BCWP"); @@ -267,7 +267,7 @@ namespace Web.Controls for (int i = 0; i < chart1.Series["累计已完工作预算费用-BCWP"].Points.Count; i++) { - chart1.Series["累计已完工作预算费用-BCWP"].Points[i].ToolTip = "#VALX,#VALY"; + chart1.Series["累计已完工作预算费用-BCWP"].Points[i].ToolTip = "累计已完工作预算费用-BCWP\n#VALX\n#VALY"; } chart1.Series["累计已完工作实际费用-ACWP"].Points.DataBindXY(dv, "月份", dv, "累计已完工作实际费用-ACWP"); @@ -277,7 +277,7 @@ namespace Web.Controls for (int i = 0; i < chart1.Series["累计已完工作实际费用-ACWP"].Points.Count; i++) { - chart1.Series["累计已完工作实际费用-ACWP"].Points[i].ToolTip = "#VALX,#VALY"; + chart1.Series["累计已完工作实际费用-ACWP"].Points[i].ToolTip = "累计已完工作实际费用-ACWP\n#VALX\n#VALY"; } Controls.Add(chart1); diff --git a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx index e42531bd..72aff1dd 100644 --- a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx +++ b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx @@ -28,6 +28,7 @@ + @@ -93,9 +94,27 @@ + + + + diff --git a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx.cs b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx.cs index 64178bb8..96c147ae 100644 --- a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx.cs +++ b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx.cs @@ -169,77 +169,77 @@ namespace FineUIPro.Web.JDGL.WBS where x.ProjectId == this.CurrUser.LoginProjectId select x; Model.SGGLDB db = Funs.DB; - foreach (JObject mergedRow in Grid1.GetMergedData()) - //foreach (JObject mergedRow in Grid1.GetModifiedData()) + string[] ids = this.hdId.Text.Split(','); + if (ids.Length > 0) { - JObject values = mergedRow.Value("values"); - int i = mergedRow.Value("index"); - if (this.Grid1.Rows[i].DataKeys[2] != null) + foreach (JObject mergedRow in Grid1.GetMergedData()) { - Model.WBS_CostControl costControl = oldViewInfos.FirstOrDefault(x => x.CostControlId == this.Grid1.Rows[i].DataKeys[2].ToString()); - if (costControl != null) + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + if (this.Grid1.Rows[i].DataKeys[2] != null) { - decimal oldPlanPrice = costControl.PlanPrice ?? 0; - decimal oldRealPrice = costControl.RealPrice ?? 0; - string costControlId = costControl.CostControlId; - string totalNum = values.Value("TotalNum"); - string planPrice = values.Value("PlanPrice"); - string realPrice = values.Value("RealPrice"); - string planStartDate = values.Value("PlanStartDate"); - string planEndDate = values.Value("PlanEndDate"); - string realStartDate = values.Value("RealStartDate"); - string realEndDate = values.Value("RealEndDate"); - costControl.TotalNum = Funs.GetNewDecimal(totalNum); - costControl.PlanPrice = Funs.GetNewDecimal(planPrice); - costControl.RealPrice = Funs.GetNewDecimal(realPrice); - costControl.PlanStartDate = Funs.GetNewDateTime(planStartDate); - costControl.PlanEndDate = Funs.GetNewDateTime(planEndDate); - costControl.RealStartDate = Funs.GetNewDateTime(realStartDate); - costControl.RealEndDate = Funs.GetNewDateTime(realEndDate); - BLL.CostControlService.UpdateCostControl(costControl); - for (int j = 0; j < months.Count; j++) + Model.WBS_CostControl costControl = oldViewInfos.FirstOrDefault(x => x.CostControlId == this.Grid1.Rows[i].DataKeys[2].ToString()); + if (costControl != null && ids.Contains(this.Grid1.Rows[i].DataKeys[2].ToString())) { - oldThisPlanValue = 0; - oldThisRealCost = 0; - oldThisPlanCost = 0; - changeThisPlanValue = 0; - changeThisRealCost = 0; - changeThisPlanCost = 0; - string planNum = values.Value(string.Format("{0:yyyy-MM}", months[j]) + "Plan"); - string thisNum = values.Value(string.Format("{0:yyyy-MM}", months[j]) + "This"); - Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(costControlId, months[j]); - if (costControlDetail != null) - { - oldThisPlanValue = (costControlDetail.PlanNum ?? 0) * oldPlanPrice; - oldThisRealCost = (costControlDetail.ThisNum ?? 0) * oldRealPrice; - oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * oldPlanPrice; - costControlDetail.PlanNum = Funs.GetNewDecimalOrZero(planNum); - costControlDetail.ThisNum = Funs.GetNewDecimalOrZero(thisNum); - thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0); - thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0); - thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0); - //BLL.CostControlDetailService.UpdateCostControlDetail(costControlDetail); - } - else - { - costControlDetail = new Model.WBS_CostControlDetail(); - costControlDetail.CostControlDetailId = SQLHelper.GetNewID(); - costControlDetail.CostControlId = costControlId; - costControlDetail.Months = months[j]; - costControlDetail.PlanNum = Funs.GetNewDecimalOrZero(planNum); - costControlDetail.ThisNum = Funs.GetNewDecimalOrZero(thisNum); - thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0); - thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0); - thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0); - //BLL.CostControlDetailService.AddCostControlDetail(costControlDetail); - db.WBS_CostControlDetail.InsertOnSubmit(costControlDetail); - } - //累加变化值,计算总的变化值 - changeThisPlanValue += thisPlanValue - oldThisPlanValue; - changeThisRealCost += thisRealCost - oldThisRealCost; - changeThisPlanCost += thisPlanCost - oldThisPlanCost; - if (changeThisPlanValue != 0 || changeThisRealCost != 0 || changeThisPlanCost != 0) + decimal oldPlanPrice = costControl.PlanPrice ?? 0; + decimal oldRealPrice = costControl.RealPrice ?? 0; + string costControlId = costControl.CostControlId; + string totalNum = values.Value("TotalNum"); + string planPrice = values.Value("PlanPrice"); + string realPrice = values.Value("RealPrice"); + string planStartDate = values.Value("PlanStartDate"); + string planEndDate = values.Value("PlanEndDate"); + string realStartDate = values.Value("RealStartDate"); + string realEndDate = values.Value("RealEndDate"); + costControl.TotalNum = Funs.GetNewDecimal(totalNum); + costControl.PlanPrice = Funs.GetNewDecimal(planPrice); + costControl.RealPrice = Funs.GetNewDecimal(realPrice); + costControl.PlanStartDate = Funs.GetNewDateTime(planStartDate); + costControl.PlanEndDate = Funs.GetNewDateTime(planEndDate); + costControl.RealStartDate = Funs.GetNewDateTime(realStartDate); + costControl.RealEndDate = Funs.GetNewDateTime(realEndDate); + BLL.CostControlService.UpdateCostControl(costControl); + for (int j = 0; j < months.Count; j++) { + oldThisPlanValue = 0; + oldThisRealCost = 0; + oldThisPlanCost = 0; + changeThisPlanValue = 0; + changeThisRealCost = 0; + changeThisPlanCost = 0; + string planNum = values.Value(string.Format("{0:yyyy-MM}", months[j]) + "Plan"); + string thisNum = values.Value(string.Format("{0:yyyy-MM}", months[j]) + "This"); + Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(costControlId, months[j]); + if (costControlDetail != null) + { + oldThisPlanValue = (costControlDetail.PlanNum ?? 0) * oldPlanPrice; + oldThisRealCost = (costControlDetail.ThisNum ?? 0) * oldRealPrice; + oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * oldPlanPrice; + costControlDetail.PlanNum = Funs.GetNewDecimalOrZero(planNum); + costControlDetail.ThisNum = Funs.GetNewDecimalOrZero(thisNum); + thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0); + thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0); + thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0); + //BLL.CostControlDetailService.UpdateCostControlDetail(costControlDetail); + } + else + { + costControlDetail = new Model.WBS_CostControlDetail(); + costControlDetail.CostControlDetailId = SQLHelper.GetNewID(); + costControlDetail.CostControlId = costControlId; + costControlDetail.Months = months[j]; + costControlDetail.PlanNum = Funs.GetNewDecimalOrZero(planNum); + costControlDetail.ThisNum = Funs.GetNewDecimalOrZero(thisNum); + thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0); + thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0); + thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0); + //BLL.CostControlDetailService.AddCostControlDetail(costControlDetail); + db.WBS_CostControlDetail.InsertOnSubmit(costControlDetail); + } + //累加变化值,计算总的变化值 + changeThisPlanValue += thisPlanValue - oldThisPlanValue; + changeThisRealCost += thisRealCost - oldThisRealCost; + changeThisPlanCost += thisPlanCost - oldThisPlanCost; //更新工作包、工作项 Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(costControl.WbsSetId); UpdateWbsSetDetail(db, costControl.WbsSetId, months[j], changeThisPlanValue, changeThisRealCost, changeThisPlanCost); diff --git a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx.designer.cs b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx.designer.cs index 7d17de0e..7e3631bf 100644 --- a/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/JDGL/WBS/WorkloadInputEditAll.aspx.designer.cs @@ -57,6 +57,15 @@ namespace FineUIPro.Web.JDGL.WBS { /// protected global::FineUIPro.Toolbar Toolbar2; + /// + /// hdId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox hdId; + /// /// btnSave 控件。 ///