1229-gaofei
This commit is contained in:
parent
0bf6d1efd7
commit
3bda153d7c
|
@ -3552,154 +3552,150 @@ GO
|
|||
|
||||
--电信分部分项
|
||||
insert into dbo.Wbs_UnitProjectInit(UnitProjectCode,UnitProjectName,SuperUnitProject,CnProfessionId,IsIn,SortIndex)
|
||||
values('TC01','火灾报警系统',null,16,1,1)
|
||||
values('TC','电信系统',null,16,1,1)
|
||||
GO
|
||||
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0101','探测器安装(含设备安装、校接线、编码、调试)',16,null,'TC01',1,10)
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
|
||||
values('TC01','火灾报警系统',16,null,'TC',1)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0102','声光报警和手报安装(含设备安装、校接线、编码、调试)',16,null,'TC01',1,10)
|
||||
values('TC0101','探测器安装(含设备安装、校接线、编码、调试)',16,'TC01','TC',1,10)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0103','控制箱、模块箱安装',16,null,'TC01',1,10)
|
||||
values('TC0102','声光报警和手报安装(含设备安装、校接线、编码、调试)',16,'TC01','TC',1,10)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0104','电缆保护管/线槽安装',16,null,'TC01',1,10)
|
||||
values('TC0103','控制箱、模块箱安装',16,'TC01','TC',1,10)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0105','电缆敷设、接线、挂牌',16,null,'TC01',1,20)
|
||||
values('TC0104','电缆保护管/线槽安装',16,'TC01','TC',1,10)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0106','消防控制柜安装',16,null,'TC01',1,10)
|
||||
values('TC0105','电缆敷设、接线、挂牌',16,'TC01','TC',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0107','消防系统回路调试',16,null,'TC01',1,20)
|
||||
values('TC0106','消防控制柜安装',16,'TC01','TC',1,10)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0108','备用电源及电池柜安装调试',16,null,'TC01',1,10)
|
||||
values('TC0107','消防系统回路调试',16,'TC01','TC',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0108','备用电源及电池柜安装调试',16,'TC01','TC',1,10)
|
||||
GO
|
||||
|
||||
insert into dbo.Wbs_UnitProjectInit(UnitProjectCode,UnitProjectName,SuperUnitProject,CnProfessionId,IsIn,SortIndex)
|
||||
values('TC02','通讯系统',null,16,1,2)
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
|
||||
values('TC02','通讯系统',16,null,'TC',1)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0201','设备安装',16,'TC02','TC',1,null)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0202','调试',16,'TC02','TC',1,null)
|
||||
GO
|
||||
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0201','设备安装',16,null,'TC02',1,null)
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
|
||||
values('TC03','监控摄像系统',16,null,'TC',1)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0202','调试',16,null,'TC02',1,null)
|
||||
values('TC0301','摄像头安装(含支架、控制箱等)',16,'TC03','TC',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0302','监控机柜安装(含柜内元器件、底座)',16,'TC03','TC',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0303','电缆保护管/线槽安装',16,'TC03','TC',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0304','线缆敷设、接线、挂牌',16,'TC03','TC',1,10)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0305','光纤敷设、熔接、挂牌、测试',16,'TC03','TC',1,5)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0306','监控摄像系统调试',16,'TC03','TC',1,25)
|
||||
GO
|
||||
|
||||
insert into dbo.Wbs_UnitProjectInit(UnitProjectCode,UnitProjectName,SuperUnitProject,CnProfessionId,IsIn,SortIndex)
|
||||
values('TC03','监控摄像系统',null,16,1,3)
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
|
||||
values('TC04','扩音对讲系统',16,null,'TC',1)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0401','喇叭、话站安装',16,'TC04','TC',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0402','接线箱安装',16,'TC04','TC',1,10)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0403','电缆保护管/线槽安装',16,'TC04','TC',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0404','线缆敷设、接线、挂牌',16,'TC04','TC',1,10)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0405','扩音对讲系统机柜安装',16,'TC04','TC',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0406','扩音对讲系统调试',16,'TC04','TC',1,20)
|
||||
GO
|
||||
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0301','摄像头安装(含支架、控制箱等)',16,null,'TC03',1,20)
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
|
||||
values('TC05','计算机网络系统',16,null,'TC',1)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0302','监控机柜安装(含柜内元器件、底座)',16,null,'TC03',1,20)
|
||||
values('TC0501','设备安装',16,'TC05','TC',1,null)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0303','电缆保护管/线槽安装',16,null,'TC03',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0304','线缆敷设、接线、挂牌',16,null,'TC03',1,10)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0305','光纤敷设、熔接、挂牌、测试',16,null,'TC03',1,5)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0306','监控摄像系统调试',16,null,'TC03',1,25)
|
||||
values('TC0502','系统调试',16,'TC05','TC',1,null)
|
||||
GO
|
||||
|
||||
insert into dbo.Wbs_UnitProjectInit(UnitProjectCode,UnitProjectName,SuperUnitProject,CnProfessionId,IsIn,SortIndex)
|
||||
values('TC04','扩音对讲系统',null,16,1,4)
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
|
||||
values('TC06','楼宇设备监控/安全防范系统',16,null,'TC',1)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0601','设备安装',16,'TC06','TC',1,null)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0602','系统调试',16,'TC06','TC',1,null)
|
||||
GO
|
||||
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0401','喇叭、话站安装',16,null,'TC04',1,20)
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
|
||||
values('TC07','有线电视系统',16,null,'TC',1)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0402','接线箱安装',16,null,'TC04',1,10)
|
||||
values('TC0701','设备安装',16,'TC07','TC',1,null)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0403','电缆保护管/线槽安装',16,null,'TC04',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0404','线缆敷设、接线、挂牌',16,null,'TC04',1,10)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0405','扩音对讲系统机柜安装',16,null,'TC04',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0406','扩音对讲系统调试',16,null,'TC04',1,20)
|
||||
values('TC0702','系统调试',16,'TC07','TC',1,null)
|
||||
GO
|
||||
|
||||
insert into dbo.Wbs_UnitProjectInit(UnitProjectCode,UnitProjectName,SuperUnitProject,CnProfessionId,IsIn,SortIndex)
|
||||
values('TC05','计算机网络系统',null,16,1,5)
|
||||
GO
|
||||
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0501','设备安装',16,null,'TC05',1,null)
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
|
||||
values('TC08','综合布线系统',16,null,'TC',1)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0502','系统调试',16,null,'TC05',1,null)
|
||||
GO
|
||||
|
||||
insert into dbo.Wbs_UnitProjectInit(UnitProjectCode,UnitProjectName,SuperUnitProject,CnProfessionId,IsIn,SortIndex)
|
||||
values('TC06','楼宇设备监控/安全防范系统',null,16,1,6)
|
||||
GO
|
||||
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0601','设备安装',16,null,'TC06',1,null)
|
||||
values('TC0801','电视、电话、网络插座安装',16,'TC08','TC',1,5)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0602','系统调试',16,null,'TC06',1,null)
|
||||
GO
|
||||
|
||||
insert into dbo.Wbs_UnitProjectInit(UnitProjectCode,UnitProjectName,SuperUnitProject,CnProfessionId,IsIn,SortIndex)
|
||||
values('TC07','有线电视系统',null,16,1,7)
|
||||
GO
|
||||
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0701','设备安装',16,null,'TC07',1,null)
|
||||
values('TC0802','分线接线箱安装',16,'TC08','TC',1,5)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0702','系统调试',16,null,'TC07',1,null)
|
||||
GO
|
||||
|
||||
insert into dbo.Wbs_UnitProjectInit(UnitProjectCode,UnitProjectName,SuperUnitProject,CnProfessionId,IsIn,SortIndex)
|
||||
values('TC08','综合布线系统',null,16,1,8)
|
||||
GO
|
||||
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0801','电视、电话、网络插座安装',16,null,'TC08',1,5)
|
||||
values('TC0803','电缆保护管/线槽安装',16,'TC08','TC',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0802','分线接线箱安装',16,null,'TC08',1,5)
|
||||
values('TC0804','线缆敷设、接线、挂牌',16,'TC08','TC',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0803','电缆保护管/线槽安装',16,null,'TC08',1,20)
|
||||
values('TC0805','光纤敷设、熔接、挂牌、测试',16,'TC08','TC',1,10)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0804','线缆敷设、接线、挂牌',16,null,'TC08',1,20)
|
||||
values('TC0806','桥架',16,'TC08','TC',1,null)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0805','光纤敷设、熔接、挂牌、测试',16,null,'TC08',1,10)
|
||||
values('TC0807','金属构件',16,'TC08','TC',1,null)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0806','桥架',16,null,'TC08',1,null)
|
||||
values('TC0808','机柜、机架安装(含设备)',16,'TC08','TC',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0807','金属构件',16,null,'TC08',1,null)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0808','机柜、机架安装(含设备)',16,null,'TC08',1,20)
|
||||
GO
|
||||
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
|
||||
values('TC0809','综合布线系统调试',16,null,'TC08',1,20)
|
||||
values('TC0809','综合布线系统调试',16,'TC08','TC',1,20)
|
||||
GO
|
||||
|
||||
--采暖通风分部分项
|
||||
|
|
|
@ -166,9 +166,22 @@ namespace BLL
|
|||
newWBS_CostControlDetail.Months = costControlDetail.Months;
|
||||
newWBS_CostControlDetail.StartDate = costControlDetail.StartDate;
|
||||
newWBS_CostControlDetail.EndDate = costControlDetail.EndDate;
|
||||
newWBS_CostControlDetail.PlanNum = costControlDetail.PlanNum;
|
||||
newWBS_CostControlDetail.ThisNum = costControlDetail.ThisNum;
|
||||
|
||||
if (costControlDetail.PlanNum == 0)
|
||||
{
|
||||
newWBS_CostControlDetail.PlanNum = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
newWBS_CostControlDetail.PlanNum = costControlDetail.PlanNum;
|
||||
}
|
||||
if (costControlDetail.ThisNum == 0)
|
||||
{
|
||||
newWBS_CostControlDetail.ThisNum = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
newWBS_CostControlDetail.ThisNum = costControlDetail.ThisNum;
|
||||
}
|
||||
db.WBS_CostControlDetail.InsertOnSubmit(newWBS_CostControlDetail);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
@ -183,8 +196,22 @@ namespace BLL
|
|||
Model.WBS_CostControlDetail newWBS_CostControlDetail = db.WBS_CostControlDetail.First(e => e.CostControlDetailId == costControlDetail.CostControlDetailId);
|
||||
newWBS_CostControlDetail.StartDate = costControlDetail.StartDate;
|
||||
newWBS_CostControlDetail.EndDate = costControlDetail.EndDate;
|
||||
newWBS_CostControlDetail.PlanNum = costControlDetail.PlanNum;
|
||||
newWBS_CostControlDetail.ThisNum = costControlDetail.ThisNum;
|
||||
if (costControlDetail.PlanNum == 0)
|
||||
{
|
||||
newWBS_CostControlDetail.PlanNum = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
newWBS_CostControlDetail.PlanNum = costControlDetail.PlanNum;
|
||||
}
|
||||
if (costControlDetail.ThisNum == 0)
|
||||
{
|
||||
newWBS_CostControlDetail.ThisNum = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
newWBS_CostControlDetail.ThisNum = costControlDetail.ThisNum;
|
||||
}
|
||||
|
||||
db.SubmitChanges();
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -73,10 +73,16 @@
|
|||
<Reference Include="AxInterop.SYNCARDOCXLib">
|
||||
<HintPath>..\FineUIPro\Reference BLL\AxInterop.SYNCARDOCXLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="BouncyCastle.Crypto, Version=1.8.9.0, Culture=neutral, PublicKeyToken=0e99375e54769942, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Portable.BouncyCastle.1.8.9\lib\net40\BouncyCastle.Crypto.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="FineUIPro, Version=6.3.0.0, Culture=neutral, PublicKeyToken=9cbe753c029f291a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\FineUIPro\FineUIPro.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="ICSharpCode.SharpZipLib, Version=1.3.2.10, Culture=neutral, PublicKeyToken=1b03e6acf1164f73, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\SharpZipLib.1.3.2\lib\net45\ICSharpCode.SharpZipLib.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Interop.WIA, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<EmbedInteropTypes>False</EmbedInteropTypes>
|
||||
|
@ -92,6 +98,18 @@
|
|||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\net40\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NPOI, Version=2.5.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NPOI.2.5.5\lib\net45\NPOI.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NPOI.OOXML, Version=2.5.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NPOI.2.5.5\lib\net45\NPOI.OOXML.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NPOI.OpenXml4Net, Version=2.5.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NPOI.2.5.5\lib\net45\NPOI.OpenXml4Net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NPOI.OpenXmlFormats, Version=2.5.5.0, Culture=neutral, PublicKeyToken=0df73ec7942b34e1, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NPOI.2.5.5\lib\net45\NPOI.OpenXmlFormats.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data.Linq" />
|
||||
<Reference Include="System.DirectoryServices" />
|
||||
|
@ -1185,6 +1203,7 @@
|
|||
<Content Include="JDGL\WBS\WBSSetEdit.aspx" />
|
||||
<Content Include="JDGL\WBS\WorkloadInput.aspx" />
|
||||
<Content Include="JDGL\WBS\WorkloadInputEdit.aspx" />
|
||||
<Content Include="JDGL\WBS\WorkloadInputIn.aspx" />
|
||||
<Content Include="JDGL\WBS\WorkloadStatistics.aspx" />
|
||||
<Content Include="Login.aspx" />
|
||||
<Content Include="Notice\IssuedNotice.aspx" />
|
||||
|
@ -12230,6 +12249,13 @@
|
|||
<Compile Include="JDGL\WBS\WorkloadInputEdit.aspx.designer.cs">
|
||||
<DependentUpon>WorkloadInputEdit.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="JDGL\WBS\WorkloadInputIn.aspx.cs">
|
||||
<DependentUpon>WorkloadInputIn.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="JDGL\WBS\WorkloadInputIn.aspx.designer.cs">
|
||||
<DependentUpon>WorkloadInputIn.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="JDGL\WBS\WorkloadStatistics.aspx.cs">
|
||||
<DependentUpon>WorkloadStatistics.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
|
|
|
@ -137,6 +137,9 @@
|
|||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true" Icon="Pencil"
|
||||
runat="server" Text="录入" Hidden="true">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuImport" OnClick="btnMenuImport_Click" EnablePostBack="true" Icon="PackageIn"
|
||||
runat="server" Text="导入" >
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
|
|
|
@ -342,17 +342,26 @@ namespace FineUIPro.Web.JDGL.WBS
|
|||
this.hdSelectId.Text = this.trWBS.SelectedNode.NodeID;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WorkloadInputEdit.aspx?Id={0}", this.trWBS.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 右键导入事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuImport_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") //非项目、装置、专业节点可以修改
|
||||
{
|
||||
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);
|
||||
}
|
||||
this.hdSelectId.Text = this.trWBS.SelectedNode.NodeID;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WorkloadInputIn.aspx?Id={0}", this.trWBS.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -155,5 +155,14 @@ namespace FineUIPro.Web.JDGL.WBS {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuImport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuImport;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,11 @@
|
|||
.f-grid-row.noEdit{
|
||||
pointer-events:none;
|
||||
}
|
||||
|
||||
.f-grid-colheader-text {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
|
@ -34,7 +39,7 @@
|
|||
<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"
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
|
@ -9,6 +10,9 @@ using System.Web.UI;
|
|||
using System.Web.UI.WebControls;
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using NPOI.HSSF.UserModel;
|
||||
using NPOI.SS.UserModel;
|
||||
using NPOI.XSSF.UserModel;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
|
@ -61,37 +65,37 @@ namespace FineUIPro.Web.JDGL.WBS
|
|||
}
|
||||
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;
|
||||
//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.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 = "计划量";
|
||||
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);
|
||||
gd.Columns.Add(rdPlan);
|
||||
Grid1.Columns.Add(rdPlan);
|
||||
|
||||
RenderField rdThis = new RenderField();
|
||||
rdThis.ColumnID = gd.HeaderText + "This";
|
||||
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 = "完成量";
|
||||
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);
|
||||
gd.Columns.Add(rdThis);
|
||||
Grid1.Columns.Add(rdThis);
|
||||
|
||||
Grid1.Columns.Add(gd);
|
||||
//Grid1.Columns.Add(gd);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
@ -339,14 +343,8 @@ namespace FineUIPro.Web.JDGL.WBS
|
|||
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);
|
||||
}
|
||||
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);
|
||||
|
@ -358,14 +356,8 @@ namespace FineUIPro.Web.JDGL.WBS
|
|||
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);
|
||||
}
|
||||
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);
|
||||
|
@ -591,22 +583,190 @@ namespace FineUIPro.Web.JDGL.WBS
|
|||
#endregion
|
||||
#endregion
|
||||
|
||||
#region 导出按钮
|
||||
/// 导出按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
//#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
|
||||
|
||||
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));
|
||||
string varValue = string.Empty;
|
||||
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);
|
||||
}
|
||||
|
||||
string rootPath = Server.MapPath("~/") + Const.ExcelUrl;
|
||||
//模板文件
|
||||
string TempletFileName = Server.MapPath("~/") + "File/Excel/JDGL/工作量录入.xls";
|
||||
//导出文件
|
||||
string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\";
|
||||
if (!Directory.Exists(filePath))
|
||||
{
|
||||
Directory.CreateDirectory(filePath);
|
||||
}
|
||||
string ReportFileName = filePath + "out.xlsx";
|
||||
|
||||
FileStream file = new FileStream(TempletFileName, FileMode.Open, FileAccess.Read);
|
||||
HSSFWorkbook hssfworkbook = new HSSFWorkbook(file);
|
||||
|
||||
ICellStyle styleCenter = hssfworkbook.CreateCellStyle();
|
||||
styleCenter.VerticalAlignment = VerticalAlignment.Center;
|
||||
styleCenter.Alignment = HorizontalAlignment.Center;
|
||||
styleCenter.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
styleCenter.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
styleCenter.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
styleCenter.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
styleCenter.WrapText = true;
|
||||
IFont font = styleCenter.GetFont(hssfworkbook);
|
||||
font.FontHeightInPoints = 10;//字体高度(与excel中的字号一致)
|
||||
styleCenter.SetFont(font);
|
||||
HSSFSheet recordSheet = (HSSFSheet)hssfworkbook.GetSheet("工作量录入");
|
||||
HSSFRow row0 = (HSSFRow)recordSheet.CreateRow(0);
|
||||
HSSFCell cell0 = (HSSFCell)row0.CreateCell(0);
|
||||
cell0.CellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cell0.CellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cell0.CellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cell0.CellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
cell0.CellStyle.WrapText = true;
|
||||
cell0.SetCellValue(new HSSFRichTextString("序号"));
|
||||
HSSFCell cell1 = (HSSFCell)row0.CreateCell(1);
|
||||
cell1.SetCellValue(new HSSFRichTextString("分部"));
|
||||
cell1.CellStyle.WrapText = true;
|
||||
HSSFCell cell2 = (HSSFCell)row0.CreateCell(2);
|
||||
cell2.SetCellValue(new HSSFRichTextString("分项"));
|
||||
cell2.CellStyle.WrapText = true;
|
||||
HSSFCell cell3 = (HSSFCell)row0.CreateCell(3);
|
||||
cell3.SetCellValue(new HSSFRichTextString("费控项内容"));
|
||||
cell3.CellStyle.WrapText = true;
|
||||
HSSFCell cell4 = (HSSFCell)row0.CreateCell(4);
|
||||
cell4.SetCellValue(new HSSFRichTextString("合同工作量"));
|
||||
HSSFCell cell5 = (HSSFCell)row0.CreateCell(5);
|
||||
cell5.SetCellValue(new HSSFRichTextString("预算单价"));
|
||||
HSSFCell cell6 = (HSSFCell)row0.CreateCell(6);
|
||||
cell6.SetCellValue(new HSSFRichTextString("实际单价"));
|
||||
for (int a = 0; a < months.Count; a++)
|
||||
{
|
||||
HSSFCell cellPlan = (HSSFCell)row0.CreateCell(7 + a * 2);
|
||||
cellPlan.SetCellValue(new HSSFRichTextString(string.Format("{0:yyyy年MM月}", months[a]) + "计划量"));
|
||||
HSSFCell cellThis = (HSSFCell)row0.CreateCell(8 + a * 2);
|
||||
cellThis.SetCellValue(new HSSFRichTextString(string.Format("{0:yyyy年MM月}", months[a]) + "完成量"));
|
||||
}
|
||||
int i = 1;
|
||||
HSSFRow row1 = (HSSFRow)recordSheet.CreateRow(1);
|
||||
HSSFCell r1cell0 = (HSSFCell)row1.CreateCell(0);
|
||||
r1cell0.SetCellValue(new HSSFRichTextString(i.ToString()));
|
||||
HSSFCell r1cell1 = (HSSFCell)row1.CreateCell(1);
|
||||
r1cell1.SetCellValue(new HSSFRichTextString(wbsSet.WbsSetName));
|
||||
r1cell1.CellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
r1cell1.CellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
r1cell1.CellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
r1cell1.CellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
r1cell1.CellStyle.WrapText = true;
|
||||
var childWbsSets = BLL.WbsSetService.GetApproveWbsSetsBySuperWbsSetId(Id);
|
||||
foreach (var childWbsSet in childWbsSets)
|
||||
{
|
||||
i++;
|
||||
HSSFRow rowW = (HSSFRow)recordSheet.CreateRow(i);
|
||||
HSSFCell rWcell0 = (HSSFCell)rowW.CreateCell(0);
|
||||
rWcell0.SetCellValue(new HSSFRichTextString(i.ToString()));
|
||||
HSSFCell rWcell2 = (HSSFCell)rowW.CreateCell(2);
|
||||
rWcell2.SetCellValue(new HSSFRichTextString(childWbsSet.WbsSetName));
|
||||
rWcell2.CellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rWcell2.CellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rWcell2.CellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rWcell2.CellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rWcell2.CellStyle.WrapText = true;
|
||||
var costControls = BLL.CostControlService.GetSelectedCostControlsByWbsSetId(childWbsSet.WbsSetId);
|
||||
foreach (var costControl in costControls)
|
||||
{
|
||||
i++;
|
||||
HSSFRow rowC = (HSSFRow)recordSheet.CreateRow(i);
|
||||
HSSFCell rCcell0 = (HSSFCell)rowC.CreateCell(0);
|
||||
rCcell0.SetCellValue(new HSSFRichTextString(i.ToString()));
|
||||
HSSFCell rCcell3 = (HSSFCell)rowC.CreateCell(3);
|
||||
rCcell3.SetCellValue(new HSSFRichTextString(costControl.CostControlName));
|
||||
rCcell3.CellStyle.BorderLeft = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rCcell3.CellStyle.BorderRight = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rCcell3.CellStyle.BorderTop = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rCcell3.CellStyle.BorderBottom = NPOI.SS.UserModel.BorderStyle.Thin;
|
||||
rCcell3.CellStyle.WrapText = true;
|
||||
HSSFCell rCcell4 = (HSSFCell)rowC.CreateCell(4);
|
||||
if (costControl.TotalNum != null)
|
||||
{
|
||||
rCcell4.SetCellValue(new HSSFRichTextString(costControl.TotalNum.Value.ToString("0.##")));
|
||||
}
|
||||
HSSFCell rCcell5 = (HSSFCell)rowC.CreateCell(5);
|
||||
if (costControl.PlanPrice != null)
|
||||
{
|
||||
rCcell5.SetCellValue(new HSSFRichTextString(costControl.PlanPrice.Value.ToString("0.##")));
|
||||
}
|
||||
HSSFCell rCcell6 = (HSSFCell)rowC.CreateCell(6);
|
||||
if (costControl.RealPrice != null)
|
||||
{
|
||||
rCcell6.SetCellValue(new HSSFRichTextString(costControl.RealPrice.Value.ToString("0.##")));
|
||||
}
|
||||
for (int j = 0; j < months.Count; j++)
|
||||
{
|
||||
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(costControl.CostControlId, months[j]);
|
||||
if (costControlDetail != null)
|
||||
{
|
||||
HSSFCell cellDetailPlan = (HSSFCell)rowC.CreateCell(7 + j * 2);
|
||||
if (costControlDetail.PlanNum != null)
|
||||
{
|
||||
cellDetailPlan.SetCellValue(new HSSFRichTextString(costControlDetail.PlanNum.Value.ToString("0.##")));
|
||||
}
|
||||
HSSFCell cellDetailThis = (HSSFCell)rowC.CreateCell(8 + j * 2);
|
||||
if (costControlDetail.ThisNum != null)
|
||||
{
|
||||
cellDetailThis.SetCellValue(new HSSFRichTextString(costControlDetail.ThisNum.Value.ToString("0.##")));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
using (FileStream filess = File.OpenWrite(ReportFileName))
|
||||
{
|
||||
hssfworkbook.Write(filess);
|
||||
}
|
||||
FileInfo filet = new FileInfo(ReportFileName);
|
||||
Response.Clear();
|
||||
Response.Charset = "GB2312";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
// 添加头信息,为"文件下载/另存为"对话框指定默认文件名
|
||||
Response.AddHeader("Content-Disposition", "attachment; filename="+ Server.UrlEncode("工作量录入_" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".xls"));
|
||||
// 添加头信息,指定文件大小,让浏览器能够显示下载进度
|
||||
Response.AddHeader("Content-Length", filet.Length.ToString());
|
||||
// 指定返回的是一个不能被客户端读取的流,必须被下载
|
||||
Response.ContentType = "application/ms-excel";
|
||||
// 把文件流发送到客户端
|
||||
Response.WriteFile(filet.FullName);
|
||||
// 停止页面的执行
|
||||
Response.End();
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WorkloadInputIn.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.WorkloadInputIn" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>导入工作量</title>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:HiddenField ID="hdFileName" runat="server">
|
||||
</f:HiddenField>
|
||||
<f:Button ID="btnAudit" Icon="ApplicationGet" runat="server" ToolTip="导入" ValidateForms="SimpleForm1"
|
||||
OnClick="btnAudit_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
|
||||
LabelWidth="150px">
|
||||
</f:FileUpload>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="管线信息"
|
||||
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true"
|
||||
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="Id"
|
||||
AllowSorting="true" SortField="Id" SortDirection="ASC"
|
||||
AllowPaging="true" IsDatabasePaging="true" PageSize="1000"
|
||||
EnableTextSelection="True">
|
||||
<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">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="PlanPrice" DataField="PlanPrice" FieldType="Double" EnableLock="true" Locked="true"
|
||||
HeaderText="预算单价" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="RealPrice" DataField="RealPrice" FieldType="Double" EnableLock="true" Locked="true"
|
||||
HeaderText="实际单价" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,817 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.OleDb;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using BLL;
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS
|
||||
{
|
||||
public partial class WorkloadInputIn : PageBase
|
||||
{
|
||||
/// <summary>
|
||||
/// 控制项主键
|
||||
/// </summary>
|
||||
public string Id
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["Id"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["Id"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 上传预设的虚拟路径
|
||||
/// </summary>
|
||||
private string initPath = Const.ExcelUrl;
|
||||
|
||||
/// <summary>
|
||||
/// 安装组件集合
|
||||
/// </summary>
|
||||
public static List<Model.View_HJGL_Pipeline> PipelineList = new List<Model.View_HJGL_Pipeline>();
|
||||
|
||||
/// <summary>
|
||||
/// 错误集合
|
||||
/// </summary>
|
||||
public static string errorInfos = string.Empty;
|
||||
#endregion
|
||||
|
||||
/// <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 = 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;
|
||||
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;
|
||||
Grid1.Columns.Add(rdThis);
|
||||
|
||||
//Grid1.Columns.Add(gd);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.hdFileName.Text = string.Empty;
|
||||
this.Id = Request.Params["Id"];
|
||||
if (PipelineList != null)
|
||||
{
|
||||
PipelineList.Clear();
|
||||
}
|
||||
errorInfos = string.Empty;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导入
|
||||
/// <summary>
|
||||
/// 导入
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAudit_Click(object sender, EventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
if (this.fuAttachUrl.HasFile == false)
|
||||
{
|
||||
ShowNotify("请您选择Excel文件!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
|
||||
if (IsXls != ".xls")
|
||||
{
|
||||
ShowNotify("只可以选择Excel文件!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
if (PipelineList != null)
|
||||
{
|
||||
PipelineList.Clear();
|
||||
}
|
||||
if (!string.IsNullOrEmpty(errorInfos))
|
||||
{
|
||||
errorInfos = string.Empty;
|
||||
}
|
||||
string rootPath = Server.MapPath("~/");
|
||||
string initFullPath = rootPath + initPath;
|
||||
if (!Directory.Exists(initFullPath))
|
||||
{
|
||||
Directory.CreateDirectory(initFullPath);
|
||||
}
|
||||
|
||||
this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls;
|
||||
string filePath = initFullPath + this.hdFileName.Text;
|
||||
this.fuAttachUrl.PostedFile.SaveAs(filePath);
|
||||
ImportXlsToData(rootPath + initPath + this.hdFileName.Text);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
#region 读Excel提取数据
|
||||
/// <summary>
|
||||
/// 从Excel提取数据--》Dataset
|
||||
/// </summary>
|
||||
/// <param name="filename">Excel文件路径名</param>
|
||||
private void ImportXlsToData(string fileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
string oleDBConnString = String.Empty;
|
||||
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
|
||||
oleDBConnString += "Data Source=";
|
||||
oleDBConnString += fileName;
|
||||
oleDBConnString += ";Extended Properties=Excel 8.0;";
|
||||
OleDbConnection oleDBConn = null;
|
||||
OleDbDataAdapter oleAdMaster = null;
|
||||
DataTable m_tableName = new DataTable();
|
||||
DataSet ds = new DataSet();
|
||||
|
||||
oleDBConn = new OleDbConnection(oleDBConnString);
|
||||
oleDBConn.Open();
|
||||
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
|
||||
|
||||
if (m_tableName != null && m_tableName.Rows.Count > 0)
|
||||
{
|
||||
|
||||
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
|
||||
|
||||
}
|
||||
string sqlMaster;
|
||||
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
|
||||
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
|
||||
oleAdMaster.Fill(ds, "m_tableName");
|
||||
oleAdMaster.Dispose();
|
||||
oleDBConn.Close();
|
||||
oleDBConn.Dispose();
|
||||
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);
|
||||
}
|
||||
AddDatasetToSQL(ds.Tables[0], 7 + months.Count * 2);
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Response.Write(exc);
|
||||
//return null;
|
||||
// return dt;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 将Dataset的数据导入数据库
|
||||
/// <summary>
|
||||
/// 将Dataset的数据导入数据库
|
||||
/// </summary>
|
||||
/// <param name="pds">数据集</param>
|
||||
/// <param name="Cols">数据集行数</param>
|
||||
/// <returns></returns>
|
||||
private bool AddDatasetToSQL(DataTable pds, int Cols)
|
||||
{
|
||||
string result = string.Empty;
|
||||
int ic, ir;
|
||||
ic = pds.Columns.Count;
|
||||
ir = pds.Rows.Count;
|
||||
if (ic < Cols)
|
||||
{
|
||||
ShowNotify("导入Excel格式错误!Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning);
|
||||
return false;
|
||||
}
|
||||
if (pds != null && ir > 0)
|
||||
{
|
||||
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);
|
||||
}
|
||||
Dictionary<int, string> editRows = new Dictionary<int, string>();
|
||||
int a = 0;
|
||||
var childWbsSets = BLL.WbsSetService.GetApproveWbsSetsBySuperWbsSetId(Id);
|
||||
foreach (var childWbsSet in childWbsSets)
|
||||
{
|
||||
a++;
|
||||
var costControls = BLL.CostControlService.GetSelectedCostControlsByWbsSetId(childWbsSet.WbsSetId);
|
||||
foreach (var costControl in costControls)
|
||||
{
|
||||
a++;
|
||||
editRows.Add(a, costControl.CostControlId);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
if (editRows.ContainsKey(i))
|
||||
{
|
||||
string totalNum = pds.Rows[i][4].ToString();
|
||||
string planPrice = pds.Rows[i][5].ToString();
|
||||
string realPrice = pds.Rows[i][6].ToString();
|
||||
if (!string.IsNullOrEmpty(totalNum))
|
||||
{
|
||||
try
|
||||
{
|
||||
decimal d = Convert.ToDecimal(totalNum);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "合同工作量格式输入有误" + "|";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "合同工作量" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(planPrice))
|
||||
{
|
||||
try
|
||||
{
|
||||
decimal d = Convert.ToDecimal(planPrice);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "预算单价格式输入有误" + "|";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "预算单价" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
if (!string.IsNullOrEmpty(realPrice))
|
||||
{
|
||||
try
|
||||
{
|
||||
decimal d = Convert.ToDecimal(realPrice);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "实际单价格式输入有误" + "|";
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + "实际单价" + "," + "此项为必填项!" + "|";
|
||||
}
|
||||
for (int j = 0; j < months.Count; j++)
|
||||
{
|
||||
string planNum = pds.Rows[i][7 + j * 2].ToString();
|
||||
string thisNum = pds.Rows[i][8 + j * 2].ToString();
|
||||
if (!string.IsNullOrEmpty(planNum))
|
||||
{
|
||||
try
|
||||
{
|
||||
decimal d = Convert.ToDecimal(planNum);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + string.Format("{0:yyyy年MM月}", months[j]) + "计划量格式输入有误" + "|";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(thisNum))
|
||||
{
|
||||
try
|
||||
{
|
||||
decimal d = Convert.ToDecimal(thisNum);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
result += "第" + (i + 2).ToString() + "行," + string.Format("{0:yyyy年MM月}", months[j]) + "完成量格式输入有误" + "|";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
decimal changeThisPlanValue = 0, changeThisRealCost = 0, changeThisPlanCost = 0, //当月总变化完成成本、完成预算
|
||||
oldThisPlanValue = 0, oldThisRealCost = 0, oldThisPlanCost = 0,
|
||||
thisPlanValue = 0, thisRealCost = 0, thisPlanCost = 0;
|
||||
if (string.IsNullOrEmpty(result))
|
||||
{
|
||||
for (int i = 0; i < ir; i++)
|
||||
{
|
||||
if (editRows.ContainsKey(i))
|
||||
{
|
||||
string costControlId = editRows.First(x => x.Key == i).Value;
|
||||
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlId);
|
||||
if (costControl != null)
|
||||
{
|
||||
string totalNum = pds.Rows[i][4].ToString();
|
||||
string planPrice = pds.Rows[i][5].ToString();
|
||||
string realPrice = pds.Rows[i][6].ToString();
|
||||
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 = pds.Rows[i][7 + j * 2].ToString();
|
||||
string thisNum = pds.Rows[i][8 + j * 2].ToString();
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(result))
|
||||
{
|
||||
PipelineList.Clear();
|
||||
result = result.Substring(0, result.LastIndexOf("|"));
|
||||
errorInfos = result;
|
||||
Alert alert = new Alert();
|
||||
alert.Message = result;
|
||||
alert.Target = Target.Self;
|
||||
alert.Show();
|
||||
}
|
||||
else
|
||||
{
|
||||
errorInfos = string.Empty;
|
||||
ShowNotify("导入成功!", MessageBoxIcon.Success);
|
||||
List<Model.CostControlDetailItem> itemList = new List<Model.CostControlDetailItem>();
|
||||
Model.CostControlDetailItem item1 = new Model.CostControlDetailItem();
|
||||
item1.Id = Id;
|
||||
item1.Name1 = wbsSet1.WbsSetName;
|
||||
itemList.Add(item1);
|
||||
var childWbsSets1 = BLL.WbsSetService.GetApproveWbsSetsBySuperWbsSetId(Id);
|
||||
foreach (var childWbsSet in childWbsSets1)
|
||||
{
|
||||
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();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
#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
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -0,0 +1,96 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.JDGL.WBS {
|
||||
|
||||
|
||||
public partial class WorkloadInputIn {
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// hdFileName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hdFileName;
|
||||
|
||||
/// <summary>
|
||||
/// btnAudit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAudit;
|
||||
|
||||
/// <summary>
|
||||
/// fuAttachUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FileUpload fuAttachUrl;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// lblPageIndex 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPageIndex;
|
||||
}
|
||||
}
|
|
@ -41,13 +41,13 @@
|
|||
<f:Button ID="btnSearch" Text="查询" MarginLeft="40px" EnablePostBack="true" runat="server"
|
||||
OnClick="btnSearch_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSend" Text="推送数据" EnablePostBack="true" runat="server"
|
||||
<f:Button ID="btnSend" Text="推送数据" EnablePostBack="true" runat="server" Hidden="true"
|
||||
OnClick="btnSend_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" Text="删除数据" EnablePostBack="true" runat="server"
|
||||
<f:Button ID="btnDelete" Text="删除数据" EnablePostBack="true" runat="server" Hidden="true"
|
||||
OnClick="btnDelete_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnCheck" Text="查询数据" EnablePostBack="true" runat="server"
|
||||
<f:Button ID="btnCheck" Text="查询数据" EnablePostBack="true" runat="server" Hidden="true"
|
||||
OnClick="btnCheck_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
|
|
|
@ -249,15 +249,16 @@ namespace FineUIPro.Web.ProjectData
|
|||
JArray arr = JArray.Parse(obj["result"].ToString());
|
||||
Model.SGGLDB db = Funs.DB;
|
||||
//专业
|
||||
var cnProfessionInits = from x in db.WBS_CnProfessionInit where x.CnProfessionId < 19 select x;
|
||||
var cnProfessionInits = from x in db.WBS_CnProfessionInit select x;
|
||||
//单位工程及子单位工程
|
||||
var unitProjectInits = from x in db.Wbs_UnitProjectInit where x.CnProfessionId < 19 orderby x.SuperUnitProject select x;
|
||||
var unitProjectInits = from x in db.Wbs_UnitProjectInit orderby x.SuperUnitProject select x;
|
||||
//分部/子分部/分项/子分项
|
||||
var wbsSetInits = (from x in db.WBS_WbsSetInit where x.CnProfessionId < 19 orderby x.SuperWbsSetCode select x).ToList();
|
||||
var wbsSetInits = (from x in db.WBS_WbsSetInit orderby x.SuperWbsSetCode select x).ToList();
|
||||
//费用清单对应关系
|
||||
var wbsSetMatchCostControlInits = from x in db.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
|
||||
//费用清单项
|
||||
var totalCostControlInits = from x in db.WBS_CostControlInit orderby x.CostControlInitCode select x;
|
||||
string sgId = string.Empty;
|
||||
foreach (var item in arr)
|
||||
{
|
||||
string id = item["id"].ToString(); //记录Id,主键
|
||||
|
@ -285,6 +286,10 @@ namespace FineUIPro.Web.ProjectData
|
|||
installation.Def = remark;
|
||||
db.Project_Installation.InsertOnSubmit(installation);
|
||||
db.SubmitChanges();
|
||||
if (name == "施工")
|
||||
{
|
||||
sgId = id;
|
||||
}
|
||||
}
|
||||
else if (level == "5")
|
||||
{
|
||||
|
@ -292,94 +297,320 @@ namespace FineUIPro.Web.ProjectData
|
|||
//拷贝专业
|
||||
if (cn != null)
|
||||
{
|
||||
Model.WBS_CnProfession cnProfession = new Model.WBS_CnProfession();
|
||||
cnProfession.CnProfessionId = id;
|
||||
cnProfession.CnProfessionName = cn.CnProfessionName;
|
||||
cnProfession.CnProfessionCode = cn.CnProfessionCode;
|
||||
cnProfession.InstallationId = parentId;
|
||||
cnProfession.ProjectId = this.CurrUser.LoginProjectId;
|
||||
cnProfession.StartDate = Funs.GetNewDateTime(planStart);
|
||||
cnProfession.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
cnProfession.OldId = cn.CnProfessionId;
|
||||
db.WBS_CnProfession.InsertOnSubmit(cnProfession);
|
||||
db.SubmitChanges();
|
||||
//单位工程
|
||||
var unitProjects = unitProjectInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var unitProjectInit in unitProjects)
|
||||
if (cn.CnProfessionName != "防腐绝热" && cn.CnProfessionName != "地勘" && cn.CnProfessionName != "全厂地下主管网" && cn.CnProfessionName != "临时设施" && cn.CnProfessionName != "总图")
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = new Model.Wbs_UnitProject();
|
||||
unitProject.UnitProjectId = SQLHelper.GetNewID(typeof(Model.Wbs_UnitProject));
|
||||
unitProject.UnitProjectCode = unitProjectInit.UnitProjectCode;
|
||||
unitProject.UnitProjectName = unitProjectInit.UnitProjectName;
|
||||
unitProject.InstallationId = parentId;
|
||||
unitProject.SortIndex = unitProjectInit.SortIndex;
|
||||
unitProject.SuperUnitProjectId = null;
|
||||
unitProject.ProjectId = this.CurrUser.LoginProjectId;
|
||||
unitProject.CnProfessionId = id;
|
||||
unitProject.StartDate = Funs.GetNewDateTime(planStart);
|
||||
unitProject.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
unitProject.Remark = unitProjectInit.Remark;
|
||||
unitProject.IsIn = true;
|
||||
db.Wbs_UnitProject.InsertOnSubmit(unitProject);
|
||||
Model.WBS_CnProfession cnProfession = new Model.WBS_CnProfession();
|
||||
cnProfession.CnProfessionId = id;
|
||||
cnProfession.CnProfessionName = cn.CnProfessionName;
|
||||
cnProfession.CnProfessionCode = cn.CnProfessionCode;
|
||||
cnProfession.InstallationId = parentId;
|
||||
cnProfession.ProjectId = this.CurrUser.LoginProjectId;
|
||||
cnProfession.StartDate = Funs.GetNewDateTime(planStart);
|
||||
cnProfession.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
cnProfession.OldId = cn.CnProfessionId;
|
||||
db.WBS_CnProfession.InsertOnSubmit(cnProfession);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
//分部分项
|
||||
var wbsSets = wbsSetInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var wbsSetInit in wbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
wbsSet.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
wbsSet.WbsSetCode = wbsSetInit.WbsSetCode;
|
||||
wbsSet.WbsSetName = wbsSetInit.WbsSetName;
|
||||
wbsSet.InstallationId = parentId;
|
||||
wbsSet.CnProfessionId = id;
|
||||
wbsSet.UnitProjectId = (from x in db.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.CnProfessionId == id select x.UnitProjectId).FirstOrDefault();
|
||||
if (wbsSetInit.SuperWbsSetCode == null)
|
||||
//单位工程
|
||||
var unitProjects = unitProjectInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var unitProjectInit in unitProjects)
|
||||
{
|
||||
wbsSet.SuperWbsSetId = null;
|
||||
Model.Wbs_UnitProject unitProject = new Model.Wbs_UnitProject();
|
||||
unitProject.UnitProjectId = SQLHelper.GetNewID(typeof(Model.Wbs_UnitProject));
|
||||
unitProject.UnitProjectCode = unitProjectInit.UnitProjectCode;
|
||||
unitProject.UnitProjectName = unitProjectInit.UnitProjectName;
|
||||
unitProject.InstallationId = parentId;
|
||||
unitProject.SortIndex = unitProjectInit.SortIndex;
|
||||
unitProject.SuperUnitProjectId = null;
|
||||
unitProject.ProjectId = this.CurrUser.LoginProjectId;
|
||||
unitProject.CnProfessionId = id;
|
||||
unitProject.StartDate = Funs.GetNewDateTime(planStart);
|
||||
unitProject.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
unitProject.Remark = unitProjectInit.Remark;
|
||||
unitProject.IsIn = true;
|
||||
db.Wbs_UnitProject.InsertOnSubmit(unitProject);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
else
|
||||
//分部分项
|
||||
var wbsSets = wbsSetInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var wbsSetInit in wbsSets)
|
||||
{
|
||||
wbsSet.SuperWbsSetId = (from x in db.Wbs_WbsSet
|
||||
where x.WbsSetCode == wbsSetInit.SuperWbsSetCode && x.InstallationId == parentId && x.CnProfessionId == id
|
||||
select x.WbsSetId).FirstOrDefault();
|
||||
}
|
||||
wbsSet.ProjectId = this.CurrUser.LoginProjectId;
|
||||
wbsSet.StartDate = Funs.GetNewDateTime(planStart);
|
||||
wbsSet.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
wbsSet.Flag = wbsSetInit.Flag;
|
||||
wbsSet.Way = wbsSetInit.Way;
|
||||
wbsSet.Weights = wbsSetInit.Weights;
|
||||
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
|
||||
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
|
||||
wbsSet.Remark = wbsSetInit.Remark;
|
||||
wbsSet.IsIn = true;
|
||||
db.Wbs_WbsSet.InsertOnSubmit(wbsSet);
|
||||
db.SubmitChanges();
|
||||
var wbsSetMatchCostControls = wbsSetMatchCostControlInits.Where(x => x.WbsSetCode == wbsSetInit.WbsSetCode);
|
||||
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControls)
|
||||
{
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = wbsSet.WbsSetId;
|
||||
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
|
||||
if (wbsSetMatchCostControl.WbsSetId != null)
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
wbsSet.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
wbsSet.WbsSetCode = wbsSetInit.WbsSetCode;
|
||||
wbsSet.WbsSetName = wbsSetInit.WbsSetName;
|
||||
wbsSet.InstallationId = parentId;
|
||||
wbsSet.CnProfessionId = id;
|
||||
wbsSet.UnitProjectId = (from x in db.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.CnProfessionId == id select x.UnitProjectId).FirstOrDefault();
|
||||
if (wbsSetInit.SuperWbsSetCode == null)
|
||||
{
|
||||
db.WBS_WbsSetMatchCostControl.InsertOnSubmit(wbsSetMatchCostControl);
|
||||
db.SubmitChanges();
|
||||
//拷贝费用清单项
|
||||
var costControlInits = from x in totalCostControlInits where x.CostControlInitCode == wbsSetMatchCostControlInit.CostControlInitCode orderby x.CostControlInitCode select x;
|
||||
foreach (var costControlInit in costControlInits)
|
||||
wbsSet.SuperWbsSetId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
wbsSet.SuperWbsSetId = (from x in db.Wbs_WbsSet
|
||||
where x.WbsSetCode == wbsSetInit.SuperWbsSetCode && x.InstallationId == parentId && x.CnProfessionId == id
|
||||
select x.WbsSetId).FirstOrDefault();
|
||||
}
|
||||
wbsSet.ProjectId = this.CurrUser.LoginProjectId;
|
||||
wbsSet.StartDate = Funs.GetNewDateTime(planStart);
|
||||
wbsSet.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
wbsSet.Flag = wbsSetInit.Flag;
|
||||
wbsSet.Way = wbsSetInit.Way;
|
||||
wbsSet.Weights = wbsSetInit.Weights;
|
||||
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
|
||||
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
|
||||
wbsSet.Remark = wbsSetInit.Remark;
|
||||
wbsSet.IsIn = true;
|
||||
db.Wbs_WbsSet.InsertOnSubmit(wbsSet);
|
||||
db.SubmitChanges();
|
||||
var wbsSetMatchCostControls = wbsSetMatchCostControlInits.Where(x => x.WbsSetCode == wbsSetInit.WbsSetCode);
|
||||
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControls)
|
||||
{
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = wbsSet.WbsSetId;
|
||||
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
|
||||
if (wbsSetMatchCostControl.WbsSetId != null)
|
||||
{
|
||||
Model.WBS_CostControl costControl = new Model.WBS_CostControl();
|
||||
costControl.CostControlId = SQLHelper.GetNewID();
|
||||
costControl.ProjectId = this.CurrUser.LoginProjectId;
|
||||
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
|
||||
costControl.CostControlCode = costControlInit.CostControlInitCode;
|
||||
costControl.CostControlName = costControlInit.CostControlInitName;
|
||||
costControl.Unit = costControlInit.Unit;
|
||||
db.WBS_CostControl.InsertOnSubmit(costControl);
|
||||
db.WBS_WbsSetMatchCostControl.InsertOnSubmit(wbsSetMatchCostControl);
|
||||
db.SubmitChanges();
|
||||
//拷贝费用清单项
|
||||
var costControlInits = from x in totalCostControlInits where x.CostControlInitCode == wbsSetMatchCostControlInit.CostControlInitCode orderby x.CostControlInitCode select x;
|
||||
foreach (var costControlInit in costControlInits)
|
||||
{
|
||||
Model.WBS_CostControl costControl = new Model.WBS_CostControl();
|
||||
costControl.CostControlId = SQLHelper.GetNewID();
|
||||
costControl.ProjectId = this.CurrUser.LoginProjectId;
|
||||
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
|
||||
costControl.CostControlCode = costControlInit.CostControlInitCode;
|
||||
costControl.CostControlName = costControlInit.CostControlInitName;
|
||||
costControl.Unit = costControlInit.Unit;
|
||||
db.WBS_CostControl.InsertOnSubmit(costControl);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var oldInstallation = Funs.DB.Project_Installation.FirstOrDefault(x => x.InstallationName == name);
|
||||
if (oldInstallation == null)
|
||||
{
|
||||
Model.Project_Installation installation = new Model.Project_Installation();
|
||||
installation.InstallationId = id;
|
||||
installation.ProjectId = this.CurrUser.LoginProjectId;
|
||||
installation.InstallationCode = code;
|
||||
installation.InstallationName = name;
|
||||
installation.SuperInstallationId = sgId;
|
||||
installation.StartDate = Funs.GetNewDateTime(planStart);
|
||||
installation.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
installation.IsEnd = true;
|
||||
installation.Def = remark;
|
||||
db.Project_Installation.InsertOnSubmit(installation);
|
||||
db.SubmitChanges();
|
||||
// 拷贝总图等专业下WBS内容
|
||||
//拷贝单位工程及子单位工程
|
||||
var unitProjects = unitProjectInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var unitProjectInit in unitProjects)
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = new Model.Wbs_UnitProject();
|
||||
unitProject.UnitProjectId = SQLHelper.GetNewID(typeof(Model.Wbs_UnitProject));
|
||||
unitProject.UnitProjectCode = unitProjectInit.UnitProjectCode;
|
||||
unitProject.UnitProjectName = unitProjectInit.UnitProjectName;
|
||||
if (unitProjectInit.SuperUnitProject == null)
|
||||
{
|
||||
unitProject.SuperUnitProjectId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
unitProject.SuperUnitProjectId = (from x in Funs.DB.Wbs_UnitProject
|
||||
where x.UnitProjectCode == unitProjectInit.SuperUnitProject && x.InstallationId == id
|
||||
select x.UnitProjectId).FirstOrDefault();
|
||||
}
|
||||
unitProject.InstallationId = id;
|
||||
unitProject.SortIndex = unitProjectInit.SortIndex;
|
||||
unitProject.ProjectId = this.CurrUser.LoginProjectId;
|
||||
unitProject.StartDate = Funs.GetNewDateTime(planStart);
|
||||
unitProject.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
unitProject.Remark = unitProjectInit.Remark;
|
||||
unitProject.IsIn = true;
|
||||
db.Wbs_UnitProject.InsertOnSubmit(unitProject);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
//拷贝分部/子分部/分项/子分项
|
||||
var wbsSets = wbsSetInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var wbsSetInit in wbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
wbsSet.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
wbsSet.WbsSetCode = wbsSetInit.WbsSetCode;
|
||||
wbsSet.WbsSetName = wbsSetInit.WbsSetName;
|
||||
wbsSet.InstallationId = id;
|
||||
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == id select x.UnitProjectId).FirstOrDefault();
|
||||
if (wbsSetInit.SuperWbsSetCode == null)
|
||||
{
|
||||
wbsSet.SuperWbsSetId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
wbsSet.SuperWbsSetId = (from x in Funs.DB.Wbs_WbsSet
|
||||
where x.WbsSetCode == wbsSetInit.SuperWbsSetCode && x.InstallationId == id
|
||||
select x.WbsSetId).FirstOrDefault();
|
||||
}
|
||||
wbsSet.ProjectId = this.CurrUser.LoginProjectId;
|
||||
wbsSet.StartDate = Funs.GetNewDateTime(planStart);
|
||||
wbsSet.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
wbsSet.Flag = wbsSetInit.Flag;
|
||||
wbsSet.Way = wbsSetInit.Way;
|
||||
wbsSet.Weights = wbsSetInit.Weights;
|
||||
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
|
||||
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
|
||||
wbsSet.Remark = wbsSetInit.Remark;
|
||||
wbsSet.IsIn = true;
|
||||
db.Wbs_WbsSet.InsertOnSubmit(wbsSet);
|
||||
db.SubmitChanges();
|
||||
var wbsSetMatchCostControls = wbsSetMatchCostControlInits.Where(x => x.WbsSetCode == wbsSetInit.WbsSetCode);
|
||||
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControls)
|
||||
{
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = wbsSet.WbsSetId;
|
||||
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
|
||||
if (wbsSetMatchCostControl.WbsSetId != null)
|
||||
{
|
||||
db.WBS_WbsSetMatchCostControl.InsertOnSubmit(wbsSetMatchCostControl);
|
||||
db.SubmitChanges();
|
||||
//拷贝费用清单项
|
||||
var costControlInits = from x in totalCostControlInits where x.CostControlInitCode == wbsSetMatchCostControlInit.CostControlInitCode orderby x.CostControlInitCode select x;
|
||||
foreach (var costControlInit in costControlInits)
|
||||
{
|
||||
Model.WBS_CostControl costControl = new Model.WBS_CostControl();
|
||||
costControl.CostControlId = SQLHelper.GetNewID();
|
||||
costControl.ProjectId = this.CurrUser.LoginProjectId;
|
||||
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
|
||||
costControl.CostControlCode = costControlInit.CostControlInitCode;
|
||||
costControl.CostControlName = costControlInit.CostControlInitName;
|
||||
costControl.Unit = costControlInit.Unit;
|
||||
db.WBS_CostControl.InsertOnSubmit(costControl);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (level == "6" || level == "7")
|
||||
{
|
||||
if (name.Contains("防腐绝热") || name.Contains("地勘") || name.Contains("全厂地下主管网") || name.Contains("临时设施") || name.Contains("总图"))
|
||||
{
|
||||
var cn = cnProfessionInits.FirstOrDefault(x => x.CnProfessionName.Contains(name.Substring(0, 2)));
|
||||
if (cn != null)
|
||||
{
|
||||
var oldInstallation = Funs.DB.Project_Installation.FirstOrDefault(x => x.InstallationName == name);
|
||||
if (oldInstallation == null)
|
||||
{
|
||||
Model.Project_Installation installation = new Model.Project_Installation();
|
||||
installation.InstallationId = id;
|
||||
installation.ProjectId = this.CurrUser.LoginProjectId;
|
||||
installation.InstallationCode = code;
|
||||
installation.InstallationName = name;
|
||||
installation.SuperInstallationId = sgId;
|
||||
installation.StartDate = Funs.GetNewDateTime(planStart);
|
||||
installation.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
installation.IsEnd = true;
|
||||
installation.Def = remark;
|
||||
db.Project_Installation.InsertOnSubmit(installation);
|
||||
db.SubmitChanges();
|
||||
// 拷贝总图等专业下WBS内容
|
||||
//拷贝单位工程及子单位工程
|
||||
var unitProjects = unitProjectInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var unitProjectInit in unitProjects)
|
||||
{
|
||||
Model.Wbs_UnitProject unitProject = new Model.Wbs_UnitProject();
|
||||
unitProject.UnitProjectId = SQLHelper.GetNewID(typeof(Model.Wbs_UnitProject));
|
||||
unitProject.UnitProjectCode = unitProjectInit.UnitProjectCode;
|
||||
unitProject.UnitProjectName = unitProjectInit.UnitProjectName;
|
||||
if (unitProjectInit.SuperUnitProject == null)
|
||||
{
|
||||
unitProject.SuperUnitProjectId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
unitProject.SuperUnitProjectId = (from x in Funs.DB.Wbs_UnitProject
|
||||
where x.UnitProjectCode == unitProjectInit.SuperUnitProject && x.InstallationId == id
|
||||
select x.UnitProjectId).FirstOrDefault();
|
||||
}
|
||||
unitProject.InstallationId = id;
|
||||
unitProject.SortIndex = unitProjectInit.SortIndex;
|
||||
unitProject.ProjectId = this.CurrUser.LoginProjectId;
|
||||
unitProject.StartDate = Funs.GetNewDateTime(planStart);
|
||||
unitProject.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
unitProject.Remark = unitProjectInit.Remark;
|
||||
unitProject.IsIn = true;
|
||||
db.Wbs_UnitProject.InsertOnSubmit(unitProject);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
//拷贝分部/子分部/分项/子分项
|
||||
var wbsSets = wbsSetInits.Where(x => x.CnProfessionId == cn.CnProfessionId);
|
||||
foreach (var wbsSetInit in wbsSets)
|
||||
{
|
||||
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
|
||||
wbsSet.WbsSetId = SQLHelper.GetNewID(typeof(Model.Wbs_WbsSet));
|
||||
wbsSet.WbsSetCode = wbsSetInit.WbsSetCode;
|
||||
wbsSet.WbsSetName = wbsSetInit.WbsSetName;
|
||||
wbsSet.InstallationId = id;
|
||||
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == id select x.UnitProjectId).FirstOrDefault();
|
||||
if (wbsSetInit.SuperWbsSetCode == null)
|
||||
{
|
||||
wbsSet.SuperWbsSetId = null;
|
||||
}
|
||||
else
|
||||
{
|
||||
wbsSet.SuperWbsSetId = (from x in Funs.DB.Wbs_WbsSet
|
||||
where x.WbsSetCode == wbsSetInit.SuperWbsSetCode && x.InstallationId == id
|
||||
select x.WbsSetId).FirstOrDefault();
|
||||
}
|
||||
wbsSet.ProjectId = this.CurrUser.LoginProjectId;
|
||||
wbsSet.StartDate = Funs.GetNewDateTime(planStart);
|
||||
wbsSet.EndDate = Funs.GetNewDateTime(planFinish);
|
||||
wbsSet.Flag = wbsSetInit.Flag;
|
||||
wbsSet.Way = wbsSetInit.Way;
|
||||
wbsSet.Weights = wbsSetInit.Weights;
|
||||
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
|
||||
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
|
||||
wbsSet.Remark = wbsSetInit.Remark;
|
||||
wbsSet.IsIn = true;
|
||||
db.Wbs_WbsSet.InsertOnSubmit(wbsSet);
|
||||
db.SubmitChanges();
|
||||
var wbsSetMatchCostControls = wbsSetMatchCostControlInits.Where(x => x.WbsSetCode == wbsSetInit.WbsSetCode);
|
||||
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControls)
|
||||
{
|
||||
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
|
||||
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
|
||||
wbsSetMatchCostControl.WbsSetId = wbsSet.WbsSetId;
|
||||
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
|
||||
if (wbsSetMatchCostControl.WbsSetId != null)
|
||||
{
|
||||
db.WBS_WbsSetMatchCostControl.InsertOnSubmit(wbsSetMatchCostControl);
|
||||
db.SubmitChanges();
|
||||
//拷贝费用清单项
|
||||
var costControlInits = from x in totalCostControlInits where x.CostControlInitCode == wbsSetMatchCostControlInit.CostControlInitCode orderby x.CostControlInitCode select x;
|
||||
foreach (var costControlInit in costControlInits)
|
||||
{
|
||||
Model.WBS_CostControl costControl = new Model.WBS_CostControl();
|
||||
costControl.CostControlId = SQLHelper.GetNewID();
|
||||
costControl.ProjectId = this.CurrUser.LoginProjectId;
|
||||
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
|
||||
costControl.CostControlCode = costControlInit.CostControlInitCode;
|
||||
costControl.CostControlName = costControlInit.CostControlInitName;
|
||||
costControl.Unit = costControlInit.Unit;
|
||||
db.WBS_CostControl.InsertOnSubmit(costControl);
|
||||
db.SubmitChanges();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -388,6 +619,7 @@ namespace FineUIPro.Web.ProjectData
|
|||
}
|
||||
}
|
||||
ShowNotify("抽取成功!", MessageBoxIcon.Success);
|
||||
InitTreeMenu();
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -271,11 +271,11 @@ namespace FineUIPro.Web.ProjectData
|
|||
this.InsertDataTypeToProject(project.ProjectId);////初始化资料类别数据
|
||||
this.InsertConstructionStandardListToProject(project.ProjectId); ////初始化项目标准规范清单
|
||||
this.InsertITPListProject(project.ProjectId); // 初始化ITP列表
|
||||
this.InsertAC(project); //初始化防腐绝热
|
||||
this.InsertGE(project); //初始化地勘
|
||||
this.InsertUP(project); //初始化全厂地下主管网
|
||||
this.InsertTF(project); //初始化临时设施
|
||||
this.InsertGL(project); //初始化总图
|
||||
//this.InsertAC(project); //初始化防腐绝热
|
||||
//this.InsertGE(project); //初始化地勘
|
||||
//this.InsertUP(project); //初始化全厂地下主管网
|
||||
//this.InsertTF(project); //初始化临时设施
|
||||
//this.InsertGL(project); //初始化总图
|
||||
ShowNotify("保存数据成功!", MessageBoxIcon.Success);
|
||||
// 2. 关闭本窗体,然后刷新父窗体
|
||||
// PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
|
|
|
@ -482,7 +482,7 @@ namespace FineUIPro.Web
|
|||
/// <returns>数据表</returns>
|
||||
protected DataTable GetPagedDataTable(FineUIPro.Grid Grid1, DataTable tb)
|
||||
{
|
||||
int pageIndex = Grid1.PageIndex;
|
||||
int pageIndex = Grid1.PageIndex;
|
||||
int pageSize = Grid1.PageSize;
|
||||
|
||||
string sortField = Grid1.SortField;
|
||||
|
@ -882,7 +882,7 @@ namespace FineUIPro.Web
|
|||
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
|
||||
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
|
||||
sb.Append("<tr>");
|
||||
|
||||
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
|
@ -931,7 +931,7 @@ namespace FineUIPro.Web
|
|||
}
|
||||
}
|
||||
sb.AppendFormat("<td style='vnd.ms-excel.numberformat:@;width:140px;'>{0}</td>", html);
|
||||
// sb.AppendFormat("<td>{0}</td>", html);
|
||||
// sb.AppendFormat("<td>{0}</td>", html);
|
||||
}
|
||||
|
||||
sb.Append("</tr>");
|
||||
|
@ -950,15 +950,15 @@ namespace FineUIPro.Web
|
|||
public static string GetGridTableHtml2(Grid grid)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
|
||||
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/><html xmlns:x=\"urn:schemas-microsoft-com:office:excel\">");
|
||||
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
|
||||
sb.Append("<tr>");
|
||||
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
if (column.ColumnID != "AttachFile" && column.ColumnID!= "lbfAction1" && column.ColumnID != "AttachFile2")
|
||||
if (column.ColumnID != "AttachFile" && column.ColumnID != "lbfAction1" && column.ColumnID != "AttachFile2")
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
sb.AppendFormat("<td x:str>{0}</td>", column.HeaderText.Replace("<br/>", ""));
|
||||
}
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
|
|
Loading…
Reference in New Issue