1221-002-gaofei

This commit is contained in:
gaofei 2021-12-21 16:10:02 +08:00
parent 6887e55225
commit 0bf6d1efd7
22 changed files with 1553 additions and 548 deletions

View File

@ -0,0 +1,51 @@
alter table [dbo].[WBS_CostControl] add IsSelected bit null
GO
ALTER VIEW [dbo].[View_WBS_CostControlDetailStatistics]
AS
select InstallationId as Id,null as SupId ,InstallationCode as Code, InstallationName as Name,'Installation' as WBSType,null as OldCnProfessionId,null as OldUnitProjectCode,null as OldWbsSetCode,
ProjectId from dbo.Project_Installation where SuperInstallationId is null
Union
select InstallationId as Id,SuperInstallationId as SupId ,InstallationCode as Code, '['+InstallationCode+']'+InstallationName as Name,'Installation' as WBSType,null as OldCnProfessionId,null as OldUnitProjectCode,null as OldWbsSetCode,
ProjectId from dbo.Project_Installation where SuperInstallationId is not null
Union
select CnProfessionId as Id , InstallationId as SupId,CnProfessionCode as Code, CnProfessionName as Name,'CnProfession' as WBSType,OldId as OldCnProfessionId,null as OldUnitProjectCode,null as OldWbsSetCode,
ProjectId from dbo.WBS_CnProfession where IsApprove=1
Union all
select UnitProjectId as Id, isnull(CnProfessionId,InstallationId) as SupId,UnitProjectCode as Code,UnitProjectName as Name,'UnitProject' as WBSType,
(case when u.CnProfessionId is null then (select CnProfessionId from WBS_CnProfessionInit where CnProfessionName=(select InstallationName from Project_Installation where InstallationId=u.InstallationId)) else (select OldId from WBS_CnProfession c where c.CnProfessionId=u.CnProfessionId) end) as OldCnProfessionId,UnitProjectCode as OldUnitProjectCode,null as OldWbsSetCode,
ProjectId from dbo.Wbs_UnitProject u where IsApprove=1
Union all
select WbsSetId as id,UnitProjectId as SupId,WbsSetCode as Code, WbsSetName as Name,'WbsSet' as WBSType,
(case when w.CnProfessionId is null then (select CnProfessionId from WBS_CnProfessionInit where CnProfessionName=(select InstallationName from Project_Installation where InstallationId=w.InstallationId)) else (select OldId from WBS_CnProfession c where c.CnProfessionId=w.CnProfessionId) end) as OldCnProfessionId,(select UnitProjectCode from Wbs_UnitProject c where c.UnitProjectId=w.UnitProjectId) as OldUnitProjectCode,
WbsSetCode as OldWbsSetCode,
ProjectId from dbo.Wbs_WbsSet w where IsApprove=1 and SuperWbsSetId is null
Union all
select WbsSetId as id,SuperWbsSetId as SupId,WbsSetCode as Code, WbsSetName as Name,'WbsSet' as WBSType,
(case when w.CnProfessionId is null then (select CnProfessionId from WBS_CnProfessionInit where CnProfessionName=(select InstallationName from Project_Installation where InstallationId=w.InstallationId)) else (select OldId from WBS_CnProfession c where c.CnProfessionId=w.CnProfessionId) end) as OldCnProfessionId,(select UnitProjectCode from Wbs_UnitProject c where c.UnitProjectId=w.UnitProjectId) as OldUnitProjectCode,
(select WbsSetCode from Wbs_WbsSet ws where ws.WbsSetId=w.SuperWbsSetId) as OldWbsSetCode,
ProjectId from dbo.Wbs_WbsSet w where IsApprove=1 and SuperWbsSetId is not null
Union all
select c.CostControlId as id,c.WbsSetId as SupId,CostControlCode as Code,c.CostControlName as Name,'CostControl' as WBSType,
(case when ws.CnProfessionId is null then (select CnProfessionId from WBS_CnProfessionInit where CnProfessionName=(select InstallationName from Project_Installation where InstallationId=ws.InstallationId)) else (select OldId from WBS_CnProfession cn where cn.CnProfessionId=(select top 1 CnProfessionId from Wbs_WbsSet w where w.WbsSetId=c.WbsSetId)) end) as OldCnProfessionId,
(select UnitProjectCode from Wbs_UnitProject u where u.UnitProjectId=(select top 1 UnitProjectId from Wbs_WbsSet w where w.WbsSetId=c.WbsSetId)) as OldUnitProjectCode,
(select WbsSetCode from Wbs_WbsSet u where u.WbsSetId=(select top 1 w.SuperWbsSetId from Wbs_WbsSet w where w.WbsSetId=c.WbsSetId)) as OldWbsSetCode,
c.ProjectId from dbo.WBS_CostControl c
left join dbo.Wbs_WbsSet ws on ws.WbsSetId=c.WbsSetId
where c.IsSelected=1
GO

View File

@ -38,6 +38,16 @@ namespace BLL
return (from x in Funs.DB.WBS_CostControl where x.WbsSetId == wbsSetId select x).ToList(); return (from x in Funs.DB.WBS_CostControl where x.WbsSetId == wbsSetId select x).ToList();
} }
/// <summary>
/// 根据费控项编号集合获取勾选的费控项信息
/// </summary>
/// <param name="costControlCodes">费控项编号集合</param>
/// <returns></returns>
public static List<Model.WBS_CostControl> GetSelectedCostControlsByWbsSetId(string wbsSetId)
{
return (from x in Funs.DB.WBS_CostControl where x.WbsSetId == wbsSetId && x.IsSelected == true orderby x.CostControlCode, x.CostControlName select x).ToList();
}
/// <summary> /// <summary>
/// 增加费控项 /// 增加费控项
/// </summary> /// </summary>
@ -52,6 +62,7 @@ namespace BLL
newUP.CostControlCode = costControl.CostControlCode; newUP.CostControlCode = costControl.CostControlCode;
newUP.CostControlName = costControl.CostControlName; newUP.CostControlName = costControl.CostControlName;
newUP.Unit = costControl.Unit; newUP.Unit = costControl.Unit;
newUP.IsSelected = costControl.IsSelected;
newUP.TotalNum = costControl.TotalNum; newUP.TotalNum = costControl.TotalNum;
newUP.RealPrice = costControl.RealPrice; newUP.RealPrice = costControl.RealPrice;
@ -72,6 +83,7 @@ namespace BLL
newUP.CostControlName = costControl.CostControlName; newUP.CostControlName = costControl.CostControlName;
newUP.Unit = costControl.Unit; newUP.Unit = costControl.Unit;
newUP.TotalNum = costControl.TotalNum; newUP.TotalNum = costControl.TotalNum;
newUP.IsSelected = costControl.IsSelected;
newUP.RealPrice = costControl.RealPrice; newUP.RealPrice = costControl.RealPrice;
newUP.PlanPrice = costControl.PlanPrice; newUP.PlanPrice = costControl.PlanPrice;
db.SubmitChanges(); db.SubmitChanges();

View File

