0601-001
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>工作量录入</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
<style type="text/css">
|
||||
.f-grid-row .f-grid-cell-inner {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
@@ -74,6 +74,8 @@
|
||||
</f:DatePicker>
|
||||
<%--<f:DropDownList ID="drpWeek" runat="server" Label="周" LabelAlign="right" AutoPostBack="true" OnSelectedIndexChanged="drpWeek_SelectedIndexChanged"></f:DropDownList>--%>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnEditAll" Icon="Pencil" runat="server" ToolTip="全项目录入" Hidden="true" OnClick="btnEditAll_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" Icon="ApplicationGet" runat="server" ToolTip="导入" Hidden="true" OnClick="btnImport_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
||||
@@ -7,7 +7,7 @@ using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
public partial class WorkloadInput : PageBase
|
||||
{
|
||||
@@ -960,6 +960,7 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
this.btnEditAll.Hidden = false;
|
||||
this.btnImport.Hidden = false;
|
||||
}
|
||||
}
|
||||
@@ -1011,6 +1012,18 @@ namespace FineUIPro.Web.JDGL.WBS
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#region 全项目录入
|
||||
/// <summary>
|
||||
/// 全项目录入按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEditAll_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("WorkloadInputEditAll.aspx?ProjectId={0}", this.CurrUser.LoginProjectId, "导入 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导入
|
||||
/// <summary>
|
||||
/// 导入按钮
|
||||
|
||||
@@ -102,6 +102,15 @@ namespace FineUIPro.Web.JDGL.WBS {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtMonths;
|
||||
|
||||
/// <summary>
|
||||
/// btnEditAll 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEditAll;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkloadInputEditAll.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.WorkloadInputEditAll" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>全项目录入</title>
|
||||
<style type="text/css">
|
||||
.f-grid-row.noEdit{
|
||||
pointer-events:none;
|
||||
}
|
||||
|
||||
.f-grid-colheader-text {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="项目情况" BoxFlex="1" AllowColumnLocking="true"
|
||||
runat="server" EnableCollapse="true" DataKeyNames="Id,Name,ShowId" EnableTree="true" EnableColumnLines="true" ClicksToEdit="1" AllowCellEditing="true"
|
||||
TreeColumn="Name" DataIDField="Id" DataParentIDField="SupId" ExpandAllTreeNodes="true" >
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<%--<f:RowNumberField HeaderText="序号"/>--%>
|
||||
<f:BoundField Width="350px" ColumnID="Name" DataField="Name" HeaderTextAlign="Center" EnableLock="true" Locked="true"
|
||||
HeaderText="工作内容" />
|
||||
<f:BoundField Width="100px" DataField="Unit" HeaderText="单位" TextAlign="Center" EnableLock="true" Locked="true"/>
|
||||
<f:RenderField Width="100px" ColumnID="TotalNum" DataField="TotalNum" FieldType="Double" EnableLock="true" Locked="true"
|
||||
HeaderText="合同工作量" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:NumberBox ID="nbTotalNum" NoDecimal="false" NoNegative="true" MinValue="0"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PlanPrice" DataField="PlanPrice" FieldType="Double" EnableLock="true" Locked="true"
|
||||
HeaderText="预算单价" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:NumberBox ID="nbPlanPrice" NoDecimal="false" NoNegative="true" MinValue="0"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="RealPrice" DataField="RealPrice" FieldType="Double" EnableLock="true" Locked="true"
|
||||
HeaderText="实际单价" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<Editor>
|
||||
<f:NumberBox ID="nbRealPrice" NoDecimal="false" NoNegative="true" MinValue="0"
|
||||
runat="server">
|
||||
</f:NumberBox>
|
||||
</Editor>
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,442 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
public partial class WorkloadInputEditAll : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 列数量
|
||||
/// </summary>
|
||||
public int ColumnNum
|
||||
{
|
||||
get
|
||||
{
|
||||
return (int)ViewState["ColumnNum"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ColumnNum"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上传预设的虚拟路径
|
||||
/// </summary>
|
||||
private string initPath = Const.ExcelUrl;
|
||||
|
||||
/// <summary>
|
||||
/// 错误集合
|
||||
/// </summary>
|
||||
public static string errorInfos = string.Empty;
|
||||
|
||||
/// <summary>
|
||||
/// 月份集合
|
||||
/// </summary>
|
||||
public static List<DateTime> months = new List<DateTime>();
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 加载表头
|
||||
/// </summary>
|
||||
protected void Page_Init(object sender, EventArgs e)
|
||||
{
|
||||
InitGrid();
|
||||
}
|
||||
|
||||
#region 表头
|
||||
/// <summary>
|
||||
/// 表头
|
||||
/// </summary>
|
||||
private void InitGrid()
|
||||
{
|
||||
ColumnNum = 0;
|
||||
months.Clear();
|
||||
var installation = Funs.DB.Project_Installation.FirstOrDefault(x => x.SuperInstallationId == "0" && x.ProjectId == this.CurrUser.LoginProjectId);
|
||||
if (installation != null)
|
||||
{
|
||||
DateTime startDate, endDate, startMonth, endMonth;
|
||||
if (installation.StartDate != null && installation.EndDate != null)
|
||||
{
|
||||
startDate = Convert.ToDateTime(installation.StartDate);
|
||||
endDate = Convert.ToDateTime(installation.EndDate);
|
||||
startMonth = Convert.ToDateTime(startDate.Year + "-" + startDate.Month + "-01");
|
||||
endMonth = Convert.ToDateTime(endDate.Year + "-" + endDate.Month + "-01");
|
||||
do
|
||||
{
|
||||
months.Add(startMonth);
|
||||
startMonth = startMonth.AddMonths(1);
|
||||
} while (startMonth <= endMonth);
|
||||
}
|
||||
for (int i = 0; i < months.Count; i++)
|
||||
{
|
||||
RenderField rdPlan = new RenderField();
|
||||
rdPlan.ColumnID = string.Format("{0:yyyy-MM}", months[i]) + "Plan";
|
||||
rdPlan.Width = Unit.Pixel(100);
|
||||
rdPlan.DataField = "PlanNum" + (i + 1).ToString();
|
||||
rdPlan.FieldType = FieldType.Double;
|
||||
rdPlan.HeaderText = string.Format("{0:yyyy年MM月}", months[i]) + "<br/>计划量";
|
||||
rdPlan.HeaderTextAlign = TextAlign.Center;
|
||||
NumberBox numPlan = new NumberBox();
|
||||
numPlan.NoNegative = true;
|
||||
numPlan.NoDecimal = false;
|
||||
rdPlan.Editor.Add(numPlan);
|
||||
Grid1.Columns.Add(rdPlan);
|
||||
|
||||
RenderField rdThis = new RenderField();
|
||||
rdThis.ColumnID = string.Format("{0:yyyy-MM}", months[i]) + "This";
|
||||
rdThis.Width = Unit.Pixel(100);
|
||||
rdThis.DataField = "ThisNum" + (i + 1).ToString();
|
||||
rdThis.FieldType = FieldType.Double;
|
||||
rdThis.HeaderText = string.Format("{0:yyyy年MM月}", months[i]) + "<br/>完成量";
|
||||
rdThis.HeaderTextAlign = TextAlign.Center;
|
||||
NumberBox numReal = new NumberBox();
|
||||
numReal.NoNegative = true;
|
||||
numReal.NoDecimal = false;
|
||||
rdThis.Editor.Add(numReal);
|
||||
Grid1.Columns.Add(rdThis);
|
||||
}
|
||||
RenderField rdId = new RenderField();
|
||||
rdId.ColumnID = "ShowId";
|
||||
rdId.Width = Unit.Pixel(350);
|
||||
rdId.DataField = "ShowId";
|
||||
rdId.FieldType = FieldType.String;
|
||||
rdId.HeaderText = "ShowId";
|
||||
rdId.HeaderTextAlign = TextAlign.Center;
|
||||
Grid1.Columns.Add(rdId);
|
||||
rdId.Hidden = true;
|
||||
ColumnNum = 5 + months.Count * 2 + 1;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
errorInfos = string.Empty;
|
||||
DataTable table = BLL.WorkloadStatisticsService.GetAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
for (int i = 0; i < this.Grid1.Rows.Count; i++)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.Grid1.Rows[i].DataKeys[2].ToString()))
|
||||
{
|
||||
this.Grid1.Rows[i].RowCssClass = "noEdit";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Save();
|
||||
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
|
||||
}
|
||||
|
||||
private void Save()
|
||||
{
|
||||
decimal changeThisPlanValue = 0, changeThisRealCost = 0, changeThisPlanCost = 0, //当月总变化完成成本、完成预算
|
||||
oldThisPlanValue = 0, oldThisRealCost = 0, oldThisPlanCost = 0,
|
||||
thisPlanValue = 0, thisRealCost = 0, thisPlanCost = 0;
|
||||
var oldViewInfos = from x in Funs.DB.WBS_CostControl
|
||||
where x.ProjectId == this.CurrUser.LoginProjectId
|
||||
select x;
|
||||
foreach (JObject mergedRow in Grid1.GetMergedData())
|
||||
{
|
||||
JObject values = mergedRow.Value<JObject>("values");
|
||||
int i = mergedRow.Value<int>("index");
|
||||
if (this.Grid1.Rows[i].DataKeys[2] != null)
|
||||
{
|
||||
Model.WBS_CostControl costControl = oldViewInfos.FirstOrDefault(x => x.CostControlId == this.Grid1.Rows[i].DataKeys[2].ToString());
|
||||
if (costControl != null)
|
||||
{
|
||||
string costControlId = costControl.CostControlId;
|
||||
string totalNum = values.Value<string>("TotalNum");
|
||||
string planPrice = values.Value<string>("PlanPrice");
|
||||
string realPrice = values.Value<string>("RealPrice");
|
||||
costControl.TotalNum = Funs.GetNewDecimal(totalNum);
|
||||
costControl.PlanPrice = Funs.GetNewDecimal(planPrice);
|
||||
costControl.RealPrice = Funs.GetNewDecimal(realPrice);
|
||||
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>(string.Format("{0:yyyy-MM}", months[j]) + "Plan");
|
||||
string thisNum = values.Value<string>(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) * (costControl.PlanPrice ?? 0);
|
||||
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
|
||||
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
|
||||
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);
|
||||
}
|
||||
//累加变化值,计算总的变化值
|
||||
changeThisPlanValue += thisPlanValue - oldThisPlanValue;
|
||||
changeThisRealCost += thisRealCost - oldThisRealCost;
|
||||
changeThisPlanCost += thisPlanCost - oldThisPlanCost;
|
||||
//更新工作包、工作项
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(costControl.WbsSetId);
|
||||
UpdateWbsSetDetail(costControl.WbsSetId, months[j], changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
|
||||
//更新分部
|
||||
Model.WBS_CostControlParentDetail unitProjectDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(wbsSet.UnitProjectId, months[j]);
|
||||
if (unitProjectDetail != null)
|
||||
{
|
||||
unitProjectDetail.ThisPlanValue += changeThisPlanValue;
|
||||
unitProjectDetail.ThisRealCost += changeThisRealCost;
|
||||
unitProjectDetail.ThisPlanCost += changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(unitProjectDetail);
|
||||
}
|
||||
else
|
||||
{
|
||||
unitProjectDetail = new Model.WBS_CostControlParentDetail();
|
||||
unitProjectDetail.CostControlParentDetailId = SQLHelper.GetNewID();
|
||||
unitProjectDetail.ParentId = wbsSet.UnitProjectId;
|
||||
unitProjectDetail.Months = months[j];
|
||||
unitProjectDetail.ThisPlanValue = changeThisPlanValue;
|
||||
unitProjectDetail.ThisRealCost = changeThisRealCost;
|
||||
unitProjectDetail.ThisPlanCost = changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.AddCostControlParentDetail(unitProjectDetail);
|
||||
}
|
||||
//更新专业
|
||||
if (!string.IsNullOrEmpty(wbsSet.CnProfessionId))
|
||||
{
|
||||
Model.WBS_CostControlParentDetail cnProfessionDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(wbsSet.CnProfessionId, months[j]);
|
||||
if (cnProfessionDetail != null)
|
||||
{
|
||||
cnProfessionDetail.ThisPlanValue += changeThisPlanValue;
|
||||
cnProfessionDetail.ThisRealCost += changeThisRealCost;
|
||||
cnProfessionDetail.ThisPlanCost += changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(cnProfessionDetail);
|
||||
}
|
||||
else
|
||||
{
|
||||
cnProfessionDetail = new Model.WBS_CostControlParentDetail();
|
||||
cnProfessionDetail.CostControlParentDetailId = SQLHelper.GetNewID();
|
||||
cnProfessionDetail.ParentId = wbsSet.CnProfessionId;
|
||||
cnProfessionDetail.Months = months[j];
|
||||
cnProfessionDetail.ThisPlanValue = changeThisPlanValue;
|
||||
cnProfessionDetail.ThisRealCost = changeThisRealCost;
|
||||
cnProfessionDetail.ThisPlanCost = changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.AddCostControlParentDetail(cnProfessionDetail);
|
||||
}
|
||||
}
|
||||
//更新装置
|
||||
UpdateInstallationDetail(wbsSet.InstallationId, months[j], changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#region 更新工作包、工作项
|
||||
/// <summary>
|
||||
/// 更新月工作包、工作项
|
||||
/// </summary>
|
||||
/// <param name="years"></param>
|
||||
/// <param name="months"></param>
|
||||
/// <param name="planValue"></param>
|
||||
/// <param name="parentId"></param>
|
||||
private void UpdateWbsSetDetail(string wbsSetId, DateTime months, decimal changeThisPlanValue, decimal changeThisRealCost, decimal changeThisPlanCost)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(wbsSetId);
|
||||
if (wbsSet != null)
|
||||
{
|
||||
Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(wbsSetId, months);
|
||||
if (parentDetail != null)
|
||||
{
|
||||
parentDetail.ThisPlanValue += changeThisPlanValue;
|
||||
parentDetail.ThisRealCost += changeThisRealCost;
|
||||
parentDetail.ThisPlanCost += changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(parentDetail);
|
||||
}
|
||||
else
|
||||
{
|
||||
parentDetail = new Model.WBS_CostControlParentDetail();
|
||||
parentDetail.CostControlParentDetailId = SQLHelper.GetNewID();
|
||||
parentDetail.ParentId = wbsSetId;
|
||||
parentDetail.Months = months;
|
||||
parentDetail.ThisPlanValue = changeThisPlanValue;
|
||||
parentDetail.ThisRealCost = changeThisRealCost;
|
||||
parentDetail.ThisPlanCost = changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.AddCostControlParentDetail(parentDetail);
|
||||
}
|
||||
if (wbsSet.SuperWbsSetId != null) //还存在上级节点,需要继续循环
|
||||
{
|
||||
UpdateWbsSetDetail(wbsSet.SuperWbsSetId, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新周工作包、工作项
|
||||
/// </summary>
|
||||
/// <param name="years"></param>
|
||||
/// <param name="months"></param>
|
||||
/// <param name="planValue"></param>
|
||||
/// <param name="parentId"></param>
|
||||
private void UpdateWeekWbsSetDetail(string wbsSetId, DateTime months, DateTime startDate, DateTime endDate, decimal changeThisPlanValue, decimal changeThisRealCost, decimal changeThisPlanCost)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(wbsSetId);
|
||||
if (wbsSet != null)
|
||||
{
|
||||
Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonthsWeek(wbsSetId, months, startDate);
|
||||
if (parentDetail != null)
|
||||
{
|
||||
parentDetail.ThisPlanValue += changeThisPlanValue;
|
||||
parentDetail.ThisRealCost += changeThisRealCost;
|
||||
parentDetail.ThisPlanCost += changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(parentDetail);
|
||||
}
|
||||
else
|
||||
{
|
||||
parentDetail = new Model.WBS_CostControlParentDetail();
|
||||
parentDetail.CostControlParentDetailId = SQLHelper.GetNewID();
|
||||
parentDetail.ParentId = wbsSetId;
|
||||
parentDetail.Months = months;
|
||||
parentDetail.StartDate = startDate;
|
||||
parentDetail.EndDate = endDate;
|
||||
parentDetail.ThisPlanValue = changeThisPlanValue;
|
||||
parentDetail.ThisRealCost = changeThisRealCost;
|
||||
parentDetail.ThisPlanCost = changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.AddCostControlParentDetail(parentDetail);
|
||||
}
|
||||
if (wbsSet.SuperWbsSetId != null) //还存在上级节点,需要继续循环
|
||||
{
|
||||
UpdateWeekWbsSetDetail(wbsSet.SuperWbsSetId, months, startDate, endDate, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 更新装置
|
||||
/// <summary>
|
||||
/// 更新月装置
|
||||
/// </summary>
|
||||
/// <param name="years"></param>
|
||||
/// <param name="months"></param>
|
||||
/// <param name="planValue"></param>
|
||||
/// <param name="parentId"></param>
|
||||
private void UpdateInstallationDetail(string installationId, DateTime months, decimal changeThisPlanValue, decimal changeThisRealCost, decimal changeThisPlanCost)
|
||||
{
|
||||
Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(installationId);
|
||||
if (installation != null)
|
||||
{
|
||||
Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(installationId, months);
|
||||
if (parentDetail != null)
|
||||
{
|
||||
parentDetail.ThisPlanValue += changeThisPlanValue;
|
||||
parentDetail.ThisRealCost += changeThisRealCost;
|
||||
parentDetail.ThisPlanCost += changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(parentDetail);
|
||||
}
|
||||
else
|
||||
{
|
||||
parentDetail = new Model.WBS_CostControlParentDetail();
|
||||
parentDetail.CostControlParentDetailId = SQLHelper.GetNewID();
|
||||
parentDetail.ParentId = installationId;
|
||||
parentDetail.Months = months;
|
||||
parentDetail.ThisPlanValue = changeThisPlanValue;
|
||||
parentDetail.ThisRealCost = changeThisRealCost;
|
||||
parentDetail.ThisPlanCost = changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.AddCostControlParentDetail(parentDetail);
|
||||
}
|
||||
if (installation.SuperInstallationId != null) //还存在上级节点,需要继续循环
|
||||
{
|
||||
UpdateInstallationDetail(installation.SuperInstallationId, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 更新周装置
|
||||
/// </summary>
|
||||
/// <param name="years"></param>
|
||||
/// <param name="months"></param>
|
||||
/// <param name="planValue"></param>
|
||||
/// <param name="parentId"></param>
|
||||
private void UpdateWeekInstallationDetail(string installationId, DateTime months, DateTime startDate, DateTime endDate, decimal changeThisPlanValue, decimal changeThisRealCost, decimal changeThisPlanCost)
|
||||
{
|
||||
Model.Project_Installation installation = BLL.Project_InstallationService.GetInstallationByInstallationId(installationId);
|
||||
if (installation != null)
|
||||
{
|
||||
Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(installationId, months);
|
||||
if (parentDetail != null)
|
||||
{
|
||||
parentDetail.ThisPlanValue += changeThisPlanValue;
|
||||
parentDetail.ThisRealCost += changeThisRealCost;
|
||||
parentDetail.ThisPlanCost += changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(parentDetail);
|
||||
}
|
||||
else
|
||||
{
|
||||
parentDetail = new Model.WBS_CostControlParentDetail();
|
||||
parentDetail.CostControlParentDetailId = SQLHelper.GetNewID();
|
||||
parentDetail.ParentId = installationId;
|
||||
parentDetail.Months = months;
|
||||
parentDetail.StartDate = startDate;
|
||||
parentDetail.EndDate = endDate;
|
||||
parentDetail.ThisPlanValue = changeThisPlanValue;
|
||||
parentDetail.ThisRealCost = changeThisRealCost;
|
||||
parentDetail.ThisPlanCost = changeThisPlanCost;
|
||||
BLL.CostControlParentDetailService.AddCostControlParentDetail(parentDetail);
|
||||
}
|
||||
if (installation.SuperInstallationId != null) //还存在上级节点,需要继续循环
|
||||
{
|
||||
UpdateWeekInstallationDetail(installation.SuperInstallationId, months, startDate, endDate, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS {
|
||||
|
||||
|
||||
public partial class WorkloadInputEditAll {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// nbTotalNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox nbTotalNum;
|
||||
|
||||
/// <summary>
|
||||
/// nbPlanPrice 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox nbPlanPrice;
|
||||
|
||||
/// <summary>
|
||||
/// nbRealPrice 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.NumberBox nbRealPrice;
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,7 @@
|
||||
<head runat="server">
|
||||
<title>导入工作量</title>
|
||||
</head>
|
||||
<body>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
|
||||
@@ -9,7 +9,7 @@ using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using BLL;
|
||||
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
public partial class WorkloadInputIn : PageBase
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
namespace FineUIPro.Web.JDGL.WBS {
|
||||
|
||||
|
||||
public partial class WorkloadInputIn {
|
||||
public partial class WorkloadInputIn {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
|
||||
Reference in New Issue
Block a user