@ -2473,7 +2473,7 @@ namespace BLL
private static void AddDetail(List<Model.View_WBS_CostControlDetailStatistics> newList, List<Model.View_WBS_CostControlDetailStatistics> oldList, string id) private static void AddDetail(List<Model.View_WBS_CostControlDetailStatistics> newList, List<Model.View_WBS_CostControlDetailStatistics> oldList, string id)
{ {
var items = oldList.Where(x => x.SupId == id); var items = oldList.Where(x => x.SupId == id).OrderBy(x => x.Code);
foreach (var item in items) foreach (var item in items)
{ {
newList.Add(item); newList.Add(item);

View File

@ -1184,6 +1184,7 @@
<Content Include="JDGL\WBS\WBSSetCopy2.aspx" /> <Content Include="JDGL\WBS\WBSSetCopy2.aspx" />
<Content Include="JDGL\WBS\WBSSetEdit.aspx" /> <Content Include="JDGL\WBS\WBSSetEdit.aspx" />
<Content Include="JDGL\WBS\WorkloadInput.aspx" /> <Content Include="JDGL\WBS\WorkloadInput.aspx" />
<Content Include="JDGL\WBS\WorkloadInputEdit.aspx" />
<Content Include="JDGL\WBS\WorkloadStatistics.aspx" /> <Content Include="JDGL\WBS\WorkloadStatistics.aspx" />
<Content Include="Login.aspx" /> <Content Include="Login.aspx" />
<Content Include="Notice\IssuedNotice.aspx" /> <Content Include="Notice\IssuedNotice.aspx" />
@ -12222,6 +12223,13 @@
<Compile Include="JDGL\WBS\WorkloadInput.aspx.designer.cs"> <Compile Include="JDGL\WBS\WorkloadInput.aspx.designer.cs">
<DependentUpon>WorkloadInput.aspx</DependentUpon> <DependentUpon>WorkloadInput.aspx</DependentUpon>
</Compile> </Compile>
<Compile Include="JDGL\WBS\WorkloadInputEdit.aspx.cs">
<DependentUpon>WorkloadInputEdit.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="JDGL\WBS\WorkloadInputEdit.aspx.designer.cs">
<DependentUpon>WorkloadInputEdit.aspx</DependentUpon>
</Compile>
<Compile Include="JDGL\WBS\WorkloadStatistics.aspx.cs"> <Compile Include="JDGL\WBS\WorkloadStatistics.aspx.cs">
<DependentUpon>WorkloadStatistics.aspx</DependentUpon> <DependentUpon>WorkloadStatistics.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType> <SubType>ASPXCodeBehind</SubType>

View File

@ -29,7 +29,7 @@
<f:TextBox ID="txtUnit" runat="server" Label="单位" LabelWidth="130px" ></f:TextBox> <f:TextBox ID="txtUnit" runat="server" Label="单位" LabelWidth="130px" ></f:TextBox>
</Items> </Items>
</f:FormRow> </f:FormRow>
<f:FormRow> <%--<f:FormRow>
<Items> <Items>
<f:NumberBox ID="txtTotalNum" NoDecimal="false" NoNegative="true" MinValue="0" Label="合同工作量" LabelWidth="130px" <f:NumberBox ID="txtTotalNum" NoDecimal="false" NoNegative="true" MinValue="0" Label="合同工作量" LabelWidth="130px"
runat="server"> runat="server">
@ -42,7 +42,7 @@
runat="server"> runat="server">
</f:NumberBox> </f:NumberBox>
</Items> </Items>
</f:FormRow> </f:FormRow>--%>
</Rows> </Rows>
<Toolbars> <Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server"> <f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">

View File

@ -32,14 +32,14 @@ namespace FineUIPro.Web.JDGL.WBS
this.txtCostControlCode.Text = costControl.CostControlCode; this.txtCostControlCode.Text = costControl.CostControlCode;
this.txtCostControlName.Text = costControl.CostControlName; this.txtCostControlName.Text = costControl.CostControlName;
this.txtUnit.Text = costControl.Unit; this.txtUnit.Text = costControl.Unit;
if (costControl.TotalNum != null) //if (costControl.TotalNum != null)
{ //{
this.txtTotalNum.Text = costControl.TotalNum.ToString(); // this.txtTotalNum.Text = costControl.TotalNum.ToString();
} //}
if (costControl.RealPrice != null) //if (costControl.RealPrice != null)
{ //{
this.txtRealPrice.Text = costControl.RealPrice.ToString(); // this.txtRealPrice.Text = costControl.RealPrice.ToString();
} //}
} }
} }
} }
@ -71,8 +71,9 @@ namespace FineUIPro.Web.JDGL.WBS
costControl.ProjectId = wbsSet.ProjectId; costControl.ProjectId = wbsSet.ProjectId;
costControl.WbsSetId = wbsSet.WbsSetId; costControl.WbsSetId = wbsSet.WbsSetId;
costControl.Unit = txtUnit.Text.Trim(); costControl.Unit = txtUnit.Text.Trim();
costControl.TotalNum = Funs.GetNewDecimal(txtTotalNum.Text.Trim()); costControl.IsSelected = true;
costControl.RealPrice = Funs.GetNewDecimal(txtRealPrice.Text.Trim()); //costControl.TotalNum = Funs.GetNewDecimal(txtTotalNum.Text.Trim());
//costControl.RealPrice = Funs.GetNewDecimal(txtRealPrice.Text.Trim());
BLL.CostControlService.AddCostControl(costControl); BLL.CostControlService.AddCostControl(costControl);
//增加对应关系内容 //增加对应关系内容
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new WBS_WbsSetMatchCostControl(); Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new WBS_WbsSetMatchCostControl();
@ -99,8 +100,8 @@ namespace FineUIPro.Web.JDGL.WBS
costControl.CostControlCode = txtCostControlCode.Text.Trim(); costControl.CostControlCode = txtCostControlCode.Text.Trim();
costControl.CostControlName = txtCostControlName.Text.Trim(); costControl.CostControlName = txtCostControlName.Text.Trim();
costControl.Unit = txtUnit.Text.Trim(); costControl.Unit = txtUnit.Text.Trim();
costControl.TotalNum = Funs.GetNewDecimal(txtTotalNum.Text.Trim()); //costControl.TotalNum = Funs.GetNewDecimal(txtTotalNum.Text.Trim());
costControl.RealPrice = Funs.GetNewDecimal(txtRealPrice.Text.Trim()); //costControl.RealPrice = Funs.GetNewDecimal(txtRealPrice.Text.Trim());
BLL.CostControlService.UpdateCostControl(costControl); BLL.CostControlService.UpdateCostControl(costControl);
} }
BLL.LogService.AddSys_Log(this.CurrUser, id, id, BLL.Const.WBSSetMenuId, "修改费用清单项!"); BLL.LogService.AddSys_Log(this.CurrUser, id, id, BLL.Const.WBSSetMenuId, "修改费用清单项!");

View File

@ -66,24 +66,6 @@ namespace FineUIPro.Web.JDGL.WBS {
/// </remarks> /// </remarks>
protected global::FineUIPro.TextBox txtUnit; protected global::FineUIPro.TextBox txtUnit;
/// <summary>
/// txtTotalNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtTotalNum;
/// <summary>
/// txtRealPrice 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox txtRealPrice;
/// <summary> /// <summary>
/// Toolbar1 控件。 /// Toolbar1 控件。
/// </summary> /// </summary>

View File

@ -62,7 +62,7 @@
Title="中间面板" ShowBorder="true" ShowHeader="false" BodyPadding="10px"> Title="中间面板" ShowBorder="true" ShowHeader="false" BodyPadding="10px">
<Items> <Items>
<f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true" ForceFit="true" <f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="CostControlId" AllowSorting="true" EnableColumnLines="true" runat="server" BoxFlex="1" DataKeyNames="CostControlId" AllowSorting="true" EnableColumnLines="true" EnableCheckBoxSelect="true"
SortField="CostControlCode,CostControlName" SortDirection="ASC" AllowCellEditing="true" ClicksToEdit="1" ShowSelectedCell="true" SortField="CostControlCode,CostControlName" SortDirection="ASC" AllowCellEditing="true" ClicksToEdit="1" ShowSelectedCell="true"
DataIDField="CostControlId" AllowPaging="true" IsDatabasePaging="true" PageSize="100" OnPageIndexChange="Grid1_PageIndexChange" DataIDField="CostControlId" AllowPaging="true" IsDatabasePaging="true" PageSize="100" OnPageIndexChange="Grid1_PageIndexChange"
OnRowDataBound="Grid1_RowDataBound" AllowFilters="true" OnFilterChange="Grid1_FilterChange"> OnRowDataBound="Grid1_RowDataBound" AllowFilters="true" OnFilterChange="Grid1_FilterChange">
@ -87,7 +87,7 @@
<f:RenderField Width="70px" ColumnID="Unit" DataField="Unit" FieldType="String" <f:RenderField Width="70px" ColumnID="Unit" DataField="Unit" FieldType="String"
HeaderText="单位" HeaderTextAlign="Center" TextAlign="Left"> HeaderText="单位" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField> </f:RenderField>
<f:RenderField Width="130px" ColumnID="TotalNum" DataField="TotalNum" FieldType="Double" <%--<f:RenderField Width="130px" ColumnID="TotalNum" DataField="TotalNum" FieldType="Double"
HeaderText="合同工作量" HeaderTextAlign="Center" TextAlign="Left"> HeaderText="合同工作量" HeaderTextAlign="Center" TextAlign="Left">
<Editor> <Editor>
<f:NumberBox ID="nbTotalNum" NoDecimal="false" NoNegative="true" MinValue="0" <f:NumberBox ID="nbTotalNum" NoDecimal="false" NoNegative="true" MinValue="0"
@ -110,7 +110,7 @@
runat="server"> runat="server">
</f:NumberBox> </f:NumberBox>
</Editor> </Editor>
</f:RenderField> </f:RenderField>--%>
<f:RenderField Width="70px" ColumnID="CostControlId" DataField="CostControlId" FieldType="String" <f:RenderField Width="70px" ColumnID="CostControlId" DataField="CostControlId" FieldType="String"
HeaderText="主键" HeaderTextAlign="Center" TextAlign="Left" Hidden="true"> HeaderText="主键" HeaderTextAlign="Center" TextAlign="Left" Hidden="true">
</f:RenderField> </f:RenderField>
@ -177,12 +177,6 @@
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Hidden="true" Text="修改" Icon="Pencil" <f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Hidden="true" Text="修改" Icon="Pencil"
OnClick="btnMenuModify_Click"> OnClick="btnMenuModify_Click">
</f:MenuButton> </f:MenuButton>
<f:MenuButton ID="btnMenuDetail" EnablePostBack="true" runat="server" Hidden="true" Text="设置月计划" Icon="ApplicationViewDetail"
OnClick="btnMenuDetail_Click">
</f:MenuButton>
<f:MenuButton ID="btnMenuWeekDetail" EnablePostBack="true" runat="server" Hidden="true" Text="设置周计划" Icon="ApplicationEdit"
OnClick="btnMenuWeekDetail_Click">
</f:MenuButton>
<f:MenuButton ID="btnMenuDel" EnablePostBack="true" runat="server" Hidden="true" Icon="Delete" Text="删除" ConfirmText="确定删除当前数据?" <f:MenuButton ID="btnMenuDel" EnablePostBack="true" runat="server" Hidden="true" Icon="Delete" Text="删除" ConfirmText="确定删除当前数据?"
OnClick="btnMenuDel_Click"> OnClick="btnMenuDel_Click">
</f:MenuButton> </f:MenuButton>
@ -235,32 +229,6 @@
} }
} }
function onGridAfterEdit(event, value, params) {
var me = this, columnId = params.columnId, rowId = params.rowId;
if (columnId === 'StartDate') {
me.updateCellValue(rowId, 'ChangeId', rowId);
me.updateCellValue(rowId, 'ChangeColumn', 'StartDate');
}
if (columnId === 'EndDate') {
me.updateCellValue(rowId, 'ChangeId', rowId);
me.updateCellValue(rowId, 'ChangeColumn', 'EndDate');
}
if (columnId === 'ControlPoint') {
me.updateCellValue(rowId, 'ChangeId', rowId);
me.updateCellValue(rowId, 'ChangeColumn', 'ControlPoint');
}
if (columnId === 'Cycle') {
me.updateCellValue(rowId, 'ChangeId', rowId);
me.updateCellValue(rowId, 'ChangeColumn', 'Cycle');
}
if (columnId === 'Frequency') {
me.updateCellValue(rowId, 'ChangeId', rowId);
me.updateCellValue(rowId, 'ChangeColumn', 'Frequency');
}
// updateDate();
show();
}
function updateDate() { function updateDate() {
// 回发到后台更新 // 回发到后台更新
__doPostBack('', 'UPDATE_Date'); __doPostBack('', 'UPDATE_Date');

View File

@ -56,7 +56,7 @@ namespace FineUIPro.Web.JDGL.WBS
// } // }
//} //}
Model.Project_Installation installation = BLL.Project_InstallationService.GetProjectInstallationByProjectId(this.CurrUser.LoginProjectId); Model.Project_Installation installation = BLL.Project_InstallationService.GetProjectInstallationByProjectId(this.CurrUser.LoginProjectId);
if(installation!=null) if (installation != null)
{ {
TreeNode newNode = new TreeNode(); TreeNode newNode = new TreeNode();
newNode.Text = "[" + installation.InstallationCode + "]" + installation.InstallationName; newNode.Text = "[" + installation.InstallationCode + "]" + installation.InstallationName;
@ -1394,44 +1394,31 @@ namespace FineUIPro.Web.JDGL.WBS
bool isPass = true; bool isPass = true;
if (isPass) if (isPass)
{ {
foreach (var item in this.Grid1.SelectedRowIDArray)
{
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(item);
}
foreach (JObject mergedRow in mergedData) foreach (JObject mergedRow in mergedData)
{ {
JObject values = mergedRow.Value<JObject>("values"); JObject values = mergedRow.Value<JObject>("values");
string costControlId = values.Value<string>("CostControlId"); string costControlId = values.Value<string>("CostControlId");
string totalNum = values.Value<string>("TotalNum"); //string totalNum = values.Value<string>("TotalNum");
string realPrice = values.Value<string>("RealPrice"); //string realPrice = values.Value<string>("RealPrice");
string planPrice = values.Value<string>("PlanPrice"); //string planPrice = values.Value<string>("PlanPrice");
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlId); Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlId);
if (costControl != null) if (this.Grid1.SelectedRowIDArray.Contains(costControlId))
{ {
if (!string.IsNullOrEmpty(totalNum)) costControl.IsSelected = true;
{
costControl.TotalNum = Convert.ToDecimal(totalNum);
} }
else else
{ {
costControl.TotalNum = null; costControl.IsSelected = false;
}
if (!string.IsNullOrEmpty(realPrice))
{
costControl.RealPrice = Convert.ToDecimal(realPrice);
}
else
{
costControl.RealPrice = null;
}
if (!string.IsNullOrEmpty(planPrice))
{
costControl.PlanPrice = Convert.ToDecimal(planPrice);
}
else
{
costControl.RealPrice = null;
} }
BLL.CostControlService.UpdateCostControl(costControl); BLL.CostControlService.UpdateCostControl(costControl);
} }
} }
}
BindGrid(); BindGrid();
} }
Alert.ShowInTop("保存成功!", MessageBoxIcon.Success); Alert.ShowInTop("保存成功!", MessageBoxIcon.Success);
@ -1513,6 +1500,12 @@ namespace FineUIPro.Web.JDGL.WBS
Grid1.DataSource = table; Grid1.DataSource = table;
Grid1.DataBind(); Grid1.DataBind();
var costControls = BLL.CostControlService.GetSelectedCostControlsByWbsSetId(this.trWBS.SelectedNodeID);
if (costControls.Count > 0)
{
var selectIds = costControls.Select(x => x.CostControlId).ToArray();
this.Grid1.SelectedRowIDArray = selectIds;
}
} }
else else
{ {
@ -2402,8 +2395,8 @@ namespace FineUIPro.Web.JDGL.WBS
this.btnMenuAdd.Hidden = false; this.btnMenuAdd.Hidden = false;
this.btnAdd.Hidden = false; this.btnAdd.Hidden = false;
this.btnMenuCopy.Hidden = false; this.btnMenuCopy.Hidden = false;
this.btnMenuDetail.Hidden = false; //this.btnMenuDetail.Hidden = false;
this.btnMenuWeekDetail.Hidden = false; //this.btnMenuWeekDetail.Hidden = false;
//this.btnMenuCopy2.Hidden = false; //this.btnMenuCopy2.Hidden = false;
} }
if (buttonList.Contains(BLL.Const.BtnModify)) if (buttonList.Contains(BLL.Const.BtnModify))

View File

@ -111,33 +111,6 @@ namespace FineUIPro.Web.JDGL.WBS {
/// </remarks> /// </remarks>
protected global::FineUIPro.Button btnSave; protected global::FineUIPro.Button btnSave;
/// <summary>
/// nbTotalNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox nbTotalNum;
/// <summary>
/// nbRealPrice 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox nbRealPrice;
/// <summary>
/// nbPlanPrice 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox nbPlanPrice;
/// <summary> /// <summary>
/// ToolbarSeparator1 控件。 /// ToolbarSeparator1 控件。
/// </summary> /// </summary>
@ -264,24 +237,6 @@ namespace FineUIPro.Web.JDGL.WBS {
/// </remarks> /// </remarks>
protected global::FineUIPro.MenuButton btnMenuModify; protected global::FineUIPro.MenuButton btnMenuModify;
/// <summary>
/// btnMenuDetail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDetail;
/// <summary>
/// btnMenuWeekDetail 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuWeekDetail;
/// <summary> /// <summary>
/// btnMenuDel 控件。 /// btnMenuDel 控件。
/// </summary> /// </summary>

View File

@ -50,6 +50,9 @@
<f:Tree ID="trWBS" Width="290" EnableCollapse="true" ShowHeader="true" OnNodeCommand="trWBS_NodeCommand" <f:Tree ID="trWBS" Width="290" EnableCollapse="true" ShowHeader="true" OnNodeCommand="trWBS_NodeCommand"
OnNodeExpand="trWBS_NodeExpand" OnNodeExpand="trWBS_NodeExpand"
AutoLeafIdentification="true" runat="server"> AutoLeafIdentification="true" runat="server">
<Listeners>
<f:Listener Event="beforenodecontextmenu" Handler="onTreeNodeContextMenu" />
</Listeners>
</f:Tree> </f:Tree>
<f:HiddenField runat="server" ID="hdSelectId"> <f:HiddenField runat="server" ID="hdSelectId">
</f:HiddenField> </f:HiddenField>
@ -69,10 +72,10 @@
<f:DatePicker runat="server" ID="txtMonths" DateFormatString="yyyy-MM" AutoPostBack="true" <f:DatePicker runat="server" ID="txtMonths" DateFormatString="yyyy-MM" AutoPostBack="true"
Label="月份" LabelWidth="50px" Width="150px" OnTextChanged="txtMonths_TextChanged"> Label="月份" LabelWidth="50px" Width="150px" OnTextChanged="txtMonths_TextChanged">
</f:DatePicker> </f:DatePicker>
<f:DropDownList ID="drpWeek" runat="server" Label="周" LabelAlign="right" AutoPostBack="true" OnSelectedIndexChanged="drpWeek_SelectedIndexChanged"></f:DropDownList> <%--<f:DropDownList ID="drpWeek" runat="server" Label="周" LabelAlign="right" AutoPostBack="true" OnSelectedIndexChanged="drpWeek_SelectedIndexChanged"></f:DropDownList>--%>
<f:ToolbarFill runat="server"></f:ToolbarFill> <f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" Hidden="true" OnClick="btnSave_Click"> <%--<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" Hidden="true" OnClick="btnSave_Click">
</f:Button> </f:Button>--%>
</Items> </Items>
</f:Toolbar> </f:Toolbar>
</Toolbars> </Toolbars>
@ -100,11 +103,6 @@
</f:RenderField> </f:RenderField>
<f:RenderField Width="130px" ColumnID="ThisNum" DataField="ThisNum" FieldType="Double" <f:RenderField Width="130px" ColumnID="ThisNum" DataField="ThisNum" FieldType="Double"
HeaderText="本月实际完成量" HeaderTextAlign="Center" TextAlign="Left"> HeaderText="本月实际完成量" HeaderTextAlign="Center" TextAlign="Left">
<Editor>
<f:NumberBox ID="nbThisNum" NoDecimal="false" NoNegative="true" MinValue="0"
runat="server">
</f:NumberBox>
</Editor>
</f:RenderField> </f:RenderField>
<f:RenderField Width="70px" ColumnID="CostControlDetailId" DataField="CostControlDetailId" FieldType="String" <f:RenderField Width="70px" ColumnID="CostControlDetailId" DataField="CostControlDetailId" FieldType="String"
HeaderText="主键" HeaderTextAlign="Center" TextAlign="Left" Hidden="true"> HeaderText="主键" HeaderTextAlign="Center" TextAlign="Left" Hidden="true">
@ -131,8 +129,30 @@
</f:Panel> </f:Panel>
</Items> </Items>
</f:Panel> </f:Panel>
<f:Window ID="Window1" Title="编辑" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Self" EnableResize="true" runat="server" OnClose="Window1_Close" IsModal="true"
Width="1400px" Height="650px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true" Icon="Pencil"
runat="server" Text="录入" Hidden="true">
</f:MenuButton>
</f:Menu>
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
var treeID = '<%= trWBS.ClientID %>';
var menuID = '<%= Menu1.ClientID %>';
// 保存当前菜单对应的树节点ID
var currentNodeId;
// 返回false来阻止浏览器右键菜单
function onTreeNodeContextMenu(event, nodeId) {
currentNodeId = nodeId;
F(menuID).show();
return false;
}
function onGridAfterEdit(event, value, params) { function onGridAfterEdit(event, value, params) {
var me = this, columnId = params.columnId, rowId = params.rowId; var me = this, columnId = params.columnId, rowId = params.rowId;
if (columnId === 'StartDate') { if (columnId === 'StartDate') {

View File

@ -24,7 +24,7 @@ namespace FineUIPro.Web.JDGL.WBS
GetButtonPower(); GetButtonPower();
InitTreeMenu(); InitTreeMenu();
this.txtMonths.Text = string.Format("{0:yyyy-MM}", DateTime.Now); this.txtMonths.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
Funs.FineUIPleaseSelect(this.drpWeek); //Funs.FineUIPleaseSelect(this.drpWeek);
} }
} }
@ -316,6 +316,51 @@ namespace FineUIPro.Web.JDGL.WBS
} }
#endregion #endregion
#region
/// <summary>
/// 关闭窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
ShowNotify("录入成功!", MessageBoxIcon.Success);
}
#endregion
/// <summary>
/// 右键录入事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
if (this.trWBS.SelectedNode != null)
{
if (this.trWBS.SelectedNode.CommandName != "project" && this.trWBS.SelectedNode.CommandName != "installation" && this.trWBS.SelectedNode.CommandName != "cnProfession") //非项目、装置、专业节点可以修改
{
this.hdSelectId.Text = this.trWBS.SelectedNode.NodeID;
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WorkloadInputEdit.aspx?Id={0}", this.trWBS.SelectedNode.NodeID, "编辑 - ")));
}
else
{
if (this.trWBS.SelectedNode.Text == "总图")
{
this.hdSelectId.Text = this.trWBS.SelectedNode.NodeID;
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WBSSetAuditEdit.aspx?Id={0}&Type={1}&oper=modify", this.trWBS.SelectedNode.NodeID, this.trWBS.SelectedNode.CommandName, "编辑 - ")));
}
else
{
ShowNotify("项目、装置、专业节点无法修改!", MessageBoxIcon.Warning);
}
}
}
else
{
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
}
}
#region #region
/// <summary> /// <summary>
/// 保存 /// 保存
@ -336,8 +381,8 @@ namespace FineUIPro.Web.JDGL.WBS
oldThisPlanValue = 0, oldThisRealCost = 0, oldThisPlanCost = 0, oldThisPlanValue = 0, oldThisRealCost = 0, oldThisPlanCost = 0,
thisPlanValue = 0, thisRealCost = 0, thisPlanCost = 0; thisPlanValue = 0, thisRealCost = 0, thisPlanCost = 0;
JArray mergedData = Grid1.GetMergedData(); JArray mergedData = Grid1.GetMergedData();
if (this.drpWeek.SelectedValue == BLL.Const._Null) //保存月记录 //if (this.drpWeek.SelectedValue == BLL.Const._Null) //保存月记录
{ //{
foreach (JObject mergedRow in mergedData) foreach (JObject mergedRow in mergedData)
{ {
oldThisPlanValue = 0; oldThisPlanValue = 0;
@ -443,124 +488,124 @@ namespace FineUIPro.Web.JDGL.WBS
} }
//更新装置 //更新装置
UpdateInstallationDetail(wbsSet.InstallationId, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost); UpdateInstallationDetail(wbsSet.InstallationId, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
} //}
else //保存周记录 //else //保存周记录
{ //{
string[] strs = this.drpWeek.SelectedValue.Split(','); // string[] strs = this.drpWeek.SelectedValue.Split(',');
DateTime startDate = Convert.ToDateTime(strs[0]); // DateTime startDate = Convert.ToDateTime(strs[0]);
DateTime endDate = Convert.ToDateTime(strs[1]); // DateTime endDate = Convert.ToDateTime(strs[1]);
foreach (JObject mergedRow in mergedData) // foreach (JObject mergedRow in mergedData)
{ // {
oldThisPlanValue = 0; // oldThisPlanValue = 0;
oldThisRealCost = 0; // oldThisRealCost = 0;
oldThisPlanCost = 0; // oldThisPlanCost = 0;
JObject values = mergedRow.Value<JObject>("values"); // JObject values = mergedRow.Value<JObject>("values");
string costControlDetailId = values.Value<string>("CostControlDetailId"); // string costControlDetailId = values.Value<string>("CostControlDetailId");
string costControlId = values.Value<string>("CostControlId"); // string costControlId = values.Value<string>("CostControlId");
string thisNum = values.Value<string>("ThisNum"); // string thisNum = values.Value<string>("ThisNum");
string planPrice = values.Value<string>("PlanPrice"); // string planPrice = values.Value<string>("PlanPrice");
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(costControlDetailId); // Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(costControlDetailId);
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlId); // Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlId);
if (costControlDetail != null) // if (costControlDetail != null)
{ // {
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0); // oldThisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0); // oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
if (!string.IsNullOrEmpty(thisNum)) // if (!string.IsNullOrEmpty(thisNum))
{ // {
costControlDetail.ThisNum = Convert.ToDecimal(thisNum); // costControlDetail.ThisNum = Convert.ToDecimal(thisNum);
} // }
thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0); // thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0); // thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0); // thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
BLL.CostControlDetailService.UpdateCostControlDetail(costControlDetail); // BLL.CostControlDetailService.UpdateCostControlDetail(costControlDetail);
} // }
else // else
{ // {
costControlDetail = new Model.WBS_CostControlDetail(); // costControlDetail = new Model.WBS_CostControlDetail();
costControlDetail.CostControlDetailId = costControlDetailId; // costControlDetail.CostControlDetailId = costControlDetailId;
costControlDetail.CostControlId = costControlId; // costControlDetail.CostControlId = costControlId;
costControlDetail.Months = months; // costControlDetail.Months = months;
costControlDetail.StartDate = startDate; // costControlDetail.StartDate = startDate;
costControlDetail.EndDate = endDate; // costControlDetail.EndDate = endDate;
if (!string.IsNullOrEmpty(thisNum)) // if (!string.IsNullOrEmpty(thisNum))
{ // {
costControlDetail.ThisNum = Convert.ToDecimal(thisNum); // costControlDetail.ThisNum = Convert.ToDecimal(thisNum);
} // }
thisPlanValue = 0; // thisPlanValue = 0;
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0); // thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0); // thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
BLL.CostControlDetailService.AddCostControlDetail(costControlDetail); // BLL.CostControlDetailService.AddCostControlDetail(costControlDetail);
} // }
//累加变化值,计算总的变化值 // //累加变化值,计算总的变化值
changeThisRealCost += thisRealCost - oldThisRealCost; // changeThisRealCost += thisRealCost - oldThisRealCost;
changeThisPlanCost += thisPlanCost - oldThisPlanCost; // changeThisPlanCost += thisPlanCost - oldThisPlanCost;
} // }
//累计所有子节点的计划值 // //累计所有子节点的计划值
var costControls = BLL.CostControlService.GetCostControlsByWbsSetId(this.trWBS.SelectedNodeID); // var costControls = BLL.CostControlService.GetCostControlsByWbsSetId(this.trWBS.SelectedNodeID);
foreach (var item in costControls) // foreach (var item in costControls)
{ // {
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonthsWeek(item.CostControlId, months, startDate); // Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonthsWeek(item.CostControlId, months, startDate);
if (costControlDetail != null) // if (costControlDetail != null)
{ // {
changeThisPlanValue += (costControlDetail.PlanNum ?? 0) * (item.PlanPrice ?? 0); // changeThisPlanValue += (costControlDetail.PlanNum ?? 0) * (item.PlanPrice ?? 0);
} // }
} // }
Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonthsWeek(this.trWBS.SelectedNodeID, months, startDate); // Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonthsWeek(this.trWBS.SelectedNodeID, months, startDate);
if (parentDetail != null) //如果工作项节点存在,则计算计划值差异值 // if (parentDetail != null) //如果工作项节点存在,则计算计划值差异值
{ // {
changeThisPlanValue = changeThisPlanValue - (parentDetail.ThisPlanValue ?? 0); // changeThisPlanValue = changeThisPlanValue - (parentDetail.ThisPlanValue ?? 0);
} // }
//更新树节点 // //更新树节点
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(this.trWBS.SelectedNodeID); // Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(this.trWBS.SelectedNodeID);
//更新工作包、工作项 // //更新工作包、工作项
UpdateWeekWbsSetDetail(this.trWBS.SelectedNodeID, months, startDate, endDate, changeThisPlanValue, changeThisRealCost, changeThisPlanCost); // UpdateWeekWbsSetDetail(this.trWBS.SelectedNodeID, months, startDate, endDate, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
//更新分部 // //更新分部
Model.WBS_CostControlParentDetail unitProjectDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonthsWeek(wbsSet.UnitProjectId, months, startDate); // Model.WBS_CostControlParentDetail unitProjectDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonthsWeek(wbsSet.UnitProjectId, months, startDate);
if (unitProjectDetail != null) // if (unitProjectDetail != null)
{ // {
unitProjectDetail.ThisPlanValue += changeThisPlanValue; // unitProjectDetail.ThisPlanValue += changeThisPlanValue;
unitProjectDetail.ThisRealCost += changeThisRealCost; // unitProjectDetail.ThisRealCost += changeThisRealCost;
unitProjectDetail.ThisPlanCost += changeThisPlanCost; // unitProjectDetail.ThisPlanCost += changeThisPlanCost;
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(unitProjectDetail); // BLL.CostControlParentDetailService.UpdateCostControlParentDetail(unitProjectDetail);
} // }
else // else
{ // {
unitProjectDetail = new Model.WBS_CostControlParentDetail(); // unitProjectDetail = new Model.WBS_CostControlParentDetail();
unitProjectDetail.CostControlParentDetailId = SQLHelper.GetNewID(); // unitProjectDetail.CostControlParentDetailId = SQLHelper.GetNewID();
unitProjectDetail.ParentId = wbsSet.UnitProjectId; // unitProjectDetail.ParentId = wbsSet.UnitProjectId;
unitProjectDetail.Months = months; // unitProjectDetail.Months = months;
unitProjectDetail.StartDate = startDate; // unitProjectDetail.StartDate = startDate;
unitProjectDetail.EndDate = endDate; // unitProjectDetail.EndDate = endDate;
unitProjectDetail.ThisPlanValue = changeThisPlanValue; // unitProjectDetail.ThisPlanValue = changeThisPlanValue;
unitProjectDetail.ThisRealCost = changeThisRealCost; // unitProjectDetail.ThisRealCost = changeThisRealCost;
unitProjectDetail.ThisPlanCost = changeThisPlanCost; // unitProjectDetail.ThisPlanCost = changeThisPlanCost;
BLL.CostControlParentDetailService.AddCostControlParentDetail(unitProjectDetail); // BLL.CostControlParentDetailService.AddCostControlParentDetail(unitProjectDetail);
} // }
//更新专业 // //更新专业
Model.WBS_CostControlParentDetail cnProfessionDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonthsWeek(wbsSet.CnProfessionId, months, startDate); // Model.WBS_CostControlParentDetail cnProfessionDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonthsWeek(wbsSet.CnProfessionId, months, startDate);
if (cnProfessionDetail != null) // if (cnProfessionDetail != null)
{ // {
cnProfessionDetail.ThisPlanValue += changeThisPlanValue; // cnProfessionDetail.ThisPlanValue += changeThisPlanValue;
cnProfessionDetail.ThisRealCost += changeThisRealCost; // cnProfessionDetail.ThisRealCost += changeThisRealCost;
cnProfessionDetail.ThisPlanCost += changeThisPlanCost; // cnProfessionDetail.ThisPlanCost += changeThisPlanCost;
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(cnProfessionDetail); // BLL.CostControlParentDetailService.UpdateCostControlParentDetail(cnProfessionDetail);
} // }
else // else
{ // {
cnProfessionDetail = new Model.WBS_CostControlParentDetail(); // cnProfessionDetail = new Model.WBS_CostControlParentDetail();
cnProfessionDetail.CostControlParentDetailId = SQLHelper.GetNewID(); // cnProfessionDetail.CostControlParentDetailId = SQLHelper.GetNewID();
cnProfessionDetail.ParentId = wbsSet.CnProfessionId; // cnProfessionDetail.ParentId = wbsSet.CnProfessionId;
cnProfessionDetail.Months = months; // cnProfessionDetail.Months = months;
cnProfessionDetail.StartDate = startDate; // cnProfessionDetail.StartDate = startDate;
cnProfessionDetail.EndDate = endDate; // cnProfessionDetail.EndDate = endDate;
cnProfessionDetail.ThisPlanValue = changeThisPlanValue; // cnProfessionDetail.ThisPlanValue = changeThisPlanValue;
cnProfessionDetail.ThisRealCost = changeThisRealCost; // cnProfessionDetail.ThisRealCost = changeThisRealCost;
cnProfessionDetail.ThisPlanCost = changeThisPlanCost; // cnProfessionDetail.ThisPlanCost = changeThisPlanCost;
BLL.CostControlParentDetailService.AddCostControlParentDetail(cnProfessionDetail); // BLL.CostControlParentDetailService.AddCostControlParentDetail(cnProfessionDetail);
} // }
//更新装置 // //更新装置
UpdateWeekInstallationDetail(wbsSet.InstallationId, months, startDate, endDate, changeThisPlanValue, changeThisRealCost, changeThisPlanCost); // UpdateWeekInstallationDetail(wbsSet.InstallationId, months, startDate, endDate, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
} //}
//BindGrid(); //BindGrid();
Alert.ShowInTop("保存成功!", MessageBoxIcon.Success); Alert.ShowInTop("保存成功!", MessageBoxIcon.Success);
} }
@ -798,17 +843,15 @@ namespace FineUIPro.Web.JDGL.WBS
// codes.Add(item.CostControlCode); // codes.Add(item.CostControlCode);
//} //}
//var list = BLL.CostControlService.GetCostControlsByCostControlCodes(codes, this.trWBS.SelectedNodeID); //var list = BLL.CostControlService.GetCostControlsByCostControlCodes(codes, this.trWBS.SelectedNodeID);
var list = BLL.CostControlService.GetCostControlsByWbsSetId(this.trWBS.SelectedNodeID); var list = BLL.CostControlService.GetSelectedCostControlsByWbsSetId(this.trWBS.SelectedNodeID);
if (list.Count > 0) if (list.Count > 0)
{ {
List<Model.View_WBS_CostControlDetail> details = new List<Model.View_WBS_CostControlDetail>(); List<Model.View_WBS_CostControlDetail> details = new List<Model.View_WBS_CostControlDetail>();
if (this.drpWeek.SelectedValue == BLL.Const._Null) //月份记录 //if (this.drpWeek.SelectedValue == BLL.Const._Null) //月份记录
{ //{
this.Grid1.Columns[4].HeaderText = "本月计划完成量"; this.Grid1.Columns[4].HeaderText = "本月计划完成量";
this.Grid1.Columns[7].HeaderText = "本月完成量"; this.Grid1.Columns[7].HeaderText = "本月完成量";
foreach (var item in list) foreach (var item in list)
{
if (item.TotalNum != null)
{ {
Model.View_WBS_CostControlDetail detail = BLL.CostControlDetailService.GetViewCostControlDetailByCostControlIdAndMonth(item.CostControlId, months); Model.View_WBS_CostControlDetail detail = BLL.CostControlDetailService.GetViewCostControlDetailByCostControlIdAndMonth(item.CostControlId, months);
if (detail == null) if (detail == null)
@ -830,55 +873,54 @@ namespace FineUIPro.Web.JDGL.WBS
} }
details.Add(detail); details.Add(detail);
} }
} //}
} //else //周记录
else //周记录 //{
{ // this.Grid1.Columns[4].HeaderText = "本周计划完成量";
this.Grid1.Columns[4].HeaderText = "本周计划完成量"; // this.Grid1.Columns[7].HeaderText = "本周完成量";
this.Grid1.Columns[7].HeaderText = "本周完成量"; // foreach (var item in list)
foreach (var item in list) // {
{ // if (item.TotalNum != null)
if (item.TotalNum != null) // {
{ // DateTime startDate = Convert.ToDateTime(this.drpWeek.SelectedValue.Split(',')[0]);
DateTime startDate = Convert.ToDateTime(this.drpWeek.SelectedValue.Split(',')[0]); // Model.View_WBS_CostControlDetail detail = BLL.CostControlDetailService.GetViewCostControlDetailByCostControlIdAndMonthWeek(item.CostControlId, months, startDate);
Model.View_WBS_CostControlDetail detail = BLL.CostControlDetailService.GetViewCostControlDetailByCostControlIdAndMonthWeek(item.CostControlId, months, startDate); // if (detail == null)
if (detail == null) // {
{ // detail = new Model.View_WBS_CostControlDetail();
detail = new Model.View_WBS_CostControlDetail(); // detail.CostControlDetailId = SQLHelper.GetNewID();
detail.CostControlDetailId = SQLHelper.GetNewID(); // detail.CostControlId = item.CostControlId;
detail.CostControlId = item.CostControlId; // detail.CostControlCode = item.CostControlCode;
detail.CostControlCode = item.CostControlCode; // detail.CostControlName = item.CostControlName;
detail.CostControlName = item.CostControlName; // detail.TotalNum = item.TotalNum;
detail.TotalNum = item.TotalNum; // detail.Unit = item.Unit;
detail.Unit = item.Unit; // detail.PlanNum = null;
detail.PlanNum = null; // detail.RealPrice = item.RealPrice;
detail.RealPrice = item.RealPrice; // detail.PlanPrice = item.PlanPrice;
detail.PlanPrice = item.PlanPrice; // }
} // else
else // {
{ // Model.WBS_CostControlDetail oldDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(detail.CostControlDetailId);
Model.WBS_CostControlDetail oldDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(detail.CostControlDetailId); // if (oldDetail.PlanNum != null)
if (oldDetail.PlanNum != null) // {
{ // detail.PlanNum = Convert.ToDouble(oldDetail.PlanNum);
detail.PlanNum = Convert.ToDouble(oldDetail.PlanNum); // }
} // else
else // {
{ // detail.PlanNum = null;
detail.PlanNum = null; // }
} // if (oldDetail.ThisNum != null)
if (oldDetail.ThisNum != null) // {
{ // detail.ThisNum = Convert.ToDouble(oldDetail.ThisNum);
detail.ThisNum = Convert.ToDouble(oldDetail.ThisNum); // }
} // else
else // {
{ // detail.ThisNum = null;
detail.ThisNum = null; // }
} // }
} // details.Add(detail);
details.Add(detail); // }
} // }
} //}
}
Grid1.DataSource = details; Grid1.DataSource = details;
Grid1.DataBind(); Grid1.DataBind();
} }
@ -908,7 +950,7 @@ namespace FineUIPro.Web.JDGL.WBS
{ {
if (buttonList.Contains(BLL.Const.BtnSave)) if (buttonList.Contains(BLL.Const.BtnSave))
{ {
this.btnSave.Hidden = false; this.btnMenuEdit.Hidden = false;
} }
} }
} }
@ -930,8 +972,8 @@ namespace FineUIPro.Web.JDGL.WBS
{ {
if (BLL.CostControlDetailService.IsExitWeekCostControlDetailByCostControlIdAndMonth(item.CostControlId, months)) if (BLL.CostControlDetailService.IsExitWeekCostControlDetailByCostControlIdAndMonth(item.CostControlId, months))
{ {
BLL.CostControlDetailService.InitWeekPlanList(this.drpWeek, item.CostControlId, months, true); //BLL.CostControlDetailService.InitWeekPlanList(this.drpWeek, item.CostControlId, months, true);
this.drpWeek.SelectedValue = BLL.Const._Null; //this.drpWeek.SelectedValue = BLL.Const._Null;
break; break;
} }
} }
@ -950,7 +992,7 @@ namespace FineUIPro.Web.JDGL.WBS
protected void txtMonths_TextChanged(object sender, EventArgs e) protected void txtMonths_TextChanged(object sender, EventArgs e)
{ {
BindGrid(); BindGrid();
InitWeek(); //InitWeek();
} }
#endregion #endregion

View File

@ -102,33 +102,6 @@ namespace FineUIPro.Web.JDGL.WBS {
/// </remarks> /// </remarks>
protected global::FineUIPro.DatePicker txtMonths; protected global::FineUIPro.DatePicker txtMonths;
/// <summary>
/// drpWeek 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpWeek;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// nbThisNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox nbThisNum;
/// <summary> /// <summary>
/// ToolbarSeparator1 控件。 /// ToolbarSeparator1 控件。
/// </summary> /// </summary>
@ -155,5 +128,32 @@ namespace FineUIPro.Web.JDGL.WBS {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks> /// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize; protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
} }
} }

View File

@ -0,0 +1,89 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkloadInputEdit.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.WorkloadInputEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
<style type="text/css">
.f-grid-row.noEdit{
pointer-events:none;
}
</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" EnableAjax="false" ShowHeader="false" Title="费控项" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" AllowColumnLocking="true"
ClicksToEdit="1" DataIDField="Id" AllowSorting="true" SortField="Id"
SortDirection="ASC" EnableColumnLines="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="1000"
AllowFilters="true" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:Label ID="txtCostControlName" runat="server" Width="220px" LabelWidth="50px"
LabelAlign="Right">
</f:Label>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp" Hidden="true"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="true">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="150px" ColumnID="Name1" DataField="Name1" FieldType="String" EnableLock="true" Locked="true"
HeaderText="分部" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="Name2" DataField="Name2" FieldType="String" EnableLock="true" Locked="true"
HeaderText="分项" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="Name3" DataField="Name3" FieldType="String" EnableLock="true" Locked="true"
HeaderText="费控项内容" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<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>

View File

@ -0,0 +1,612 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
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 WorkloadInputEdit : PageBase
{
/// <summary>
/// 控制项主键
/// </summary>
public string Id
{
get
{
return (string)ViewState["Id"];
}
set
{
ViewState["Id"] = value;
}
}
/// <summary>
/// 加载表头
/// </summary>
protected void Page_Init(object sender, EventArgs e)
{
InitGrid();
}
#region
/// <summary>
/// 表头
/// </summary>
private void InitGrid()
{
this.Id = Request.Params["Id"];
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(Id);
DateTime startDate, endDate, startMonth, endMonth;
List<DateTime> months = new List<DateTime>();
if (wbsSet != null && wbsSet.StartDate != null && wbsSet.EndDate != null)
{
startDate = Convert.ToDateTime(wbsSet.StartDate);
endDate = Convert.ToDateTime(wbsSet.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++)
{
GroupField gd = new GroupField();
gd.HeaderText = string.Format("{0:yyyy-MM}", months[i]);
gd.HeaderTextAlign = TextAlign.Center;
RenderField rdPlan = new RenderField();
rdPlan.ColumnID = gd.HeaderText + "Plan";
rdPlan.Width = Unit.Pixel(100);
rdPlan.DataField = "PlanNum" + (i + 1).ToString();
rdPlan.FieldType = FieldType.Double;
rdPlan.HeaderText = "计划量";
rdPlan.HeaderTextAlign = TextAlign.Center;
NumberBox numPlan = new NumberBox();
numPlan.NoNegative = true;
numPlan.NoDecimal = false;
rdPlan.Editor.Add(numPlan);
gd.Columns.Add(rdPlan);
RenderField rdThis = new RenderField();
rdThis.ColumnID = gd.HeaderText + "This";
rdThis.Width = Unit.Pixel(100);
rdThis.DataField = "ThisNum" + (i + 1).ToString();
rdThis.FieldType = FieldType.Double;
rdThis.HeaderText = "完成量";
rdThis.HeaderTextAlign = TextAlign.Center;
NumberBox numReal = new NumberBox();
numReal.NoNegative = true;
numReal.NoDecimal = false;
rdThis.Editor.Add(numReal);
gd.Columns.Add(rdThis);
Grid1.Columns.Add(gd);
}
}
#endregion
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.Id = Request.Params["Id"];
List<Model.CostControlDetailItem> itemList = new List<Model.CostControlDetailItem>();
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(Id);
DateTime startDate, endDate, startMonth, endMonth;
List<DateTime> months = new List<DateTime>();
List<string> notEditIds = new List<string>();
notEditIds.Add(this.Id);
if (wbsSet != null && wbsSet.StartDate != null && wbsSet.EndDate != null)
{
startDate = Convert.ToDateTime(wbsSet.StartDate);
endDate = Convert.ToDateTime(wbsSet.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);
}
Model.CostControlDetailItem item1 = new Model.CostControlDetailItem();
item1.Id = Id;
item1.Name1 = wbsSet.WbsSetName;
itemList.Add(item1);
var childWbsSets = BLL.WbsSetService.GetApproveWbsSetsBySuperWbsSetId(Id);
foreach (var childWbsSet in childWbsSets)
{
notEditIds.Add(childWbsSet.WbsSetId);
Model.CostControlDetailItem item2 = new Model.CostControlDetailItem();
item2.Id = childWbsSet.WbsSetId;
item2.Name2 = childWbsSet.WbsSetName;
itemList.Add(item2);
var costControls = BLL.CostControlService.GetSelectedCostControlsByWbsSetId(childWbsSet.WbsSetId);
foreach (var costControl in costControls)
{
Model.CostControlDetailItem item3 = new Model.CostControlDetailItem();
item3.Id = costControl.CostControlId;
item3.Name3 = costControl.CostControlName;
item3.TotalNum = costControl.TotalNum;
item3.PlanPrice = costControl.PlanPrice;
item3.RealPrice = costControl.RealPrice;
for (int j = 0; j < months.Count; j++)
{
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(costControl.CostControlId, months[j]);
if (costControlDetail != null)
{
if (j == 0)
{
item3.PlanNum1 = costControlDetail.PlanNum;
item3.ThisNum1 = costControlDetail.ThisNum;
}
else if (j == 1)
{
item3.PlanNum2 = costControlDetail.PlanNum;
item3.ThisNum2 = costControlDetail.ThisNum;
}
else if (j == 2)
{
item3.PlanNum3 = costControlDetail.PlanNum;
item3.ThisNum3 = costControlDetail.ThisNum;
}
else if (j == 3)
{
item3.PlanNum4 = costControlDetail.PlanNum;
item3.ThisNum4 = costControlDetail.ThisNum;
}
else if (j == 4)
{
item3.PlanNum5 = costControlDetail.PlanNum;
item3.ThisNum5 = costControlDetail.ThisNum;
}
else if (j == 5)
{
item3.PlanNum6 = costControlDetail.PlanNum;
item3.ThisNum6 = costControlDetail.ThisNum;
}
else if (j == 6)
{
item3.PlanNum7 = costControlDetail.PlanNum;
item3.ThisNum7 = costControlDetail.ThisNum;
}
else if (j == 7)
{
item3.PlanNum8 = costControlDetail.PlanNum;
item3.ThisNum8 = costControlDetail.ThisNum;
}
else if (j == 8)
{
item3.PlanNum9 = costControlDetail.PlanNum;
item3.ThisNum9 = costControlDetail.ThisNum;
}
else if (j == 9)
{
item3.PlanNum10 = costControlDetail.PlanNum;
item3.ThisNum10 = costControlDetail.ThisNum;
}
else if (j == 10)
{
item3.PlanNum11 = costControlDetail.PlanNum;
item3.ThisNum11 = costControlDetail.ThisNum;
}
else if (j == 11)
{
item3.PlanNum12 = costControlDetail.PlanNum;
item3.ThisNum12 = costControlDetail.ThisNum;
}
else if (j == 12)
{
item3.PlanNum13 = costControlDetail.PlanNum;
item3.ThisNum13 = costControlDetail.ThisNum;
}
else if (j == 13)
{
item3.PlanNum14 = costControlDetail.PlanNum;
item3.ThisNum14 = costControlDetail.ThisNum;
}
else if (j == 14)
{
item3.PlanNum15 = costControlDetail.PlanNum;
item3.ThisNum15 = costControlDetail.ThisNum;
}
else if (j == 15)
{
item3.PlanNum16 = costControlDetail.PlanNum;
item3.ThisNum16 = costControlDetail.ThisNum;
}
else if (j == 16)
{
item3.PlanNum17 = costControlDetail.PlanNum;
item3.ThisNum17 = costControlDetail.ThisNum;
}
else if (j == 17)
{
item3.PlanNum18 = costControlDetail.PlanNum;
item3.ThisNum18 = costControlDetail.ThisNum;
}
else if (j == 18)
{
item3.PlanNum19 = costControlDetail.PlanNum;
item3.ThisNum19 = costControlDetail.ThisNum;
}
else if (j == 19)
{
item3.PlanNum20 = costControlDetail.PlanNum;
item3.ThisNum20 = costControlDetail.ThisNum;
}
else if (j == 20)
{
item3.PlanNum21 = costControlDetail.PlanNum;
item3.ThisNum21 = costControlDetail.ThisNum;
}
else if (j == 21)
{
item3.PlanNum22 = costControlDetail.PlanNum;
item3.ThisNum22 = costControlDetail.ThisNum;
}
else if (j == 22)
{
item3.PlanNum23 = costControlDetail.PlanNum;
item3.ThisNum23 = costControlDetail.ThisNum;
}
else if (j == 23)
{
item3.PlanNum24 = costControlDetail.PlanNum;
item3.ThisNum24 = costControlDetail.ThisNum;
}
}
}
itemList.Add(item3);
}
}
this.Grid1.DataSource = itemList;
this.Grid1.DataBind();
for (int i = 0; i < this.Grid1.Rows.Count; i++)
{
if (notEditIds.Contains(this.Grid1.Rows[i].RowID))
{
this.Grid1.Rows[i].RowCssClass = "noEdit";
}
}
}
}
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
Model.Wbs_WbsSet wbsSet1 = BLL.WbsSetService.GetWbsSetByWbsSetId(Id);
DateTime startDate, endDate, startMonth, endMonth;
List<DateTime> months = new List<DateTime>();
if (wbsSet1 != null && wbsSet1.StartDate != null && wbsSet1.EndDate != null)
{
startDate = Convert.ToDateTime(wbsSet1.StartDate);
endDate = Convert.ToDateTime(wbsSet1.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);
}
decimal changeThisPlanValue = 0, changeThisRealCost = 0, changeThisPlanCost = 0, //当月总变化完成成本、完成预算
oldThisPlanValue = 0, oldThisRealCost = 0, oldThisPlanCost = 0,
thisPlanValue = 0, thisRealCost = 0, thisPlanCost = 0;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("index");
string costControlId = Grid1.Rows[i].RowID;
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlId);
if (costControl != null)
{
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);
if (!string.IsNullOrEmpty(planNum))
{
costControlDetail.PlanNum = Convert.ToDecimal(planNum);
}
if (!string.IsNullOrEmpty(thisNum))
{
costControlDetail.ThisNum = Convert.ToDecimal(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];
if (!string.IsNullOrEmpty(planNum))
{
costControlDetail.PlanNum = Convert.ToDecimal(planNum);
}
if (!string.IsNullOrEmpty(thisNum))
{
costControlDetail.ThisNum = Convert.ToDecimal(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);
}
}
}
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
}
#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
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("工作量录入" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = Encoding.UTF8;
this.Grid1.PageSize = Grid1.RecordCount;
Response.Write(GetGridTableHtml2(Grid1));
Response.End();
}
#endregion
}
}

View File

@ -0,0 +1,123 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.JDGL.WBS {
public partial class WorkloadInputEdit {
/// <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>
/// txtCostControlName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtCostControlName;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
/// <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;
}
}

View File

@ -29,14 +29,9 @@
<f:Toolbar ID="Toolbar2" Position="Top" runat="server"> <f:Toolbar ID="Toolbar2" Position="Top" runat="server">
<Items> <Items>
<f:DatePicker runat="server" ID="txtMonths" Required="true" Label="月份" DateFormatString="yyyy-MM" LabelWidth="70px" LabelAlign="Right" Width="200px" <f:DatePicker runat="server" ID="txtMonths" Required="true" Label="月份" DateFormatString="yyyy-MM" LabelWidth="70px" LabelAlign="Right" Width="200px"
ShowRedStar="true" AutoPostBack="true" OnTextChanged="txtMonths_TextChanged"> ShowRedStar="true">
</f:DatePicker> </f:DatePicker>
<f:DropDownList ID="drpWeek" runat="server" Label="周" LabelAlign="right" AutoPostBack="true" OnSelectedIndexChanged="drpWeek_SelectedIndexChanged"></f:DropDownList> <%--<f:DropDownList ID="drpWeek" runat="server" Label="周" LabelAlign="right" AutoPostBack="true" OnSelectedIndexChanged="drpWeek_SelectedIndexChanged"></f:DropDownList>--%>
<%--<f:RadioButtonList runat="server" ID="rblStatisticsType" AutoPostBack="true" Width="450px"
OnSelectedIndexChanged="rblStatisticsType_SelectedIndexChanged">
<f:RadioItem Value="1" Text="全部" Selected="true" />
<f:RadioItem Value="2" Text="分类" />
</f:RadioButtonList>--%>
<f:DropDownList ID="drpCnProfession" OnSelectedIndexChanged="drpCnProfession_SelectedIndexChanged" AutoPostBack="true" runat="server" Label="专业" LabelAlign="Right" EnableEdit="true"> <f:DropDownList ID="drpCnProfession" OnSelectedIndexChanged="drpCnProfession_SelectedIndexChanged" AutoPostBack="true" runat="server" Label="专业" LabelAlign="Right" EnableEdit="true">
</f:DropDownList> </f:DropDownList>
<f:DropDownList ID="drpUnitProject" OnSelectedIndexChanged="drpUnitProject_SelectedIndexChanged" AutoPostBack="true" runat="server" Label="分部工程" LabelAlign="Right" EnableEdit="true"> <f:DropDownList ID="drpUnitProject" OnSelectedIndexChanged="drpUnitProject_SelectedIndexChanged" AutoPostBack="true" runat="server" Label="分部工程" LabelAlign="Right" EnableEdit="true">

View File

@ -28,48 +28,48 @@ namespace FineUIPro.Web.JDGL.WBS
Funs.FineUIPleaseSelect(drpUnitProject); Funs.FineUIPleaseSelect(drpUnitProject);
Funs.FineUIPleaseSelect(drpWbsSet); Funs.FineUIPleaseSelect(drpWbsSet);
this.txtMonths.Text = string.Format("{0:yyyy-MM}", DateTime.Now); this.txtMonths.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
Funs.FineUIPleaseSelect(this.drpWeek); //Funs.FineUIPleaseSelect(this.drpWeek);
InitWeek(); //InitWeek();
} }
} }
#endregion #endregion
private void InitWeek() //private void InitWeek()
{ //{
if (!string.IsNullOrEmpty(this.txtMonths.Text.Trim())) // if (!string.IsNullOrEmpty(this.txtMonths.Text.Trim()))
{ // {
this.Grid1.Columns[5].HeaderText = "本月计划完成量(WS)"; // this.Grid1.Columns[5].HeaderText = "本月计划完成量(WS)";
this.Grid1.Columns[6].HeaderText = "本月实际完成量(WP)"; // this.Grid1.Columns[6].HeaderText = "本月实际完成量(WP)";
this.Grid1.Columns[8].HeaderText = "本月已完工作实际费用-ACWP"; // this.Grid1.Columns[8].HeaderText = "本月已完工作实际费用-ACWP";
this.Grid1.Columns[9].HeaderText = "本月计划工作预算费用-BCWS"; // this.Grid1.Columns[9].HeaderText = "本月计划工作预算费用-BCWS";
this.Grid1.Columns[10].HeaderText = "本月已完工作预算费用-BCWP"; // this.Grid1.Columns[10].HeaderText = "本月已完工作预算费用-BCWP";
this.drpWeek.Items.Clear(); // this.drpWeek.Items.Clear();
DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim() + "-01"); // DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim() + "-01");
string costControlId = BLL.CostControlDetailService.GetHasWeekPlanCostControlIdByProjectIdAndMonth(this.CurrUser.LoginProjectId, months); // string costControlId = BLL.CostControlDetailService.GetHasWeekPlanCostControlIdByProjectIdAndMonth(this.CurrUser.LoginProjectId, months);
if (!string.IsNullOrEmpty(costControlId)) // if (!string.IsNullOrEmpty(costControlId))
{ // {
BLL.CostControlDetailService.InitWeekPlanList(this.drpWeek, costControlId, months, true); // BLL.CostControlDetailService.InitWeekPlanList(this.drpWeek, costControlId, months, true);
this.drpWeek.SelectedValue = BLL.Const._Null; // this.drpWeek.SelectedValue = BLL.Const._Null;
} // }
else // else
{ // {
Funs.FineUIPleaseSelect(this.drpWeek); // Funs.FineUIPleaseSelect(this.drpWeek);
this.drpWeek.SelectedValue = BLL.Const._Null; // this.drpWeek.SelectedValue = BLL.Const._Null;
} // }
} // }
} //}
#region //#region 月份选择事
/// <summary> ///// <summary>
/// 月份选择事件 ///// 月份选择事件
/// </summary> ///// </summary>
/// <param name="sender"></param> ///// <param name="sender"></param>
/// <param name="e"></param> ///// <param name="e"></param>
protected void txtMonths_TextChanged(object sender, EventArgs e) //protected void txtMonths_TextChanged(object sender, EventArgs e)
{ //{
InitWeek(); // InitWeek();
} //}
#endregion //#endregion
#region #region
/// <summary> /// <summary>
@ -84,7 +84,7 @@ namespace FineUIPro.Web.JDGL.WBS
DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim()); DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim());
//if (this.rblStatisticsType.SelectedValue == "1") //if (this.rblStatisticsType.SelectedValue == "1")
//{ //{
DataTable table = BLL.WorkloadStatisticsService.GetTreeDataTable(this.CurrUser.LoginProjectId, months, this.drpWeek.SelectedValue, this.drpCnProfession.SelectedValue, this.drpUnitProject.SelectedValue, this.drpWbsSet.SelectedValue); DataTable table = BLL.WorkloadStatisticsService.GetTreeDataTable(this.CurrUser.LoginProjectId, months, BLL.Const._Null, this.drpCnProfession.SelectedValue, this.drpUnitProject.SelectedValue, this.drpWbsSet.SelectedValue);
Grid1.DataSource = table; Grid1.DataSource = table;
Grid1.DataBind(); Grid1.DataBind();
//} //}
@ -298,30 +298,30 @@ namespace FineUIPro.Web.JDGL.WBS
Response.Write(GetGridTableHtml2(Grid1)); Response.Write(GetGridTableHtml2(Grid1));
Response.End(); Response.End();
DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim()); DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim());
DataTable table = BLL.WorkloadStatisticsService.GetTreeDataTable(this.CurrUser.LoginProjectId, months, this.drpWeek.SelectedValue, this.drpCnProfession.SelectedValue, this.drpUnitProject.SelectedValue, this.drpWbsSet.SelectedValue); DataTable table = BLL.WorkloadStatisticsService.GetTreeDataTable(this.CurrUser.LoginProjectId, months, BLL.Const._Null, this.drpCnProfession.SelectedValue, this.drpUnitProject.SelectedValue, this.drpWbsSet.SelectedValue);
Grid1.DataSource = table; Grid1.DataSource = table;
Grid1.DataBind(); Grid1.DataBind();
} }
#endregion #endregion
protected void drpWeek_SelectedIndexChanged(object sender, EventArgs e) //protected void drpWeek_SelectedIndexChanged(object sender, EventArgs e)
{ //{
if (this.drpWeek.SelectedValue == BLL.Const._Null) // if (this.drpWeek.SelectedValue == BLL.Const._Null)
{ // {
this.Grid1.Columns[5].HeaderText = "本月计划完成量(WS)"; // this.Grid1.Columns[5].HeaderText = "本月计划完成量(WS)";
this.Grid1.Columns[6].HeaderText = "本月实际完成量(WP)"; // this.Grid1.Columns[6].HeaderText = "本月实际完成量(WP)";
this.Grid1.Columns[8].HeaderText = "本月已完工作实际费用-ACWP"; // this.Grid1.Columns[8].HeaderText = "本月已完工作实际费用-ACWP";
this.Grid1.Columns[9].HeaderText = "本月计划工作预算费用-BCWS"; // this.Grid1.Columns[9].HeaderText = "本月计划工作预算费用-BCWS";
this.Grid1.Columns[10].HeaderText = "本月已完工作预算费用-BCWP"; // this.Grid1.Columns[10].HeaderText = "本月已完工作预算费用-BCWP";
} // }
else // else
{ // {
this.Grid1.Columns[5].HeaderText = "本周计划完成量(WS)"; // this.Grid1.Columns[5].HeaderText = "本周计划完成量(WS)";
this.Grid1.Columns[6].HeaderText = "本周实际完成量(WP)"; // this.Grid1.Columns[6].HeaderText = "本周实际完成量(WP)";
this.Grid1.Columns[8].HeaderText = "本周已完工作实际费用-ACWP"; // this.Grid1.Columns[8].HeaderText = "本周已完工作实际费用-ACWP";
this.Grid1.Columns[9].HeaderText = "本周计划工作预算费用-BCWS"; // this.Grid1.Columns[9].HeaderText = "本周计划工作预算费用-BCWS";
this.Grid1.Columns[10].HeaderText = "本周已完工作预算费用-BCWP"; // this.Grid1.Columns[10].HeaderText = "本周已完工作预算费用-BCWP";
} // }
} //}
} }
} }

View File

@ -57,15 +57,6 @@ namespace FineUIPro.Web.JDGL.WBS {
/// </remarks> /// </remarks>
protected global::FineUIPro.DatePicker txtMonths; protected global::FineUIPro.DatePicker txtMonths;
/// <summary>
/// drpWeek 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpWeek;
/// <summary> /// <summary>
/// drpCnProfession 控件。 /// drpCnProfession 控件。
/// </summary> /// </summary>

View File

@ -0,0 +1,120 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Model
{
public class CostControlDetailItem
{
public string Id { get; set; }
public string Name1 { get; set; }
public string Name2 { get; set; }
public string Name3 { get; set; }
public decimal? TotalNum { get; set; }
public decimal? PlanPrice { get; set; }
public decimal? RealPrice { get; set; }
public decimal? PlanNum1 { get; set; }
public decimal? ThisNum1 { get; set; }
public decimal? PlanNum2 { get; set; }
public decimal? ThisNum2 { get; set; }
public decimal? PlanNum3 { get; set; }
public decimal? ThisNum3 { get; set; }
public decimal? PlanNum4 { get; set; }
public decimal? ThisNum4 { get; set; }
public decimal? PlanNum5 { get; set; }
public decimal? ThisNum5 { get; set; }
public decimal? PlanNum6 { get; set; }
public decimal? ThisNum6 { get; set; }
public decimal? PlanNum7 { get; set; }
public decimal? ThisNum7 { get; set; }
public decimal? PlanNum8 { get; set; }
public decimal? ThisNum8 { get; set; }
public decimal? PlanNum9 { get; set; }
public decimal? ThisNum9 { get; set; }
public decimal? PlanNum10 { get; set; }
public decimal? ThisNum10 { get; set; }
public decimal? PlanNum11 { get; set; }
public decimal? ThisNum11 { get; set; }
public decimal? PlanNum12 { get; set; }
public decimal? ThisNum12 { get; set; }
public decimal? PlanNum13 { get; set; }
public decimal? ThisNum13 { get; set; }
public decimal? PlanNum14 { get; set; }
public decimal? ThisNum14 { get; set; }
public decimal? PlanNum15 { get; set; }
public decimal? ThisNum15 { get; set; }
public decimal? PlanNum16 { get; set; }
public decimal? ThisNum16 { get; set; }
public decimal? PlanNum17 { get; set; }
public decimal? ThisNum17 { get; set; }
public decimal? PlanNum18 { get; set; }
public decimal? ThisNum18 { get; set; }
public decimal? PlanNum19 { get; set; }
public decimal? ThisNum19 { get; set; }
public decimal? PlanNum20 { get; set; }
public decimal? ThisNum20 { get; set; }
public decimal? PlanNum21 { get; set; }
public decimal? ThisNum21 { get; set; }
public decimal? PlanNum22 { get; set; }
public decimal? ThisNum22 { get; set; }
public decimal? PlanNum23 { get; set; }
public decimal? ThisNum23 { get; set; }
public decimal? PlanNum24 { get; set; }
public decimal? ThisNum24 { get; set; }
}
}

View File

@ -342605,6 +342605,8 @@ namespace Model
private string _SupId; private string _SupId;
private string _Code;
private string _Name; private string _Name;
private string _WBSType; private string _WBSType;
@ -342653,6 +342655,22 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Code", DbType="NVarChar(50)")]
public string Code
{
get
{
return this._Code;
}
set
{
if ((this._Code != value))
{
this._Code = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(102)")] [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(102)")]
public string Name public string Name
{ {
@ -347204,6 +347222,8 @@ namespace Model
private System.Nullable<decimal> _PlanPrice; private System.Nullable<decimal> _PlanPrice;
private System.Nullable<bool> _IsSelected;
private EntityRef<Base_Project> _Base_Project; private EntityRef<Base_Project> _Base_Project;
private EntityRef<Wbs_WbsSet> _Wbs_WbsSet; private EntityRef<Wbs_WbsSet> _Wbs_WbsSet;
@ -347234,6 +347254,8 @@ namespace Model
partial void OnRealPriceChanged(); partial void OnRealPriceChanged();
partial void OnPlanPriceChanging(System.Nullable<decimal> value); partial void OnPlanPriceChanging(System.Nullable<decimal> value);
partial void OnPlanPriceChanged(); partial void OnPlanPriceChanged();
partial void OnIsSelectedChanging(System.Nullable<bool> value);
partial void OnIsSelectedChanged();
#endregion #endregion
public WBS_CostControl() public WBS_CostControl()
@ -347433,6 +347455,26 @@ namespace Model
} }
} }
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_IsSelected", DbType="Bit")]
public System.Nullable<bool> IsSelected
{
get
{
return this._IsSelected;
}
set
{
if ((this._IsSelected != value))
{
this.OnIsSelectedChanging(value);
this.SendPropertyChanging();
this._IsSelected = value;
this.SendPropertyChanged("IsSelected");
this.OnIsSelectedChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_CostControl_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_CostControl_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project public Base_Project Base_Project
{ {

View File

@ -146,6 +146,7 @@
<Compile Include="Chart\DataSourceChart.cs" /> <Compile Include="Chart\DataSourceChart.cs" />
<Compile Include="Chart\DataSourcePoint.cs" /> <Compile Include="Chart\DataSourcePoint.cs" />
<Compile Include="Chart\DataSourceTeam.cs" /> <Compile Include="Chart\DataSourceTeam.cs" />
<Compile Include="CostControlDetailItem.cs" />
<Compile Include="CQMS\CheckItem.cs" /> <Compile Include="CQMS\CheckItem.cs" />
<Compile Include="CQMS\CheckStatisc.cs" /> <Compile Include="CQMS\CheckStatisc.cs" />
<Compile Include="CQMS\FileCabinetItem.cs" /> <Compile Include="CQMS\FileCabinetItem.cs" />