0915-gaofei

This commit is contained in:
gaofei 2021-09-15 14:50:52 +08:00
parent 176d79aa61
commit c330245a88
51 changed files with 20672 additions and 1060 deletions

View File

@ -0,0 +1,218 @@
CREATE TABLE [dbo].[WBS_MilePost](
[MilePostId] [nvarchar](50) NOT NULL,
[ProjectId] [nvarchar](50) NULL,
[CnProfessionId] [int] NULL,
[MilePostName] [nvarchar](100) NULL,
[PlanDate] [datetime] NULL,
[RealDate] [datetime] NULL,
[CompileMan] [nvarchar](50) NULL,
[CompileDate] [datetime] NULL,
[Remark] [nvarchar](200) NULL,
CONSTRAINT [PK_WBS_MilePost] PRIMARY KEY CLUSTERED
(
[MilePostId] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[WBS_MilePost] WITH CHECK ADD CONSTRAINT [FK_WBS_MilePost_Base_Project] FOREIGN KEY([ProjectId])
REFERENCES [dbo].[Base_Project] ([ProjectId])
GO
ALTER TABLE [dbo].[WBS_MilePost] CHECK CONSTRAINT [FK_WBS_MilePost_Base_Project]
GO
ALTER TABLE [dbo].[WBS_MilePost] WITH CHECK ADD CONSTRAINT [FK_WBS_MilePost_Sys_User] FOREIGN KEY([CompileMan])
REFERENCES [dbo].[Sys_User] ([UserId])
GO
ALTER TABLE [dbo].[WBS_MilePost] CHECK CONSTRAINT [FK_WBS_MilePost_Sys_User]
GO
ALTER TABLE [dbo].[WBS_MilePost] WITH CHECK ADD CONSTRAINT [FK_WBS_MilePost_WBS_CnProfessionInit] FOREIGN KEY([CnProfessionId])
REFERENCES [dbo].[WBS_CnProfessionInit] ([CnProfessionId])
GO
ALTER TABLE [dbo].[WBS_MilePost] CHECK CONSTRAINT [FK_WBS_MilePost_WBS_CnProfessionInit]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WBS_MilePost', @level2type=N'COLUMN',@level2name=N'MilePostId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'项目Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WBS_MilePost', @level2type=N'COLUMN',@level2name=N'ProjectId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'专业Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WBS_MilePost', @level2type=N'COLUMN',@level2name=N'CnProfessionId'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'里程碑名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WBS_MilePost', @level2type=N'COLUMN',@level2name=N'MilePostName'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'计划完成日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WBS_MilePost', @level2type=N'COLUMN',@level2name=N'PlanDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'实际完成日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WBS_MilePost', @level2type=N'COLUMN',@level2name=N'RealDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编制人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WBS_MilePost', @level2type=N'COLUMN',@level2name=N'CompileMan'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'编制日期' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WBS_MilePost', @level2type=N'COLUMN',@level2name=N'CompileDate'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'备注' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WBS_MilePost', @level2type=N'COLUMN',@level2name=N'Remark'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'里程碑表' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'WBS_MilePost'
GO
alter table [dbo].[WBS_CostControlDetail] add StartDate datetime null
alter table [dbo].[WBS_CostControlDetail] add EndDate datetime null
alter table [dbo].[WBS_CostControlDetailHistory] add StartDate datetime null
alter table [dbo].[WBS_CostControlDetailHistory] add EndDate datetime null
GO
alter table [dbo].[WBS_CostControlParentDetail] add StartDate datetime null
alter table [dbo].[WBS_CostControlParentDetail] add EndDate datetime null
GO
ALTER VIEW [dbo].[View_WBS_CostControlParentDetail]
AS
/********控制项父级明细********/
SELECT detail.CostControlParentDetailId,
detail.ParentId,
detail.Months,
detail.StartDate,
detail.EndDate,
CONVERT(FLOAT,(select sum(ISNULL(ThisPlanValue,0)) from WBS_CostControlParentDetail
where ParentId=detail.ParentId and Months=detail.Months)) as ThisPlanValue, --
CONVERT(FLOAT,(select sum(ISNULL(d.ThisRealCost,0)) from WBS_CostControlParentDetail d
where d.ParentId=detail.ParentId and Months=detail.Months)) as ThisRealCost, --
CONVERT(FLOAT,(select sum(ISNULL(ThisPlanCost,0)) from WBS_CostControlParentDetail
where ParentId=detail.ParentId and Months=detail.Months)) as ThisPlanCost, --
CONVERT(FLOAT,(select sum(ISNULL(ThisPlanValue,0)) from WBS_CostControlParentDetail
where ParentId=detail.ParentId and Months<=detail.Months)) as TotalPlanValue, --
CONVERT(FLOAT,(select sum(ISNULL(d.ThisRealCost,0)) from WBS_CostControlParentDetail d
where d.ParentId=detail.ParentId and Months<=detail.Months)) as TotalRealCost, --
CONVERT(FLOAT,(select sum(ISNULL(ThisPlanCost,0)) from WBS_CostControlParentDetail
where ParentId=detail.ParentId and Months<=detail.Months)) as TotalPlanCost --
FROM dbo.WBS_CostControlParentDetail AS detail
GO
ALTER VIEW [dbo].[View_WBS_CostControlDetail]
AS
/********控制项明细********/
SELECT detail.CostControlDetailId,
detail.CostControlId,
detail.Months,
detail.StartDate,
detail.EndDate,
c.CostControlCode,
c.CostControlName,
c.WbsSetId,
c.ProjectId,
c.Unit, --
c.TotalNum, --
CONVERT(FLOAT,(select sum(ISNULL(PlanNum,0)) from WBS_CostControlDetail where CostControlId=detail.CostControlId and Months<=detail.Months and StartDate is null)) as TotalPlanNum, --
CONVERT(FLOAT,(select sum(ISNULL(ThisNum,0)) from WBS_CostControlDetail where CostControlId=detail.CostControlId and Months<=detail.Months)) as TotalThisNum, --
CONVERT(FLOAT,(select sum(ISNULL(d.PlanNum,0)) from WBS_CostControlDetail d
where d.CostControlId=detail.CostControlId and Months=detail.Months and StartDate is null)) as PlanNum, --
CONVERT(FLOAT,(select sum(ISNULL(d.ThisNum,0)) from WBS_CostControlDetail d
where d.CostControlId=detail.CostControlId and Months=detail.Months)) as ThisNum, --
c.RealPrice, --
c.PlanPrice, --
CONVERT(FLOAT,(select sum(ISNULL(d.PlanNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
where d.CostControlId=detail.CostControlId and Months=detail.Months and StartDate is null)) as ThisPlanValue, --
CONVERT(FLOAT,(select sum(ISNULL(d.ThisNum,0)*ISNULL(c1.RealPrice,0)) from WBS_CostControlDetail d
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
where d.CostControlId=detail.CostControlId and Months=detail.Months)) as ThisRealCost, --
CONVERT(FLOAT,(select sum(ISNULL(ThisNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
where d.CostControlId=detail.CostControlId and Months=detail.Months)) as ThisPlanCost, --
CONVERT(FLOAT,(select sum(ISNULL(d.PlanNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
where d.CostControlId=detail.CostControlId and Months<=detail.Months and StartDate is null)) as TotalPlanValue, --
CONVERT(FLOAT,(select sum(ISNULL(d.ThisNum,0)*ISNULL(c1.RealPrice,0)) from WBS_CostControlDetail d
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
where d.CostControlId=detail.CostControlId and Months<=detail.Months)) as TotalRealCost, --
CONVERT(FLOAT,(select sum(ISNULL(ThisNum,0)*ISNULL(c1.PlanPrice,0)) from WBS_CostControlDetail d
LEFT JOIN WBS_CostControl AS c1 ON c1.CostControlId=d.CostControlId
where d.CostControlId=detail.CostControlId and Months<=detail.Months)) as TotalPlanCost --
FROM dbo.WBS_CostControlDetail AS detail
LEFT JOIN WBS_CostControl AS c ON c.CostControlId=detail.CostControlId
GO
ALTER VIEW [dbo].[View_WBS_CostControlDetailStatistics]
AS
select InstallationId as Id,null as SupId ,InstallationName as Name,'Installation' as WBSType,null as OldCnProfessionId,null as OldUnitProjectCode,null as OldWbsSetCode,
ProjectId from dbo.Project_Installation where SuperInstallationId is null
Union
select InstallationId as Id,SuperInstallationId as SupId ,InstallationName as Name,'Installation' as WBSType,null as OldCnProfessionId,null as OldUnitProjectCode,null as OldWbsSetCode,
ProjectId from dbo.Project_Installation where SuperInstallationId is not null
Union
select CnProfessionId as Id , InstallationId as SupId,CnProfessionName as Name,'CnProfession' as WBSType,OldId as OldCnProfessionId,null as OldUnitProjectCode,null as OldWbsSetCode,
ProjectId from dbo.WBS_CnProfession where IsApprove=1
Union all
select UnitProjectId as Id, isnull(CnProfessionId,InstallationId) as SupId,UnitProjectName as Name,'UnitProject' as WBSType,
(case when u.CnProfessionId is null then (select CnProfessionId from WBS_CnProfessionInit where CnProfessionName=(select InstallationName from Project_Installation where InstallationId=u.InstallationId)) else (select OldId from WBS_CnProfession c where c.CnProfessionId=u.CnProfessionId) end) as OldCnProfessionId,UnitProjectCode as OldUnitProjectCode,null as OldWbsSetCode,
ProjectId from dbo.Wbs_UnitProject u where IsApprove=1
Union all
select WbsSetId as id,UnitProjectId as SupId, WbsSetName as Name,'WbsSet' as WBSType,
(case when w.CnProfessionId is null then (select CnProfessionId from WBS_CnProfessionInit where CnProfessionName=(select InstallationName from Project_Installation where InstallationId=w.InstallationId)) else (select OldId from WBS_CnProfession c where c.CnProfessionId=w.CnProfessionId) end) as OldCnProfessionId,(select UnitProjectCode from Wbs_UnitProject c where c.UnitProjectId=w.UnitProjectId) as OldUnitProjectCode,
WbsSetCode as OldWbsSetCode,
ProjectId from dbo.Wbs_WbsSet w where IsApprove=1 and SuperWbsSetId is null
Union all
select WbsSetId as id,SuperWbsSetId as SupId, WbsSetName as Name,'WbsSet' as WBSType,
(case when w.CnProfessionId is null then (select CnProfessionId from WBS_CnProfessionInit where CnProfessionName=(select InstallationName from Project_Installation where InstallationId=w.InstallationId)) else (select OldId from WBS_CnProfession c where c.CnProfessionId=w.CnProfessionId) end) as OldCnProfessionId,(select UnitProjectCode from Wbs_UnitProject c where c.UnitProjectId=w.UnitProjectId) as OldUnitProjectCode,
(select WbsSetCode from Wbs_WbsSet ws where ws.WbsSetId=w.SuperWbsSetId) as OldWbsSetCode,
ProjectId from dbo.Wbs_WbsSet w where IsApprove=1 and SuperWbsSetId is not null
Union all
select c.CostControlId as id,c.WbsSetId as SupId,c.CostControlName as Name,'CostControl' as WBSType,
(case when ws.CnProfessionId is null then (select CnProfessionId from WBS_CnProfessionInit where CnProfessionName=(select InstallationName from Project_Installation where InstallationId=ws.InstallationId)) else (select OldId from WBS_CnProfession cn where cn.CnProfessionId=(select top 1 CnProfessionId from Wbs_WbsSet w where w.WbsSetId=c.WbsSetId)) end) as OldCnProfessionId,
(select UnitProjectCode from Wbs_UnitProject u where u.UnitProjectId=(select top 1 UnitProjectId from Wbs_WbsSet w where w.WbsSetId=c.WbsSetId)) as OldUnitProjectCode,
(select WbsSetCode from Wbs_WbsSet u where u.WbsSetId=(select top 1 w.SuperWbsSetId from Wbs_WbsSet w where w.WbsSetId=c.WbsSetId)) as OldWbsSetCode,
c.ProjectId from dbo.WBS_CostControl c
left join dbo.Wbs_WbsSet ws on ws.WbsSetId=c.WbsSetId
where c.TotalNum is not null
GO

View File

@ -40,6 +40,19 @@ go
VALUES('DA8CC928-675F-4BF4-B684-87387629B339','59AAE0F0-2DB6-4065-B304-7E2C56EC3E5D','查询',1)
GO
INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
VALUES('9CAF311E-C234-4DA4-B235-D4E478FBD80E','里程碑','JDGL/WBS/MilePost.aspx',50,'0','Menu_JDGL',0,1,1)
GO
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('A1FAC2ED-A671-4656-AA6F-A2807A130D50','9CAF311E-C234-4DA4-B235-D4E478FBD80E','增加',1)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('BC0F5AF3-F9E9-4058-903E-3DD4A3C77158','9CAF311E-C234-4DA4-B235-D4E478FBD80E','修改',2)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('37319E6D-23C9-4CF0-B917-31AE86FD01F7','9CAF311E-C234-4DA4-B235-D4E478FBD80E','删除',3)
INSERT INTO dbo.Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex)
VALUES('60462BF3-3F78-4E17-8E15-451A108D5475','9CAF311E-C234-4DA4-B235-D4E478FBD80E','保存',4)
GO
--INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)
--VALUES('27C1D718-2DC0-42A5-96C0-F7A2D0DBC5F6','进度测量标志(权重)设置','',20,'0','Menu_JDGL',0,0,1)
--GO

View File

@ -2,4 +2,52 @@ delete from [dbo].[WBS_CnProfessionInit]
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(11,'ÍÁ½¨','CS',1)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(12,'设备','EQ',2)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(13,'管道','PI',3)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(14,'电气','EL',4)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(15,'仪表','ME',5)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(16,'电信','TC',6)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(17,'采暖通风','HV',7)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(18,'室内给排水','WS',8)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(19,'防腐绝热','AC',9)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(20,'地勘','GE',10)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(21,'全厂地下主管网','UP',11)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(22,'临时设施','TF',12)
GO
insert into dbo.WBS_CnProfessionInit(CnProfessionId,CnProfessionName,CnProfessionCode,SortIndex)
values(23,'总图','GL',13)
GO

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,12 @@
--
delete from [dbo].[WBS_WbsSetMatchCostControlInit]
delete from WBS_CostControlInit
delete from WBS_WbsSetInit
delete from Wbs_UnitProjectInit
delete from [dbo].[WBS_CnProfessionInit]
GO
--
delete from [dbo].[WBS_CostControlDetailHistory]
delete from WBS_CostControlParentDetail
delete from [dbo].[WBS_CostControlDetail]
@ -6,4 +15,5 @@ delete from [dbo].[WBS_CostControl]
delete from [dbo].[Wbs_WbsSet]
delete from [dbo].[Wbs_UnitProject]
delete from WBS_CnProfession
delete from [dbo].[Project_Installation] where InstallationName!='×Üͼ'
delete from [dbo].[Project_Installation] where InstallationName!='总图'
GO

View File

@ -0,0 +1,291 @@
--管道分部分项
insert into dbo.Wbs_UnitProjectInit(UnitProjectCode,UnitProjectName,SuperUnitProject,CnProfessionId,IsIn,SortIndex)
values('PP','工艺管道',null,13,1,1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PF01','管道现场制作',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PF0101','焊接DIN',13,'PF01','PP',1,70)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PF0102','检验',13,'PF01','PP',1,30)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PF02','管件现场制作',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PF0201','焊接DIN',13,'PF02','PP',1,70)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PF0202','检验',13,'PF02','PP',1,30)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP01','土(石)方',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0101','土石方开挖',13,'PP01','PP',1,40)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0102','管道基础施工',13,'PP01','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0103','土方回填',13,'PP01','PP',1,40)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP02','碳钢管道壁厚≤10mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0201','预制和安装DN',13,'PP02','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0202','试压',13,'PP02','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP03','碳钢管道10mm<壁厚≤20mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0301','预制和安装DN',13,'PP03','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0302','试压',13,'PP03','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP04','碳钢管道20mm<壁厚≤34mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0401','预制和安装DN',13,'PP04','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0402','试压',13,'PP04','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP05','碳钢管道34mm<壁厚≤51mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0501','预制和安装DN',13,'PP05','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0502','试压',13,'PP05','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP06','碳钢管道壁厚>51mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0601','预制和安装DN',13,'PP06','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0602','试压',13,'PP06','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP07','不锈钢管道壁厚≤10mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0701','预制和安装DN',13,'PP07','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0702','试压',13,'PP07','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP08','不锈钢管道10mm<壁厚≤20mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0801','预制和安装DN',13,'PP08','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0802','试压',13,'PP08','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP09','不锈钢管道20mm<壁厚≤34mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0901','预制和安装DN',13,'PP09','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP0902','试压',13,'PP09','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP10','不锈钢管道34mm<壁厚≤51mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1001','预制和安装DN',13,'PP10','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1002','试压',13,'PP10','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP11','不锈钢管道壁厚>51mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1101','预制和安装DN',13,'PP11','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1102','试压',13,'PP11','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP12','低合金钢管道壁厚≤10mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1201','预制和安装DN',13,'PP12','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1202','试压',13,'PP12','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP13','低合金钢管道10mm<壁厚≤20mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1301','预制和安装DN',13,'PP13','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1302','试压',13,'PP13','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP14','低合金钢管道壁厚20mm<壁厚≤34mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1401','预制和安装DN',13,'PP14','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1402','试压',13,'PP14','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP15','低合金钢管道34mm<壁厚≤51mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1501','预制和安装DN',13,'PP15','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1502','试压',13,'PP15','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP16','低合金钢管道壁厚>51mm',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1601','预制和安装DN',13,'PP16','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1602','试压',13,'PP16','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP17','特种材料管道',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1701','预制和安装DN',13,'PP17','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1702','试压',13,'PP17','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP18','衬里管道',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1801','预制和预安装(米)',13,'PP18','PP',1,30)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1802','衬里',13,'PP18','PP',1,25)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1803','安装',13,'PP18','PP',1,25)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1804','试压',13,'PP18','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP19','有色金属(其他材质)管道',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1901','预制和安装DN',13,'PP19','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP1902','试压',13,'PP19','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP20','非金属管道',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2001','预制和安装(米)',13,'PP20','PP',1,80)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2002','试压',13,'PP20','PP',1,20)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP21','管道支架安装',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2101','现场制作管架t/个)',13,'PP21','PP',1,null)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2102','成品管架t/个)',13,'PP21','PP',1,null)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2103','弹簧管架t/个)',13,'PP21','PP',1,null)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2104','保冷管托t/个)',13,'PP21','PP',1,null)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP22','伴热',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2201','伴热安装(米)',13,'PP22','PP',1,100)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP23','无损检测',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2301','无损检测DN',13,'PP23','PP',1,100)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP24','热处理',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2401','热处理DN',13,'PP24','PP',1,100)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP25','化学清洗',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2501','按系统',13,'PP25','PP',1,100)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP26','脱脂',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2601','按系统',13,'PP26','PP',1,100)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn)
values('PP27','吹洗',13,null,'PP',1)
GO
Insert into dbo.WBS_WbsSetInit(WbsSetCode,WbsSetName,CnProfessionId,SuperWbsSetCode,UnitProjectCode,IsIn,Weights)
values('PP2701','按系统',13,'PP27','PP',1,100)
GO

View File

@ -536,6 +536,7 @@
<Compile Include="JDGL\WBS\CostControlInitService.cs" />
<Compile Include="JDGL\WBS\CostControlParentDetailService.cs" />
<Compile Include="JDGL\WBS\CostControlService.cs" />
<Compile Include="JDGL\WBS\MilePostService.cs" />
<Compile Include="JDGL\WBS\UnitProjectInitService.cs" />
<Compile Include="JDGL\WBS\UnitProjectService.cs" />
<Compile Include="JDGL\WBS\WbsDetailHistoryService.cs" />

View File

@ -4716,6 +4716,11 @@ namespace BLL
/// </summary>
public const string WorkloadInputMenuId = "E3905BF1-289B-4500-BD34-36F97D649AFC";
/// <summary>
/// 里程碑
/// </summary>
public const string MilePostMenuId = "9CAF311E-C234-4DA4-B235-D4E478FBD80E";
/// <summary>
/// 进度测量标志(权重)设置
/// </summary>
@ -4807,6 +4812,31 @@ namespace BLL
/// </summary>
public const string EQCNProfessionalId = "FBC066BE-082F-4185-AE5C-016A12132ADE";
/// <summary>
/// 防腐绝热专业Id
/// </summary>
public const int ACCNProfessionalId = 19;
/// <summary>
/// 地勘专业Id
/// </summary>
public const int GECNProfessionalId = 20;
/// <summary>
/// 全厂地下主管网专业Id
/// </summary>
public const int UPCNProfessionalId = 21;
/// <summary>
/// 临时设施专业Id
/// </summary>
public const int TFCNProfessionalId = 22;
/// <summary>
/// 总图专业Id
/// </summary>
public const int GLCNProfessionalId = 23;
#region
/// <summary>
/// 同步设置

View File

@ -27,12 +27,21 @@ namespace BLL
}
/// <summary>
/// 根据Id获取对应费控项明细历史记录信息
/// 根据Id获取对应费控项明细历史记录信息
/// </summary>
/// <param name="toWbs">对应wbsId</param>
public static List<Model.WBS_CostControlDetailHistory> GetCostControlDetailHistorysByCostControlId(string costControlId)
public static List<Model.WBS_CostControlDetailHistory> GetMonthCostControlDetailHistorysByCostControlId(string costControlId)
{
return (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId orderby x.VersionNum, x.Months select x).ToList();
return (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId && x.StartDate == null orderby x.VersionNum, x.Months select x).ToList();
}
/// <summary>
/// 根据Id获取对应费控项周明细历史记录信息
/// </summary>
/// <param name="toWbs">对应wbsId</param>
public static List<Model.WBS_CostControlDetailHistory> GetWeekCostControlDetailHistorysByCostControlId(string costControlId, DateTime months)
{
return (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId && x.Months == months && x.StartDate != null orderby x.VersionNum, x.StartDate select x).ToList();
}
/// <summary>
@ -81,13 +90,28 @@ namespace BLL
}
/// <summary>
/// 根据CostControlId月获取当前最大版本
/// 根据CostControlId月获取当前月计划最大版本
/// </summary>
/// <param name="costControlId">costControlId</param>
public static int GetMaxVersionNumByCostControlId(string costControlId)
public static int GetMonthMaxVersionNumByCostControlId(string costControlId)
{
int i = 0;
var q = (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId orderby x.VersionNum descending select x.VersionNum ?? 0).ToList();
var q = (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId && x.StartDate == null orderby x.VersionNum descending select x.VersionNum ?? 0).ToList();
if (q.Count > 0)
{
i = q[0];
}
return i;
}
/// <summary>
/// 根据CostControlId月获取当前周计划最大版本
/// </summary>
/// <param name="costControlId">costControlId</param>
public static int GetWeekMaxVersionNumByCostControlId(string costControlId, DateTime months)
{
int i = 0;
var q = (from x in Funs.DB.WBS_CostControlDetailHistory where x.CostControlId == costControlId && x.Months == months && x.StartDate != null orderby x.VersionNum descending select x.VersionNum ?? 0).ToList();
if (q.Count > 0)
{
i = q[0];
@ -106,6 +130,8 @@ namespace BLL
newWBS_CostControlDetailHistory.CostControlDetailHistoryId = costControlDetailHistory.CostControlDetailHistoryId;
newWBS_CostControlDetailHistory.CostControlId = costControlDetailHistory.CostControlId;
newWBS_CostControlDetailHistory.Months = costControlDetailHistory.Months;
newWBS_CostControlDetailHistory.StartDate = costControlDetailHistory.StartDate;
newWBS_CostControlDetailHistory.EndDate = costControlDetailHistory.EndDate;
newWBS_CostControlDetailHistory.PlanNum = costControlDetailHistory.PlanNum;
newWBS_CostControlDetailHistory.VersionNum = costControlDetailHistory.VersionNum;
@ -121,6 +147,8 @@ namespace BLL
{
Model.SGGLDB db = Funs.DB;
Model.WBS_CostControlDetailHistory newWBS_CostControlDetailHistory = db.WBS_CostControlDetailHistory.First(e => e.CostControlDetailHistoryId == costControlDetailHistory.CostControlDetailHistoryId);
newWBS_CostControlDetailHistory.StartDate = costControlDetailHistory.StartDate;
newWBS_CostControlDetailHistory.EndDate = costControlDetailHistory.EndDate;
newWBS_CostControlDetailHistory.PlanNum = costControlDetailHistory.PlanNum;
db.SubmitChanges();

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.UI.WebControls;
namespace BLL
{
@ -35,7 +36,19 @@ namespace BLL
/// <param name="months">月</param>
public static Model.WBS_CostControlDetail GetCostControlDetailByCostControlIdAndMonths(string costControlId, DateTime months)
{
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months select x).FirstOrDefault();
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == null select x).FirstOrDefault();
}
/// <summary>
/// 根据costControlId和年及月获取对应费控项明细信息
/// </summary>
/// <param name="costControlId">对应wbsId</param>
/// <param name="toFlag">对应标志</param>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static Model.WBS_CostControlDetail GetCostControlDetailByCostControlIdAndMonthsWeek(string costControlId, DateTime months,DateTime startDate)
{
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == startDate select x).FirstOrDefault();
}
/// <summary>
@ -57,9 +70,21 @@ namespace BLL
/// <param name="toFlag">对应标志</param>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static Model.View_WBS_CostControlDetail GetViewCostControlDetailByCostControlIdYearMonth(string costControlId, DateTime months)
public static Model.View_WBS_CostControlDetail GetViewCostControlDetailByCostControlIdAndMonth(string costControlId, DateTime months)
{
return (from x in Funs.DB.View_WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months select x).FirstOrDefault();
return (from x in Funs.DB.View_WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == null select x).FirstOrDefault();
}
/// <summary>
/// 根据costControlId和年及月获取对应费控项明细信息
/// </summary>
/// <param name="costControlId">对应wbsId</param>
/// <param name="toFlag">对应标志</param>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static Model.View_WBS_CostControlDetail GetViewCostControlDetailByCostControlIdAndMonthWeek(string costControlId, DateTime months, DateTime startDate)
{
return (from x in Funs.DB.View_WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate == startDate select x).FirstOrDefault();
}
public static Model.WBS_CostControlDetail GetWBS_CostControlDetailByCostControlId(string costControlId)
@ -74,7 +99,7 @@ namespace BLL
/// <param name="toFlag"></param>
/// <param name="months"></param>
/// <returns></returns>
public static bool IsExitWBS_CostControlDetailByCostControlIdOrMonth(string costControlId, DateTime months)
public static bool IsExitWeekCostControlDetailByCostControlIdAndMonth(string costControlId, DateTime months)
{
bool result = false;
var q = Funs.DB.WBS_CostControlDetail.FirstOrDefault(e => e.CostControlId == costControlId && e.Months == months);
@ -99,9 +124,18 @@ namespace BLL
/// 根据CostControlId月获取所有月份的对应费控项明细信息集合
/// </summary>
/// <param name="costControlId">costControlId</param>
public static List<Model.WBS_CostControlDetail> GetCostControlDetailsByCostControlId(string costControlId)
public static List<Model.WBS_CostControlDetail> GetMonthCostControlDetailsByCostControlId(string costControlId)
{
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId orderby x.Months select x).ToList();
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.StartDate == null orderby x.Months select x).ToList();
}
/// <summary>
/// 根据CostControlId月获取对应月份的对应费控项周明细信息集合
/// </summary>
/// <param name="costControlId">costControlId</param>
public static List<Model.WBS_CostControlDetail> GetWeekCostControlDetailsByCostControlId(string costControlId, DateTime months)
{
return (from x in Funs.DB.WBS_CostControlDetail where x.CostControlId == costControlId && x.Months == months && x.StartDate != null orderby x.StartDate select x).ToList();
}
/// <summary>
@ -115,6 +149,8 @@ namespace BLL
newWBS_CostControlDetail.CostControlDetailId = costControlDetail.CostControlDetailId;
newWBS_CostControlDetail.CostControlId = costControlDetail.CostControlId;
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;
@ -130,6 +166,8 @@ namespace BLL
{
Model.SGGLDB db = Funs.DB;
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;
@ -162,5 +200,54 @@ namespace BLL
db.SubmitChanges();
}
}
/// <summary>
/// 周计划下拉框
/// </summary>
/// <param name="dropName">下拉框名字</param>
/// <param name="isShowPlease">是否显示请选择</param>
public static void InitWeekPlanList(FineUIPro.DropDownList dropName, string costControlId, DateTime months, bool isShowPlease)
{
dropName.DataValueField = "Value";
dropName.DataTextField = "Text";
dropName.DataSource = GetWeekPlanList(costControlId, months);
dropName.DataBind();
if (isShowPlease)
{
Funs.FineUIPleaseSelect(dropName);
}
}
/// <summary>
/// 根据费控项Id和月份获取对应月份的周计划记录
/// </summary>
/// <param name="projectId">项目Id</param>
/// <returns></returns>
public static ListItem[] GetWeekPlanList(string costControlId, DateTime months)
{
var q = (from x in Funs.DB.WBS_CostControlDetail
where x.CostControlId == costControlId && x.Months == months && x.StartDate != null
orderby x.StartDate
select x).ToList();
ListItem[] list = new ListItem[q.Count()];
string dateStr = string.Empty, date = string.Empty;
for (int i = 0; i < list.Count(); i++)
{
date = string.Empty;
dateStr = string.Empty;
if (q[i].StartDate != null)
{
dateStr = string.Format("{0:yyyy-MM-dd}", q[i].StartDate);
date = string.Format("{0:yyyy-MM-dd}", q[i].StartDate);
}
if (q[i].EndDate != null)
{
dateStr += "至" + string.Format("{0:yyyy-MM-dd}", q[i].EndDate);
date += "," + string.Format("{0:yyyy-MM-dd}", q[i].EndDate);
}
list[i] = new ListItem(dateStr, date);
}
return list;
}
}
}

View File

@ -27,7 +27,7 @@ namespace BLL
}
/// <summary>
/// 根据costControlParentId和年及月获取对应费控项父级明细信息
/// 根据costControlParentId和年及月获取对应费控项父级明细信息
/// </summary>
/// <param name="costControlParentId">对应wbsId</param>
/// <param name="toFlag">对应标志</param>
@ -35,7 +35,19 @@ namespace BLL
/// <param name="months">月</param>
public static Model.WBS_CostControlParentDetail GetCostControlParentDetailByParentIdAndMonths(string parentId, DateTime months)
{
return (from x in Funs.DB.WBS_CostControlParentDetail where x.ParentId == parentId && x.Months == months select x).FirstOrDefault();
return (from x in Funs.DB.WBS_CostControlParentDetail where x.ParentId == parentId && x.Months == months && x.StartDate == null select x).FirstOrDefault();
}
/// <summary>
/// 根据costControlParentId和年及月获取对应周费控项父级明细信息
/// </summary>
/// <param name="costControlParentId">对应wbsId</param>
/// <param name="toFlag">对应标志</param>
/// <param name="years">年</param>
/// <param name="months">月</param>
public static Model.WBS_CostControlParentDetail GetCostControlParentDetailByParentIdAndMonthsWeek(string parentId, DateTime months, DateTime startDate)
{
return (from x in Funs.DB.WBS_CostControlParentDetail where x.ParentId == parentId && x.Months == months && x.StartDate == startDate select x).FirstOrDefault();
}
/// <summary>
@ -93,6 +105,8 @@ namespace BLL
newWBS_CostControlParentDetail.CostControlParentDetailId = costControlParentDetail.CostControlParentDetailId;
newWBS_CostControlParentDetail.ParentId = costControlParentDetail.ParentId;
newWBS_CostControlParentDetail.Months = costControlParentDetail.Months;
newWBS_CostControlParentDetail.StartDate = costControlParentDetail.StartDate;
newWBS_CostControlParentDetail.EndDate = costControlParentDetail.EndDate;
newWBS_CostControlParentDetail.ThisPlanValue = costControlParentDetail.ThisPlanValue;
newWBS_CostControlParentDetail.ThisRealCost = costControlParentDetail.ThisRealCost;
newWBS_CostControlParentDetail.ThisPlanCost = costControlParentDetail.ThisPlanCost;

View File

@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
/// <summary>
/// 里程碑
/// </summary>
public static class MilePostService
{
/// <summary>
/// 根据主键获取里程碑
/// </summary>
/// <param name="milePostId"></param>
/// <returns></returns>
public static Model.WBS_MilePost GetMilePostById(string milePostId)
{
return Funs.DB.WBS_MilePost.FirstOrDefault(e => e.MilePostId == milePostId);
}
/// <summary>
/// 添加里程碑
/// </summary>
/// <param name="milePost"></param>
public static void AddMilePost(Model.WBS_MilePost milePost)
{
Model.WBS_MilePost newMilePost = new Model.WBS_MilePost
{
MilePostId = milePost.MilePostId,
ProjectId = milePost.ProjectId,
CnProfessionId = milePost.CnProfessionId,
MilePostName = milePost.MilePostName,
PlanDate = milePost.PlanDate,
RealDate = milePost.RealDate,
CompileMan = milePost.CompileMan,
CompileDate = milePost.CompileDate,
Remark = milePost.Remark
};
Funs.DB.WBS_MilePost.InsertOnSubmit(newMilePost);
Funs.DB.SubmitChanges();
}
/// <summary>
/// 修改里程碑
/// </summary>
/// <param name="milePost"></param>
public static void UpdateMilePost(Model.WBS_MilePost milePost)
{
Model.WBS_MilePost newMilePost = Funs.DB.WBS_MilePost.FirstOrDefault(e => e.MilePostId == milePost.MilePostId);
if (newMilePost != null)
{
newMilePost.CnProfessionId = milePost.CnProfessionId;
newMilePost.MilePostName = milePost.MilePostName;
newMilePost.PlanDate = milePost.PlanDate;
newMilePost.RealDate = milePost.RealDate;
newMilePost.Remark = milePost.Remark;
Funs.DB.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除里程碑
/// </summary>
/// <param name="milePostId"></param>
public static void DeleteMilePostById(string milePostId)
{
Model.WBS_MilePost milePost = Funs.DB.WBS_MilePost.FirstOrDefault(e => e.MilePostId == milePostId);
if (milePost != null)
{
CommonService.DeleteAttachFileById(milePostId);
Funs.DB.WBS_MilePost.DeleteOnSubmit(milePost);
Funs.DB.SubmitChanges();
}
}
}
}

View File

@ -46,6 +46,27 @@ namespace BLL
return list;
}
/// <summary>
/// 根据装置、专业Id和分部编号获取分部Id
/// </summary>
/// <param name="unitProjectId">专业Id</param>
/// <returns></returns>
public static Model.Wbs_UnitProject GetUnitProjectIdByInstallationId(string installationId)
{
Model.SGGLDB db = Funs.DB;
string inId = string.Empty;
Model.Project_Installation ins = db.Project_Installation.FirstOrDefault(x => x.InstallationId == installationId);
if (ins.IsEnd == true)
{
inId = installationId;
}
else
{
inId = Project_InstallationService.GetEndInstallationId(installationId);
}
return (from x in db.Wbs_UnitProject where x.InstallationId==inId select x).FirstOrDefault();
}
/// <summary>
/// 根据装置、专业Id和分部编号获取分部Id
/// </summary>

File diff suppressed because it is too large Load Diff

View File

@ -216,67 +216,67 @@ namespace Web.Controls
chartArea.Area3DStyle.Enable3D = false;
chart1.ChartAreas.Add(chartArea);
chart1.Series.Add("本月计划完成预算");
chart1.Series.Add("本月完成预算");
chart1.Series.Add("本月实际成本");
chart1.Series.Add("累计计划完成预算");
chart1.Series.Add("累计完成预算");
chart1.Series.Add("累计完成成本");
chart1.Series.Add("本月计划工作预算费用");
chart1.Series.Add("本月已完工作预算费用");
chart1.Series.Add("本月已完工作实际费用");
chart1.Series.Add("累计计划工作预算费用");
chart1.Series.Add("累计已完工作预算费用");
chart1.Series.Add("累计已完工作实际费用");
DataView dv = dt.DefaultView;
chart1.Series["本月计划完成预算"].Points.DataBindXY(dv, "月份", dv, "本月计划完成预算");
chart1.Series["本月计划完成预算"].ChartType = SeriesChartType.Column;
chart1.Series["本月计划工作预算费用"].Points.DataBindXY(dv, "月份", dv, "本月计划工作预算费用");
chart1.Series["本月计划工作预算费用"].ChartType = SeriesChartType.Column;
for (int i = 0; i < chart1.Series["本月计划完成预算"].Points.Count; i++)
for (int i = 0; i < chart1.Series["本月计划工作预算费用"].Points.Count; i++)
{
chart1.Series["本月计划完成预算"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["本月计划工作预算费用"].Points[i].ToolTip = "#VALX,#VALY";
}
chart1.Series["本月完成预算"].Points.DataBindXY(dv, "月份", dv, "本月完成预算");
chart1.Series["本月完成预算"].ChartType = SeriesChartType.Column;
chart1.Series["本月已完工作预算费用"].Points.DataBindXY(dv, "月份", dv, "本月已完工作预算费用");
chart1.Series["本月已完工作预算费用"].ChartType = SeriesChartType.Column;
for (int i = 0; i < chart1.Series["本月完成预算"].Points.Count; i++)
for (int i = 0; i < chart1.Series["本月已完工作预算费用"].Points.Count; i++)
{
chart1.Series["本月完成预算"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["本月已完工作预算费用"].Points[i].ToolTip = "#VALX,#VALY";
}
chart1.Series["本月实际成本"].Points.DataBindXY(dv, "月份", dv, "本月实际成本");
chart1.Series["本月实际成本"].ChartType = SeriesChartType.Column;
chart1.Series["本月已完工作实际费用"].Points.DataBindXY(dv, "月份", dv, "本月已完工作实际费用");
chart1.Series["本月已完工作实际费用"].ChartType = SeriesChartType.Column;
for (int i = 0; i < chart1.Series["本月实际成本"].Points.Count; i++)
for (int i = 0; i < chart1.Series["本月已完工作实际费用"].Points.Count; i++)
{
chart1.Series["本月实际成本"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["本月已完工作实际费用"].Points[i].ToolTip = "#VALX,#VALY";
}
chart1.Series["累计计划完成预算"].Points.DataBindXY(dv, "月份", dv, "累计计划完成预算");
chart1.Series["累计计划完成预算"].ChartType = SeriesChartType.Spline;
chart1.Series["累计计划完成预算"].Color = Color.Blue;
chart1.Series["累计计划完成预算"].BorderWidth = 2;
chart1.Series["累计计划工作预算费用"].Points.DataBindXY(dv, "月份", dv, "累计计划工作预算费用");
chart1.Series["累计计划工作预算费用"].ChartType = SeriesChartType.Spline;
chart1.Series["累计计划工作预算费用"].Color = Color.Blue;
chart1.Series["累计计划工作预算费用"].BorderWidth = 2;
for (int i = 0; i < chart1.Series["累计计划完成预算"].Points.Count; i++)
for (int i = 0; i < chart1.Series["累计计划工作预算费用"].Points.Count; i++)
{
chart1.Series["累计计划完成预算"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["累计计划工作预算费用"].Points[i].ToolTip = "#VALX,#VALY";
}
chart1.Series["累计完成预算"].Points.DataBindXY(dv, "月份", dv, "累计完成预算");
chart1.Series["累计完成预算"].ChartType = SeriesChartType.Spline;
chart1.Series["累计完成预算"].Color = Color.MediumSeaGreen;
chart1.Series["累计完成预算"].BorderWidth = 2;
chart1.Series["累计已完工作预算费用"].Points.DataBindXY(dv, "月份", dv, "累计已完工作预算费用");
chart1.Series["累计已完工作预算费用"].ChartType = SeriesChartType.Spline;
chart1.Series["累计已完工作预算费用"].Color = Color.MediumSeaGreen;
chart1.Series["累计已完工作预算费用"].BorderWidth = 2;
for (int i = 0; i < chart1.Series["累计完成预算"].Points.Count; i++)
for (int i = 0; i < chart1.Series["累计已完工作预算费用"].Points.Count; i++)
{
chart1.Series["累计完成预算"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["累计已完工作预算费用"].Points[i].ToolTip = "#VALX,#VALY";
}
chart1.Series["累计完成成本"].Points.DataBindXY(dv, "月份", dv, "累计完成成本");
chart1.Series["累计完成成本"].ChartType = SeriesChartType.Spline;
chart1.Series["累计完成成本"].Color = Color.Red;
chart1.Series["累计完成成本"].BorderWidth = 2;
chart1.Series["累计已完工作实际费用"].Points.DataBindXY(dv, "月份", dv, "累计已完工作实际费用");
chart1.Series["累计已完工作实际费用"].ChartType = SeriesChartType.Spline;
chart1.Series["累计已完工作实际费用"].Color = Color.Red;
chart1.Series["累计已完工作实际费用"].BorderWidth = 2;
for (int i = 0; i < chart1.Series["累计完成成本"].Points.Count; i++)
for (int i = 0; i < chart1.Series["累计已完工作实际费用"].Points.Count; i++)
{
chart1.Series["累计完成成本"].Points[i].ToolTip = "#VALX,#VALY";
chart1.Series["累计已完工作实际费用"].Points[i].ToolTip = "#VALX,#VALY";
}
Controls.Add(chart1);

View File

@ -29,26 +29,26 @@
<Items>
<f:Grid ID="Grid1" runat="server" Width="820px" ShowHeader="false" Height="200px" EnableColumnLines="true" ForceFit="true">
<Columns>
<f:RenderField Width="109px" ColumnID="月份" DataField="月份"
<f:RenderField Width="100px" ColumnID="月份" DataField="月份"
FieldType="String" HeaderText="月份" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="109px" ColumnID="本月实际成本" DataField="本月实际成本"
FieldType="Double" HeaderText="本月实际成本" HeaderTextAlign="Center" TextAlign="Left">
<f:RenderField Width="150px" ColumnID="本月已完工作实际费用" DataField="本月已完工作实际费用"
FieldType="Double" HeaderText="本月已完工作实际费用" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="109px" ColumnID="累计完成成本" DataField="累计完成成本"
FieldType="Double" HeaderText="累计完成成本" HeaderTextAlign="Center" TextAlign="Left">
<f:RenderField Width="150px" ColumnID="累计已完工作实际费用" DataField="累计已完工作实际费用"
FieldType="Double" HeaderText="累计已完工作实际费用" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="109px" ColumnID="本月计划完成预算" DataField="本月计划完成预算"
FieldType="Double" HeaderText="本月计划完成预算" HeaderTextAlign="Center" TextAlign="Left">
<f:RenderField Width="150px" ColumnID="本月计划工作预算费用" DataField="本月计划工作预算费用"
FieldType="Double" HeaderText="本月计划工作预算费用" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="109px" ColumnID="累计计划完成预算" DataField="累计计划完成预算"
FieldType="Double" HeaderText="累计计划完成预算" HeaderTextAlign="Center" TextAlign="Left">
<f:RenderField Width="150px" ColumnID="累计计划工作预算费用" DataField="累计计划工作预算费用"
FieldType="Double" HeaderText="累计计划工作预算费用" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="109px" ColumnID="本月完成预算" DataField="本月完成预算"
FieldType="Double" HeaderText="本月完成预算" HeaderTextAlign="Center" TextAlign="Left">
<f:RenderField Width="150px" ColumnID="本月已完工作预算费用" DataField="本月已完工作预算费用"
FieldType="Double" HeaderText="本月已完工作预算费用" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="109px" ColumnID="累计完成预算" DataField="累计完成预算"
FieldType="Double" HeaderText="累计完成预算" HeaderTextAlign="Center" TextAlign="Left">
<f:RenderField Width="150px" ColumnID="累计已完工作预算费用" DataField="累计已完工作预算费用"
FieldType="Double" HeaderText="累计已完工作预算费用" HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
</Columns>
</f:Grid>

View File

@ -305,7 +305,7 @@ namespace FineUIPro.Web.JDGL.CostAnalysis
if (costControl != null)
{
string strSql = "select distinct (cast(YEAR(Months) as varchar(4))+'.'+cast(MONTH(Months) as varchar(2))) as 月份,t.Months," +
"ThisRealCost as 本月实际成本,ThisPlanCost as 本月完成预算,ThisPlanValue as 本月计划完成预算,TotalPlanValue as 累计计划完成预算,TotalRealCost as 累计完成成本,TotalPlanCost as 累计完成预算 " +
"ThisRealCost as 本月已完工作实际费用,ThisPlanCost as 本月已完工作预算费用,ThisPlanValue as 本月计划工作预算费用,TotalPlanValue as 累计计划工作预算费用,TotalRealCost as 累计已完工作实际费用,TotalPlanCost as 累计已完工作预算费用 " +
"from dbo.View_WBS_CostControlDetail as t where CostControlId=@Id order by t.Months";
//string date = DateTime.Now.Year + "-" + DateTime.Now.Month + "-01";
SqlParameter[] parameter = new SqlParameter[]
@ -321,7 +321,7 @@ namespace FineUIPro.Web.JDGL.CostAnalysis
else
{
string strSql = "select distinct (cast(YEAR(Months) as varchar(4))+'.'+cast(MONTH(Months) as varchar(2))) as 月份,t.Months," +
"ThisRealCost as 本月实际成本,ThisPlanCost as 本月完成预算,ThisPlanValue as 本月计划完成预算,TotalPlanValue as 累计计划完成预算,TotalRealCost as 累计完成成本,TotalPlanCost as 累计完成预算 " +
"ThisRealCost as 本月已完工作实际费用,ThisPlanCost as 本月已完工作预算费用,ThisPlanValue as 本月计划工作预算费用,TotalPlanValue as 累计计划工作预算费用,TotalRealCost as 累计已完工作实际费用,TotalPlanCost as 累计已完工作预算费用 " +
"from dbo.View_WBS_CostControlParentDetail as t where ParentId=@Id order by t.Months";
//string date = DateTime.Now.Year + "-" + DateTime.Now.Month + "-01";
SqlParameter[] parameter = new SqlParameter[]

View File

@ -37,7 +37,7 @@ namespace FineUIPro.Web.JDGL.WBS
{
this.txtCostControlName.Text = costControl.CostControlName;
}
var list = BLL.CostControlDetailService.GetCostControlDetailsByCostControlId(this.Id);
var list = BLL.CostControlDetailService.GetMonthCostControlDetailsByCostControlId(this.Id);
this.Grid1.DataSource = list;
this.Grid1.DataBind();
}
@ -138,7 +138,7 @@ namespace FineUIPro.Web.JDGL.WBS
protected void btnUpdate_Click(object sender, EventArgs e)
{
var list = GetDetails();
int versionNum = BLL.CostControlDetailHistoryService.GetMaxVersionNumByCostControlId(this.Id);
int versionNum = BLL.CostControlDetailHistoryService.GetMonthMaxVersionNumByCostControlId(this.Id);
foreach (var item in list)
{
Model.WBS_CostControlDetailHistory detailHistory = new Model.WBS_CostControlDetailHistory();

View File

@ -29,8 +29,7 @@ namespace FineUIPro.Web.JDGL.WBS
/// </summary>
private void BindGrid()
{
string column1 = string.Empty;
List<Model.WBS_CostControlDetailHistory> detailHistorys = BLL.CostControlDetailHistoryService.GetCostControlDetailHistorysByCostControlId(Request.Params["Id"]);
List<Model.WBS_CostControlDetailHistory> detailHistorys = BLL.CostControlDetailHistoryService.GetMonthCostControlDetailHistorysByCostControlId(Request.Params["Id"]);
Grid1.DataSource = detailHistorys;
Grid1.DataBind();
}

View File

@ -26,7 +26,7 @@
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtUnit" runat="server" Label="单位" LabelWidth="130px" Required="true" ShowRedStar="true"></f:TextBox>
<f:TextBox ID="txtUnit" runat="server" Label="单位" LabelWidth="130px" ></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>

View File

@ -26,7 +26,7 @@
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtUnit" runat="server" Label="单位" LabelWidth="130px" Required="true" ShowRedStar="true"></f:TextBox>
<f:TextBox ID="txtUnit" runat="server" Label="单位" LabelWidth="130px" ></f:TextBox>
</Items>
</f:FormRow>
</Rows>

View File

@ -0,0 +1,58 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CostControlWeekDetailEdit.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.CostControlWeekDetailEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="费控项计划" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="CostControlDetailId" AllowCellEditing="true"
ClicksToEdit="1" DataIDField="CostControlDetailId" AllowSorting="true" SortField="Months"
SortDirection="ASC" EnableColumnLines="true" ForceFit="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="100" OnRowCommand="Grid1_RowCommand"
EnableRowDoubleClickEvent="true" AllowFilters="true" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:Label ID="txtCostControlName" runat="server" Width="220px" LabelWidth="50px"
LabelAlign="Right">
</f:Label>
<f:ToolbarFill runat="server"></f:ToolbarFill>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="100px" ColumnID="Months" DataField="Months"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM" HeaderText="月份" TextAlign="Center"
HeaderTextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="PlanNum" DataField="PlanNum" FieldType="Double"
HeaderText="本月计划完成量" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:LinkButtonField Width="100px" TextAlign="Center" HeaderText="设置周计划" ToolTip="设置周计划" CommandName="SetWeek" Text="设置周计划"
/>
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="设置周计划" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Top" EnableResize="true" runat="server" IsModal="true" Width="800px"
Height="550px">
</f:Window>
</form>
</body>
</html>

View File

@ -0,0 +1,94 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Newtonsoft.Json.Linq;
namespace FineUIPro.Web.JDGL.WBS
{
public partial class CostControlWeekDetailEdit : PageBase
{
/// <summary>
/// 控制项主键
/// </summary>
public string Id
{
get
{
return (string)ViewState["Id"];
}
set
{
ViewState["Id"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.Id = Request.Params["Id"];
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(this.Id);
if (costControl != null)
{
this.txtCostControlName.Text = costControl.CostControlName;
}
var list = BLL.CostControlDetailService.GetMonthCostControlDetailsByCostControlId(this.Id);
this.Grid1.DataSource = list;
this.Grid1.DataBind();
}
}
#region
/// <summary>
/// 增加按钮事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
var list = GetDetails();
Model.WBS_CostControlDetail detail = new Model.WBS_CostControlDetail();
detail.CostControlDetailId = SQLHelper.GetNewID();
list.Add(detail);
Grid1.DataSource = list;
Grid1.DataBind();
}
#endregion
private List<Model.WBS_CostControlDetail> GetDetails()
{
List<Model.WBS_CostControlDetail> details = new List<Model.WBS_CostControlDetail>();
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("index");
Model.WBS_CostControlDetail detail = new Model.WBS_CostControlDetail();
detail.CostControlDetailId = Grid1.Rows[i].RowID;
detail.CostControlId = this.Id;
detail.Months = Funs.GetNewDateTime(values.Value<string>("Months") + "-01");
detail.PlanNum = Funs.GetNewDecimal(values.Value<string>("PlanNum"));
details.Add(detail);
}
return details;
}
#region
/// <summary>
/// Grid行点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
string detailId = Grid1.DataKeys[e.RowIndex][0].ToString();
var list = GetDetails();
if (e.CommandName == "SetWeek")//设置周计划
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CostControlWeekItemDetailEdit.aspx?Id={0}", detailId, "修改 - ")));
}
}
#endregion
}
}

View File

@ -0,0 +1,87 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.JDGL.WBS {
public partial class CostControlWeekDetailEdit {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// txtCostControlName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtCostControlName;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
}
}

View File

@ -0,0 +1,51 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CostControlWeekDetailHistoryShow.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.CostControlWeekDetailHistoryShow" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" Width="870px" ShowBorder="false" ShowHeader="false" EnableCollapse="false" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="CostControlDetailHistoryId" AllowSorting="true" EnableColumnLines="true"
SortField="VersionNum" SortDirection="ASC" AllowCellEditing="true" ClicksToEdit="1" PageSize="1000"
ShowSelectedCell="true" DataIDField="CostControlDetailHistoryId" IsDatabasePaging="true">
<Columns>
<f:RenderField Width="100px" ColumnID="VersionNum" DataField="VersionNum" FieldType="String" RendererFunction="renderGender"
HeaderText="版本" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="StartDate" DataField="StartDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="开始日期" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="150px" ColumnID="EndDate" DataField="EndDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="结束日期" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="200px" ColumnID="PlanNum" DataField="PlanNum" FieldType="Double"
HeaderText="本月计划完成量" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="dataload" Handler="onGridDataLoad" />
</Listeners>
</f:Grid>
</Items>
</f:Panel>
</form>
<script>
function renderGender(value) {
return 'V' + value + '.0';
}
function onGridDataLoad(event) {
this.mergeColumns(['VersionNum']);
}
</script>
</body>
</html>

View File

@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.JDGL.WBS
{
public partial class CostControlWeekDetailHistoryShow : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// 绑定表格
BindGrid();
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(Request.Params["Id"]);
List<Model.WBS_CostControlDetailHistory> detailHistorys = BLL.CostControlDetailHistoryService.GetWeekCostControlDetailHistorysByCostControlId(costControlDetail.CostControlId, costControlDetail.Months.Value);
Grid1.DataSource = detailHistorys;
Grid1.DataBind();
}
#endregion
}
}

View File

@ -0,0 +1,51 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.JDGL.WBS {
public partial class CostControlWeekDetailHistoryShow {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
}
}

View File

@ -0,0 +1,97 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CostControlWeekItemDetailEdit.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.CostControlWeekItemDetailEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="费控项计划" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="CostControlDetailId" AllowCellEditing="true"
ClicksToEdit="1" DataIDField="CostControlDetailId" AllowSorting="true" SortField="Months"
SortDirection="ASC" EnableColumnLines="true" ForceFit="true"
AllowPaging="true" IsDatabasePaging="true" PageSize="100" OnRowCommand="Grid1_RowCommand"
EnableRowDoubleClickEvent="true" AllowFilters="true" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:Label ID="txtCostControlName" runat="server" Width="220px" LabelWidth="50px"
LabelAlign="Right">
</f:Label>
<f:Label ID="txtMonths" runat="server" Width="140px"
LabelAlign="Right">
</f:Label>
<f:Label ID="txtTotalPlanNum" runat="server" Width="140px"
LabelAlign="Right">
</f:Label>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="true"
runat="server" OnClick="btnNew_Click">
</f:Button>
<f:Button ID="btnUpdate" Icon="Pencil" runat="server" ToolTip="调整计划"
OnClick="btnUpdate_Click">
</f:Button>
<f:Button ID="btnSee" ToolTip="查看历史版本" Icon="Find" runat="server" OnClick="btnSee_Click">
</f:Button>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存"
OnClick="btnSave_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField Width="100px" ColumnID="StartDate" DataField="StartDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="开始日期" TextAlign="Center"
HeaderTextAlign="Center">
<Editor>
<f:DatePicker ID="txtStartDate" runat="server" DateFormatString="yyyy-MM-dd"
EnableEdit="true">
</f:DatePicker>
</Editor>
</f:RenderField>
<f:RenderField Width="100px" ColumnID="EndDate" DataField="EndDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="结束日期" TextAlign="Center"
HeaderTextAlign="Center">
<Editor>
<f:DatePicker ID="txtEndDate" runat="server" DateFormatString="yyyy-MM-dd"
EnableEdit="true">
</f:DatePicker>
</Editor>
</f:RenderField>
<f:RenderField Width="200px" ColumnID="PlanNum" DataField="PlanNum" FieldType="Double"
HeaderText="本周计划完成量" HeaderTextAlign="Center" TextAlign="Center">
<Editor>
<f:NumberBox ID="nbTotalNum" NoDecimal="false" NoNegative="true" MinValue="0"
runat="server">
</f:NumberBox>
</Editor>
</f:RenderField>
<f:LinkButtonField Width="30px" TextAlign="Center" HeaderText="删除" ToolTip="删除" CommandName="del"
Icon="Delete" />
<f:RenderField Width="100px" ColumnID="Months" DataField="Months" FieldType="String" Hidden="true"
HeaderText="月份" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
</Columns>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="查看历史版本" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Self" EnableResize="true" runat="server" IsModal="true"
Width="800px" Height="500px">
</f:Window>
</form>
</body>
</html>

View File

@ -0,0 +1,214 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
using Newtonsoft.Json.Linq;
namespace FineUIPro.Web.JDGL.WBS
{
public partial class CostControlWeekItemDetailEdit : PageBase
{
/// <summary>
/// 控制项主键
/// </summary>
public string Id
{
get
{
return (string)ViewState["Id"];
}
set
{
ViewState["Id"] = value;
}
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.Id = Request.Params["Id"];
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(this.Id);
string name = string.Empty;
if (costControlDetail != null)
{
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlDetail.CostControlId);
if (costControl != null)
{
this.txtCostControlName.Text = costControl.CostControlName;
}
if (costControlDetail.Months != null)
{
this.txtMonths.Text = " 月份:" + string.Format("{0:yyyy-MM}", costControlDetail.Months);
}
if (costControlDetail.PlanNum != null)
{
this.txtTotalPlanNum.Text = " 本月计划完成量:" + costControlDetail.PlanNum.Value.ToString("F0");
}
var list = BLL.CostControlDetailService.GetWeekCostControlDetailsByCostControlId(costControlDetail.CostControlId, costControlDetail.Months.Value);
this.Grid1.DataSource = list;
this.Grid1.DataBind();
}
}
}
#region
/// <summary>
/// 增加按钮事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
var list = GetDetails();
Model.WBS_CostControlDetail detail = new Model.WBS_CostControlDetail();
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(this.Id);
detail.CostControlDetailId = SQLHelper.GetNewID();
detail.Months = costControlDetail.Months;
list.Add(detail);
Grid1.DataSource = list;
Grid1.DataBind();
}
#endregion
private List<Model.WBS_CostControlDetail> GetDetails()
{
List<Model.WBS_CostControlDetail> details = new List<Model.WBS_CostControlDetail>();
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(this.Id);
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("index");
Model.WBS_CostControlDetail detail = new Model.WBS_CostControlDetail();
detail.CostControlDetailId = Grid1.Rows[i].RowID;
detail.CostControlId = costControlDetail.CostControlId;
detail.Months = Funs.GetNewDateTime(values.Value<string>("Months"));
detail.StartDate = Funs.GetNewDateTime(values.Value<string>("StartDate"));
detail.EndDate = Funs.GetNewDateTime(values.Value<string>("EndDate"));
detail.PlanNum = Funs.GetNewDecimal(values.Value<string>("PlanNum"));
details.Add(detail);
}
return details;
}
#region
/// <summary>
/// Grid行点击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowCommand(object sender, GridCommandEventArgs e)
{
string detailId = Grid1.DataKeys[e.RowIndex][0].ToString();
var list = GetDetails();
if (e.CommandName == "del")//删除
{
var detail = list.FirstOrDefault(x => x.CostControlDetailId == detailId);
Model.WBS_CostControlDetail oldDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(detailId);
if (detail != null)
{
list.Remove(detail);
}
if (oldDetail != null)
{
BLL.CostControlDetailService.DeleteCostControlDetail(detailId);
}
this.Grid1.DataSource = list;
this.Grid1.DataBind();
}
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
bool hasDate = true;
decimal totalNum = 0;
foreach (JObject mergedRow in Grid1.GetMergedData())
{
JObject values = mergedRow.Value<JObject>("values");
int i = mergedRow.Value<int>("index");
Model.WBS_CostControlDetail detail = new Model.WBS_CostControlDetail();
if (string.IsNullOrEmpty(values.Value<string>("StartDate")) || string.IsNullOrEmpty(values.Value<string>("EndDate")))
{
hasDate = false;
}
totalNum += Funs.GetNewDecimalOrZero(values.Value<string>("PlanNum"));
}
if (!hasDate)
{
ShowNotify("开始、结束日期不能为空!", MessageBoxIcon.Warning);
return;
}
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(this.Id);
if (costControlDetail.PlanNum != totalNum)
{
ShowNotify("周计划累计值必须等于"+ costControlDetail.PlanNum.Value.ToString("F0") + "", MessageBoxIcon.Warning);
return;
}
var list = GetDetails();
foreach (var item in list)
{
Model.WBS_CostControlDetail oldDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(item.CostControlDetailId);
if (oldDetail == null)
{
BLL.CostControlDetailService.AddCostControlDetail(item);
}
else
{
item.ThisNum = oldDetail.ThisNum;
BLL.CostControlDetailService.UpdateCostControlDetail(item);
}
}
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHideReference());
}
#endregion
#region
/// <summary>
/// 调整计划按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnUpdate_Click(object sender, EventArgs e)
{
var list = GetDetails();
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(this.Id);
int versionNum = BLL.CostControlDetailHistoryService.GetWeekMaxVersionNumByCostControlId(costControlDetail.CostControlId, costControlDetail.Months.Value);
foreach (var item in list)
{
Model.WBS_CostControlDetailHistory detailHistory = new Model.WBS_CostControlDetailHistory();
detailHistory.CostControlDetailHistoryId = SQLHelper.GetNewID();
detailHistory.CostControlId = item.CostControlId;
detailHistory.Months = item.Months;
detailHistory.StartDate = item.StartDate;
detailHistory.EndDate = item.EndDate;
detailHistory.PlanNum = item.PlanNum;
detailHistory.VersionNum = versionNum + 1;
BLL.CostControlDetailHistoryService.AddCostControlDetailHistory(detailHistory);
}
ShowNotify("历史版本保存成功!", MessageBoxIcon.Success);
}
#endregion
#region
/// <summary>
/// 查看历史版本
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSee_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("CostControlWeekDetailHistoryShow.aspx?Id={0}", this.Id, "编辑 - ")));
}
#endregion
}
}

View File

@ -0,0 +1,168 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.JDGL.WBS {
public partial class CostControlWeekItemDetailEdit {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// txtCostControlName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtCostControlName;
/// <summary>
/// txtMonths 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtMonths;
/// <summary>
/// txtTotalPlanNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTotalPlanNum;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnUpdate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnUpdate;
/// <summary>
/// btnSee 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSee;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
/// <summary>
/// txtStartDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtStartDate;
/// <summary>
/// txtEndDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndDate;
/// <summary>
/// nbTotalNum 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.NumberBox nbTotalNum;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
}
}

View File

@ -0,0 +1,104 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MilePost.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.MilePost" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>里程碑</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="里程碑" EnableCollapse="true" ForceFit="true"
runat="server" BoxFlex="1" DataKeyNames="MilePostId" AllowCellEditing="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="MilePostId" AllowSorting="true"
SortField="PlanDate" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="drpCNProfessionalId" runat="server" Label="专业" LabelAlign="Right"></f:DropDownList>
<f:Button ID="btnSearch" Icon="SystemSearch" OnClick="btnSearch_Click"
EnablePostBack="true" runat="server" ToolTip="查询">
</f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnNew" Icon="Add" EnablePostBack="true" runat="server" OnClick="btnNew_Click" ToolTip="新增" Hidden="true">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField ColumnID="CnProfessionName" DataField="CnProfessionName" FieldType="String" HeaderText="专业" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="MilePostName" DataField="MilePostName" FieldType="String" HeaderText="里程碑名称" TextAlign="Center"
HeaderTextAlign="Center" Width="160px">
</f:RenderField>
<f:RenderField ColumnID="PlanDate" DataField="PlanDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="计划完成日期" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="RealDate" DataField="RealDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="实际完成日期" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="Remark" DataField="Remark" FieldType="String" HeaderText="备注" TextAlign="Center"
HeaderTextAlign="Center" Width="200px">
</f:RenderField>
<f:TemplateField ColumnID="AttachFile" Width="150px" HeaderText="附件" HeaderTextAlign="Center" TextAlign="Left" >
<ItemTemplate>
<asp:LinkButton ID="lbtnFileUrl" runat="server" CssClass="ItemLink"
Text='<%# BLL.AttachFileService.GetBtnFileUrl(Eval("MilePostId")) %>' ToolTip="附件查看"></asp:LinkButton>
</ItemTemplate>
</f:TemplateField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
<f:ListItem Text="所有行" Value="100000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="里程碑" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
Width="900px" Height="360px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<Items>
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Text="修改" Icon="Pencil" OnClick="btnMenuModify_Click" Hidden="true">
</f:MenuButton>
<f:MenuButton ID="btnMenuDel" EnablePostBack="true" runat="server" Icon="Delete" Text="删除" ConfirmText="确定删除当前数据?" OnClick="btnMenuDel_Click" Hidden="true">
</f:MenuButton>
</Items>
</f:Menu>
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
</script>
</body>
</html>

View File

@ -0,0 +1,237 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using BLL;
using Newtonsoft.Json.Linq;
using System.Text;
namespace FineUIPro.Web.JDGL.WBS
{
public partial class MilePost : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetButtonPower();
this.drpCNProfessionalId.DataValueField = "CnProfessionId";
this.drpCNProfessionalId.DataTextField = "CnProfessionName";
this.drpCNProfessionalId.DataSource = BLL.CnProfessionInitService.GetCnProfessionInitDropDownList();
this.drpCNProfessionalId.DataBind();
Funs.FineUIPleaseSelect(drpCNProfessionalId);
BindGrid();
}
}
public void BindGrid()
{
string strSql = @"select MilePostId,MilePostName, PlanDate, RealDate, Remark,CN.CnProfessionName
from WBS_MilePost C
left join WBS_CnProfessionInit CN on C.CnProfessionId=CN.CnProfessionId
where C.ProjectId = @ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (drpCNProfessionalId.SelectedValue != BLL.Const._Null)
{
strSql += " AND C.CnProfessionId=@CNProfessionalId";
listStr.Add(new SqlParameter("@CNProfessionalId", drpCNProfessionalId.SelectedValue));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
//tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region
/// <summary>
/// 分页下拉
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
/// 分页索引事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 关闭弹出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 新增按钮事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MilePostEdit.aspx", "编辑 - ")));
}
#endregion
#region
/// <summary>
/// 右键编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuModify_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("MilePostEdit.aspx?MilePostId={0}", Grid1.SelectedRowID, "编辑 - ")));
}
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
btnMenuModify_Click(sender, e);
}
#endregion
#region
/// <summary>
/// 右键删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDel_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var InspectionPerson = BLL.MilePostService.GetMilePostById(rowID);
if (InspectionPerson != null)
{
BLL.MilePostService.DeleteMilePostById(rowID);
}
}
BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
}
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == BLL.Const._Null)
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.MilePostMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuModify.Hidden = false;
this.Grid1.EnableRowDoubleClickEvent = true;
}
else
{
this.Grid1.EnableRowDoubleClickEvent = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDel.Hidden = false;
}
}
}
#endregion
#region
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("里程碑" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = Encoding.UTF8;
this.Grid1.PageSize = Grid1.RecordCount;
this.BindGrid();
Response.Write(GetGridTableHtml2(Grid1));
Response.End();
}
#endregion
}
}

View File

@ -0,0 +1,168 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.JDGL.WBS {
public partial class MilePost {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// ToolSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar ToolSearch;
/// <summary>
/// drpCNProfessionalId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCNProfessionalId;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
/// <summary>
/// lbtnFileUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.LinkButton lbtnFileUrl;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuModify 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuModify;
/// <summary>
/// btnMenuDel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDel;
}
}

View File

@ -0,0 +1,75 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MilePostEdit.aspx.cs" Inherits="FineUIPro.Web.JDGL.WBS.MilePostEdit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="SimpleForm1" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true" BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:DropDownList ID="drpCNProfessionalId" runat="server" Label="专业" LabelAlign="Right" LabelWidth="140px"></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtMilePostName" runat="server" Label="里程碑名称" MaxLength="100" Required="true" ShowRedStar="true" LabelWidth="140px"></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="计划完成日期" ID="txtPlanDate" ShowRedStar="true" Required="true" LabelWidth="140px"
LabelAlign="right">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DatePicker runat="server" DateFormatString="yyyy-MM-dd" Label="实际完成日期" ID="txtRealDate" LabelWidth="140px"
LabelAlign="right">
</f:DatePicker>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtRemark" runat="server" Label="备注" MaxLength="200" LabelWidth="140px"></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Panel ID="Panel2" ShowHeader="false" ShowBorder="false" Layout="Column" CssClass="" runat="server">
<Items>
<f:Label ID="Label1" runat="server" Label="上传附件"
LabelAlign="Right" LabelWidth="140px">
</f:Label>
<f:Button ID="btnAttach" Icon="TableCell" EnablePostBack="true" Text="附件" runat="server" OnClick="btnAttach_Click">
</f:Button>
</Items>
</f:Panel>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:HiddenField ID="hdAttachUrl" runat="server">
</f:HiddenField>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1" OnClick="btnSave_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</form>
</body>
</html>

View File

@ -0,0 +1,140 @@
using System;
using System.Collections.Generic;
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 MilePostEdit : PageBase
{
#region
/// <summary>
/// 主键
/// </summary>
public string MilePostId
{
get
{
return (string)ViewState["MilePostId"];
}
set
{
ViewState["MilePostId"] = value;
}
}
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.drpCNProfessionalId.DataValueField = "CnProfessionId";
this.drpCNProfessionalId.DataTextField = "CnProfessionName";
this.drpCNProfessionalId.DataSource = BLL.CnProfessionInitService.GetCnProfessionInitDropDownList();
this.drpCNProfessionalId.DataBind();
Funs.FineUIPleaseSelect(drpCNProfessionalId);
this.MilePostId = Request.Params["MilePostId"];
Model.WBS_MilePost milePost = BLL.MilePostService.GetMilePostById(this.MilePostId);
if (milePost != null)
{
this.MilePostId = milePost.MilePostId;
this.hdAttachUrl.Text = this.MilePostId;
if (milePost.CnProfessionId != null)
{
this.drpCNProfessionalId.SelectedValue = milePost.CnProfessionId.ToString();
}
this.txtMilePostName.Text = milePost.MilePostName;
if (milePost.PlanDate != null)
{
this.txtPlanDate.Text = string.Format("{0:yyyy-MM-dd}", milePost.PlanDate);
}
if (milePost.RealDate != null)
{
this.txtRealDate.Text = string.Format("{0:yyyy-MM-dd}", milePost.RealDate);
}
this.txtRemark.Text = milePost.Remark;
}
}
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (drpCNProfessionalId.SelectedValue == BLL.Const._Null)
{
Alert.ShowInTop("请选择专业!", MessageBoxIcon.Warning);
return;
}
Model.WBS_MilePost milePost = new Model.WBS_MilePost();
milePost.ProjectId = this.CurrUser.LoginProjectId;
if (this.drpCNProfessionalId.SelectedValue != BLL.Const._Null)
{
milePost.CnProfessionId = Funs.GetNewInt(this.drpCNProfessionalId.SelectedValue);
}
milePost.MilePostName = this.txtMilePostName.Text.Trim();
if (!string.IsNullOrEmpty(this.txtPlanDate.Text))
{
milePost.PlanDate = Convert.ToDateTime(this.txtPlanDate.Text);
}
if (!string.IsNullOrEmpty(this.txtRealDate.Text))
{
milePost.RealDate = Convert.ToDateTime(this.txtRealDate.Text);
}
milePost.Remark = this.txtRemark.Text.Trim();
if (string.IsNullOrEmpty(this.MilePostId))
{
if (!string.IsNullOrEmpty(this.hdAttachUrl.Text))
{
milePost.MilePostId = this.hdAttachUrl.Text;
}
else
{
milePost.MilePostId = SQLHelper.GetNewID(typeof(Model.WBS_MilePost));
this.hdAttachUrl.Text = milePost.MilePostId;
}
milePost.CompileMan = this.CurrUser.UserId;
milePost.CompileDate = DateTime.Now;
BLL.MilePostService.AddMilePost(milePost);
}
else
{
milePost.MilePostId = this.MilePostId;
BLL.MilePostService.UpdateMilePost(milePost);
}
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
#region
/// <summary>
/// 附件上传
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttach_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.hdAttachUrl.Text)) //新增记录
{
this.hdAttachUrl.Text = SQLHelper.GetNewID(typeof(Model.WBS_MilePost));
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/JDGL/MilePost&menuId={1}", this.hdAttachUrl.Text, BLL.Const.MilePostMenuId)));
}
#endregion
}
}

View File

@ -0,0 +1,150 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.JDGL.WBS {
public partial class MilePostEdit {
/// <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>
/// drpCNProfessionalId 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCNProfessionalId;
/// <summary>
/// txtMilePostName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtMilePostName;
/// <summary>
/// txtPlanDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtPlanDate;
/// <summary>
/// txtRealDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtRealDate;
/// <summary>
/// txtRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRemark;
/// <summary>
/// Panel2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel2;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// btnAttach 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttach;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// hdAttachUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdAttachUrl;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}

View File

@ -624,6 +624,11 @@ namespace FineUIPro.Web.JDGL.WBS
Grid1.DataSource = table;
Grid1.DataBind();
}
else
{
Grid1.DataSource = null;
Grid1.DataBind();
}
}
#endregion
@ -975,6 +980,7 @@ namespace FineUIPro.Web.JDGL.WBS
if (costControl != null)
{
BLL.WbsSetMatchCostControlInitService.DeleteWbsSetMatchCostControlInitByWbsSetCodeAndCostControlInitCode(this.trWBS.SelectedNodeID,costControl.CostControlInitCode);
BLL.CostControlInitService.DeleteCostControlInit(Grid1.SelectedRowID);
BLL.LogService.AddSys_Log(this.CurrUser, Grid1.SelectedRowID, Grid1.SelectedRowID, BLL.Const.ProjectControlPointMenuId, "删除费用对应关系");
Grid1.DataBind();
BindGrid();

View File

@ -198,9 +198,12 @@
<f:MenuButton ID="btnMenuModify" EnablePostBack="true" runat="server" Hidden="true" Text="修改" Icon="Pencil"
OnClick="btnMenuModify_Click">
</f:MenuButton>
<f:MenuButton ID="btnMenuDetail" EnablePostBack="true" runat="server" Hidden="true" Text="设置计划" Icon="ApplicationViewDetail"
<f:MenuButton ID="btnMenuDetail" EnablePostBack="true" runat="server" Hidden="true" Text="设置计划" Icon="ApplicationViewDetail"
OnClick="btnMenuDetail_Click">
</f:MenuButton>
<f:MenuButton ID="btnMenuWeekDetail" EnablePostBack="true" runat="server" Hidden="true" Text="设置周计划" Icon="ApplicationEdit"
OnClick="btnMenuWeekDetail_Click">
</f:MenuButton>
<f:MenuButton ID="btnMenuDel" EnablePostBack="true" runat="server" Hidden="true" Icon="Delete" Text="删除" ConfirmText="确定删除当前数据?"
OnClick="btnMenuDel_Click">
</f:MenuButton>

View File

@ -862,6 +862,21 @@ namespace FineUIPro.Web.JDGL.WBS
PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("CostControlDetailEdit.aspx?Id={0}", this.Grid1.SelectedRowID, "修改 - ")));
}
/// <summary>
/// 设置周计划按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuWeekDetail_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("CostControlWeekDetailEdit.aspx?Id={0}", this.Grid1.SelectedRowID, "修改 - ")));
}
/// <summary>
/// 拷贝
/// </summary>
@ -1398,6 +1413,11 @@ namespace FineUIPro.Web.JDGL.WBS
Grid1.DataSource = table;
Grid1.DataBind();
}
else
{
Grid1.DataSource = null;
Grid1.DataBind();
}
}
#endregion
@ -2282,6 +2302,7 @@ namespace FineUIPro.Web.JDGL.WBS
this.btnAdd.Hidden = false;
this.btnMenuCopy.Hidden = false;
this.btnMenuDetail.Hidden = false;
this.btnMenuWeekDetail.Hidden = false;
//this.btnMenuCopy2.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))

View File

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

View File

@ -53,7 +53,7 @@
ShowHeader="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Region">
<Items>
<f:Tree ID="trWBS" Width="290" EnableCollapse="true" ShowHeader="true" OnNodeCommand="trWBS_NodeCommand"
OnNodeExpand="trWBS_NodeExpand" OnNodeCheck="trWBS_NodeCheck"
OnNodeExpand="trWBS_NodeExpand"
AutoLeafIdentification="true" runat="server">
</f:Tree>
<f:HiddenField runat="server" ID="hdSelectId">
@ -76,6 +76,7 @@
<f:DatePicker runat="server" ID="txtMonths" DateFormatString="yyyy-MM" AutoPostBack="true"
Label="月份" LabelWidth="50px" Width="150px" OnTextChanged="txtMonths_TextChanged">
</f:DatePicker>
<f:DropDownList ID="drpWeek" runat="server" Label="周" LabelAlign="right" AutoPostBack="true" OnSelectedIndexChanged="drpWeek_SelectedIndexChanged"></f:DropDownList>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" Hidden="true" OnClick="btnSave_Click">
</f:Button>

View File

@ -24,6 +24,7 @@ namespace FineUIPro.Web.JDGL.WBS
GetButtonPower();
InitTreeMenu();
this.txtMonths.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
Funs.FineUIPleaseSelect(this.drpWeek);
}
}
@ -283,74 +284,6 @@ namespace FineUIPro.Web.JDGL.WBS
}
#endregion
protected void trWBS_NodeCheck(object sender, FineUIPro.TreeCheckEventArgs e)
{
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(e.NodeID);
if (wbsSet != null)
{
wbsSet.IsSelected = e.Checked;
wbsSet.IsApprove = e.Checked;
BLL.WbsSetService.UpdateWbsSet(wbsSet);
Model.Wbs_WbsSet pWbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(wbsSet.SuperWbsSetId);
if (pWbsSet != null)
{
pWbsSet.IsSelected = e.Checked;
pWbsSet.IsApprove = e.Checked;
BLL.WbsSetService.UpdateWbsSet(pWbsSet);
Model.Wbs_WbsSet ppWbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(pWbsSet.SuperWbsSetId);
if (ppWbsSet != null)
{
ppWbsSet.IsSelected = e.Checked;
ppWbsSet.IsApprove = e.Checked;
BLL.WbsSetService.UpdateWbsSet(ppWbsSet);
Model.Wbs_WbsSet pppWbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(ppWbsSet.SuperWbsSetId);
if (pppWbsSet != null)
{
pppWbsSet.IsSelected = e.Checked;
pppWbsSet.IsApprove = e.Checked;
BLL.WbsSetService.UpdateWbsSet(pppWbsSet);
}
}
}
Model.Wbs_UnitProject unitProject = BLL.UnitProjectService.GetUnitProjectByUnitProjectId(wbsSet.UnitProjectId);
if (unitProject != null)
{
unitProject.IsSelected = e.Checked;
unitProject.IsApprove = e.Checked;
BLL.UnitProjectService.UpdateUnitProject(unitProject);
}
Model.WBS_CnProfession cnProfession = BLL.CnProfessionService.GetCnProfessionByCnProfessionId(wbsSet.CnProfessionId);
if (cnProfession != null)
{
cnProfession.IsSelected = e.Checked;
cnProfession.IsApprove = e.Checked;
BLL.CnProfessionService.UpdateCnProfession(cnProfession);
}
}
//if (e.Checked)
//{
// CheckAllParentNodes(e.Node);
// CheckAllChildNodes(e.Node);
// this.UpdateSelect(e.Node, true);
//}
//else
//{
// if (auditText == string.Empty)
// {
// trWBS.UncheckAllNodes(e.Node.Nodes);
// this.UpdateSelect(e.Node, false);
// }
// else
// {
// auditText = auditText.Substring(0, auditText.Length - 1);
// e.Node.Checked = true;
// ShowNotify("权重已有设置审核项:'" + auditText + "',不能取消设置!", MessageBoxIcon.Success);
// }
//}
BindGrid();
}
#region Tree点击事件
/// <summary>
/// Tree点击事件
@ -359,6 +292,9 @@ namespace FineUIPro.Web.JDGL.WBS
/// <param name="e"></param>
protected void trWBS_NodeCommand(object sender, TreeCommandEventArgs e)
{
InitWeek();
this.Grid1.Columns[4].HeaderText = "本月计划完成量";
this.Grid1.Columns[7].HeaderText = "本月完成量";
BindGrid();
}
#endregion
@ -380,116 +316,235 @@ namespace FineUIPro.Web.JDGL.WBS
if (Grid1.Rows.Count > 0)
{
decimal changeThisPlanValue = 0, changeThisRealCost = 0, changeThisPlanCost = 0, //当月总变化完成成本、完成预算
oldThisPlanValue = 0, oldThisRealCost = 0, oldThisPlanCost = 0,
thisPlanValue = 0, thisRealCost = 0, thisPlanCost = 0;
oldThisPlanValue = 0, oldThisRealCost = 0, oldThisPlanCost = 0,
thisPlanValue = 0, thisRealCost = 0, thisPlanCost = 0;
JArray mergedData = Grid1.GetMergedData();
foreach (JObject mergedRow in mergedData)
if (this.drpWeek.SelectedValue == BLL.Const._Null) //保存月记录
{
oldThisPlanValue = 0;
oldThisRealCost = 0;
oldThisPlanCost = 0;
JObject values = mergedRow.Value<JObject>("values");
string costControlDetailId = values.Value<string>("CostControlDetailId");
string costControlId = values.Value<string>("CostControlId");
string thisNum = values.Value<string>("ThisNum");
string planPrice = values.Value<string>("PlanPrice");
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(costControlDetailId);
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlId);
if (costControlDetail != null)
foreach (JObject mergedRow in mergedData)
{
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
if (!string.IsNullOrEmpty(thisNum))
oldThisPlanValue = 0;
oldThisRealCost = 0;
oldThisPlanCost = 0;
JObject values = mergedRow.Value<JObject>("values");
string costControlDetailId = values.Value<string>("CostControlDetailId");
string costControlId = values.Value<string>("CostControlId");
string thisNum = values.Value<string>("ThisNum");
string planPrice = values.Value<string>("PlanPrice");
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(costControlDetailId);
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlId);
if (costControlDetail != null)
{
costControlDetail.ThisNum = Convert.ToDecimal(thisNum);
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
if (!string.IsNullOrEmpty(thisNum))
{
costControlDetail.ThisNum = Convert.ToDecimal(thisNum);
}
thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
BLL.CostControlDetailService.UpdateCostControlDetail(costControlDetail);
}
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 = costControlDetailId;
costControlDetail.CostControlId = costControlId;
costControlDetail.Months = months;
if (!string.IsNullOrEmpty(thisNum))
{
costControlDetail.ThisNum = Convert.ToDecimal(thisNum);
}
thisPlanValue = 0;
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
BLL.CostControlDetailService.AddCostControlDetail(costControlDetail);
}
//累加变化值,计算总的变化值
changeThisRealCost += thisRealCost - oldThisRealCost;
changeThisPlanCost += thisPlanCost - oldThisPlanCost;
}
//累计所有子节点的计划值
var costControls = BLL.CostControlService.GetCostControlsByWbsSetId(this.trWBS.SelectedNodeID);
foreach (var item in costControls)
{
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(item.CostControlId, months);
if (costControlDetail != null)
{
changeThisPlanValue += (costControlDetail.PlanNum ?? 0) * (item.PlanPrice ?? 0);
}
}
Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(this.trWBS.SelectedNodeID, months);
if (parentDetail != null) //如果工作项节点存在,则计算计划值差异值
{
changeThisPlanValue = changeThisPlanValue - (parentDetail.ThisPlanValue ?? 0);
}
//更新树节点
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(this.trWBS.SelectedNodeID);
//更新工作包、工作项
UpdateWbsSetDetail(this.trWBS.SelectedNodeID, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
//更新分部
Model.WBS_CostControlParentDetail unitProjectDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(wbsSet.UnitProjectId, months);
if (unitProjectDetail != null)
{
unitProjectDetail.ThisPlanValue += changeThisPlanValue;
unitProjectDetail.ThisRealCost += changeThisRealCost;
unitProjectDetail.ThisPlanCost += changeThisPlanCost;
BLL.CostControlParentDetailService.UpdateCostControlParentDetail(unitProjectDetail);
}
else
{
costControlDetail = new Model.WBS_CostControlDetail();
costControlDetail.CostControlDetailId = costControlDetailId;
costControlDetail.CostControlId = costControlId;
costControlDetail.Months = months;
if (!string.IsNullOrEmpty(thisNum))
{
costControlDetail.ThisNum = Convert.ToDecimal(thisNum);
}
thisPlanValue = 0;
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
BLL.CostControlDetailService.AddCostControlDetail(costControlDetail);
unitProjectDetail = new Model.WBS_CostControlParentDetail();
unitProjectDetail.CostControlParentDetailId = SQLHelper.GetNewID();
unitProjectDetail.ParentId = wbsSet.UnitProjectId;
unitProjectDetail.Months = months;
unitProjectDetail.ThisPlanValue = changeThisPlanValue;
unitProjectDetail.ThisRealCost = changeThisRealCost;
unitProjectDetail.ThisPlanCost = changeThisPlanCost;
BLL.CostControlParentDetailService.AddCostControlParentDetail(unitProjectDetail);
}
//累加变化值,计算总的变化值
changeThisRealCost += thisRealCost - oldThisRealCost;
changeThisPlanCost += thisPlanCost - oldThisPlanCost;
}
//累计所有子节点的计划值
var costControls = BLL.CostControlService.GetCostControlsByWbsSetId(this.trWBS.SelectedNodeID);
foreach (var item in costControls)
{
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonths(item.CostControlId, months);
if (costControlDetail != null)
//更新专业
Model.WBS_CostControlParentDetail cnProfessionDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(wbsSet.CnProfessionId, months);
if (cnProfessionDetail != null)
{
changeThisPlanValue += (costControlDetail.PlanNum ?? 0) * (item.PlanPrice ?? 0);
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;
cnProfessionDetail.ThisPlanValue = changeThisPlanValue;
cnProfessionDetail.ThisRealCost = changeThisRealCost;
cnProfessionDetail.ThisPlanCost = changeThisPlanCost;
BLL.CostControlParentDetailService.AddCostControlParentDetail(cnProfessionDetail);
}
//更新装置
UpdateInstallationDetail(wbsSet.InstallationId, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
}
Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(this.trWBS.SelectedNodeID, months);
if (parentDetail != null) //如果工作项节点存在,则计算计划值差异值
else //保存周记录
{
changeThisPlanValue = changeThisPlanValue - (parentDetail.ThisPlanValue ?? 0);
string[] strs = this.drpWeek.SelectedValue.Split(',');
DateTime startDate = Convert.ToDateTime(strs[0]);
DateTime endDate = Convert.ToDateTime(strs[1]);
foreach (JObject mergedRow in mergedData)
{
oldThisPlanValue = 0;
oldThisRealCost = 0;
oldThisPlanCost = 0;
JObject values = mergedRow.Value<JObject>("values");
string costControlDetailId = values.Value<string>("CostControlDetailId");
string costControlId = values.Value<string>("CostControlId");
string thisNum = values.Value<string>("ThisNum");
string planPrice = values.Value<string>("PlanPrice");
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(costControlDetailId);
Model.WBS_CostControl costControl = BLL.CostControlService.GetCostControlByCostControlId(costControlId);
if (costControlDetail != null)
{
oldThisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
oldThisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
if (!string.IsNullOrEmpty(thisNum))
{
costControlDetail.ThisNum = Convert.ToDecimal(thisNum);
}
thisPlanValue = (costControlDetail.PlanNum ?? 0) * (costControl.PlanPrice ?? 0);
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
BLL.CostControlDetailService.UpdateCostControlDetail(costControlDetail);
}
else
{
costControlDetail = new Model.WBS_CostControlDetail();
costControlDetail.CostControlDetailId = costControlDetailId;
costControlDetail.CostControlId = costControlId;
costControlDetail.Months = months;
costControlDetail.StartDate = startDate;
costControlDetail.EndDate = endDate;
if (!string.IsNullOrEmpty(thisNum))
{
costControlDetail.ThisNum = Convert.ToDecimal(thisNum);
}
thisPlanValue = 0;
thisRealCost = (costControlDetail.ThisNum ?? 0) * (costControl.RealPrice ?? 0);
thisPlanCost = (costControlDetail.ThisNum ?? 0) * (costControl.PlanPrice ?? 0);
BLL.CostControlDetailService.AddCostControlDetail(costControlDetail);
}
//累加变化值,计算总的变化值
changeThisRealCost += thisRealCost - oldThisRealCost;
changeThisPlanCost += thisPlanCost - oldThisPlanCost;
}
//累计所有子节点的计划值
var costControls = BLL.CostControlService.GetCostControlsByWbsSetId(this.trWBS.SelectedNodeID);
foreach (var item in costControls)
{
Model.WBS_CostControlDetail costControlDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlIdAndMonthsWeek(item.CostControlId, months, startDate);
if (costControlDetail != null)
{
changeThisPlanValue += (costControlDetail.PlanNum ?? 0) * (item.PlanPrice ?? 0);
}
}
Model.WBS_CostControlParentDetail parentDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonthsWeek(this.trWBS.SelectedNodeID, months, startDate);
if (parentDetail != null) //如果工作项节点存在,则计算计划值差异值
{
changeThisPlanValue = changeThisPlanValue - (parentDetail.ThisPlanValue ?? 0);
}
//更新树节点
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(this.trWBS.SelectedNodeID);
//更新工作包、工作项
UpdateWeekWbsSetDetail(this.trWBS.SelectedNodeID, months, startDate, endDate, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
//更新分部
Model.WBS_CostControlParentDetail unitProjectDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonthsWeek(wbsSet.UnitProjectId, months, startDate);
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;
unitProjectDetail.StartDate = startDate;
unitProjectDetail.EndDate = endDate;
unitProjectDetail.ThisPlanValue = changeThisPlanValue;
unitProjectDetail.ThisRealCost = changeThisRealCost;
unitProjectDetail.ThisPlanCost = changeThisPlanCost;
BLL.CostControlParentDetailService.AddCostControlParentDetail(unitProjectDetail);
}
//更新专业
Model.WBS_CostControlParentDetail cnProfessionDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonthsWeek(wbsSet.CnProfessionId, months, startDate);
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;
cnProfessionDetail.StartDate = startDate;
cnProfessionDetail.EndDate = endDate;
cnProfessionDetail.ThisPlanValue = changeThisPlanValue;
cnProfessionDetail.ThisRealCost = changeThisRealCost;
cnProfessionDetail.ThisPlanCost = changeThisPlanCost;
BLL.CostControlParentDetailService.AddCostControlParentDetail(cnProfessionDetail);
}
//更新装置
UpdateWeekInstallationDetail(wbsSet.InstallationId, months, startDate, endDate, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
}
//更新树节点
Model.Wbs_WbsSet wbsSet = BLL.WbsSetService.GetWbsSetByWbsSetId(this.trWBS.SelectedNodeID);
//更新工作包、工作项
UpdateWbsSetDetail(this.trWBS.SelectedNodeID, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
//更新分部
Model.WBS_CostControlParentDetail unitProjectDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(wbsSet.UnitProjectId, months);
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;
unitProjectDetail.ThisPlanValue = changeThisPlanValue;
unitProjectDetail.ThisRealCost = changeThisRealCost;
unitProjectDetail.ThisPlanCost = changeThisPlanCost;
BLL.CostControlParentDetailService.AddCostControlParentDetail(unitProjectDetail);
}
//更新专业
Model.WBS_CostControlParentDetail cnProfessionDetail = BLL.CostControlParentDetailService.GetCostControlParentDetailByParentIdAndMonths(wbsSet.CnProfessionId, months);
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;
cnProfessionDetail.ThisPlanValue = changeThisPlanValue;
cnProfessionDetail.ThisRealCost = changeThisRealCost;
cnProfessionDetail.ThisPlanCost = changeThisPlanCost;
BLL.CostControlParentDetailService.AddCostControlParentDetail(cnProfessionDetail);
}
//更新装置
UpdateInstallationDetail(wbsSet.InstallationId, months, changeThisPlanValue, changeThisRealCost, changeThisPlanCost);
BindGrid();
//BindGrid();
Alert.ShowInTop("保存成功!", MessageBoxIcon.Success);
}
else
@ -501,7 +556,7 @@ namespace FineUIPro.Web.JDGL.WBS
#region
/// <summary>
/// 更新工作包、工作项
/// 更新工作包、工作项
/// </summary>
/// <param name="years"></param>
/// <param name="months"></param>
@ -537,11 +592,51 @@ namespace FineUIPro.Web.JDGL.WBS
}
}
}
/// <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>
@ -577,6 +672,46 @@ namespace FineUIPro.Web.JDGL.WBS
}
}
}
/// <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
#region
@ -636,24 +771,29 @@ namespace FineUIPro.Web.JDGL.WBS
if (!string.IsNullOrEmpty(this.txtMonths.Text.Trim()))
{
DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim() + "-01");
var codeList = BLL.WbsSetMatchCostControlService.GetWbsSetMatchCostControls(this.trWBS.SelectedNodeID);
Model.Wbs_WbsSet wbeSet = BLL.WbsSetService.GetWbsSetByWbsSetId(this.trWBS.SelectedNodeID);
if (codeList.Count > 0) //存在费控对应关系项
//var codeList = BLL.WbsSetMatchCostControlService.GetWbsSetMatchCostControls(this.trWBS.SelectedNodeID);
//Model.Wbs_WbsSet wbeSet = BLL.WbsSetService.GetWbsSetByWbsSetId(this.trWBS.SelectedNodeID);
//if (codeList.Count > 0) //存在费控对应关系项
//{
//List<string> codes = new List<string>();
//foreach (var item in codeList)
//{
// codes.Add(item.CostControlCode);
//}
//var list = BLL.CostControlService.GetCostControlsByCostControlCodes(codes, this.trWBS.SelectedNodeID);
var list = BLL.CostControlService.GetCostControlsByWbsSetId(this.trWBS.SelectedNodeID);
if (list.Count > 0)
{
List<string> codes = new List<string>();
foreach (var item in codeList)
List<Model.View_WBS_CostControlDetail> details = new List<Model.View_WBS_CostControlDetail>();
if (this.drpWeek.SelectedValue == BLL.Const._Null) //月份记录
{
codes.Add(item.CostControlCode);
}
var list = BLL.CostControlService.GetCostControlsByCostControlCodes(codes, this.trWBS.SelectedNodeID);
if (list.Count > 0)
{
List<Model.View_WBS_CostControlDetail> details = new List<Model.View_WBS_CostControlDetail>();
this.Grid1.Columns[4].HeaderText = "本月计划完成量";
this.Grid1.Columns[7].HeaderText = "本月完成量";
foreach (var item in list)
{
if (item.TotalNum != null)
{
Model.View_WBS_CostControlDetail detail = BLL.CostControlDetailService.GetViewCostControlDetailByCostControlIdYearMonth(item.CostControlId, months);
Model.View_WBS_CostControlDetail detail = BLL.CostControlDetailService.GetViewCostControlDetailByCostControlIdAndMonth(item.CostControlId, months);
if (detail == null)
{
detail = new Model.View_WBS_CostControlDetail();
@ -667,12 +807,68 @@ namespace FineUIPro.Web.JDGL.WBS
detail.RealPrice = item.RealPrice;
detail.PlanPrice = item.PlanPrice;
}
if (detail.ThisNum == 0)
{
detail.ThisNum = null;
}
details.Add(detail);
}
}
Grid1.DataSource = details;
Grid1.DataBind();
}
else //周记录
{
this.Grid1.Columns[4].HeaderText = "本周计划完成量";
this.Grid1.Columns[7].HeaderText = "本周完成量";
foreach (var item in list)
{
if (item.TotalNum != null)
{
DateTime startDate = Convert.ToDateTime(this.drpWeek.SelectedValue.Split(',')[0]);
Model.View_WBS_CostControlDetail detail = BLL.CostControlDetailService.GetViewCostControlDetailByCostControlIdAndMonthWeek(item.CostControlId, months, startDate);
if (detail == null)
{
detail = new Model.View_WBS_CostControlDetail();
detail.CostControlDetailId = SQLHelper.GetNewID();
detail.CostControlId = item.CostControlId;
detail.CostControlCode = item.CostControlCode;
detail.CostControlName = item.CostControlName;
detail.TotalNum = item.TotalNum;
detail.Unit = item.Unit;
detail.PlanNum = null;
detail.RealPrice = item.RealPrice;
detail.PlanPrice = item.PlanPrice;
}
else
{
Model.WBS_CostControlDetail oldDetail = BLL.CostControlDetailService.GetCostControlDetailByCostControlDetailId(detail.CostControlDetailId);
if (oldDetail.PlanNum != null)
{
detail.PlanNum = Convert.ToDouble(oldDetail.PlanNum);
}
else
{
detail.PlanNum = null;
}
if (oldDetail.ThisNum != null)
{
detail.ThisNum = Convert.ToDouble(oldDetail.ThisNum);
}
else
{
detail.ThisNum = null;
}
}
details.Add(detail);
}
}
}
Grid1.DataSource = details;
Grid1.DataBind();
}
else
{
Grid1.DataSource = null;
Grid1.DataBind();
}
}
}
@ -701,6 +897,33 @@ namespace FineUIPro.Web.JDGL.WBS
}
#endregion
#region
protected void InitWeek()
{
if (!string.IsNullOrEmpty(this.txtMonths.Text.Trim()))
{
DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim() + "-01");
string costControlId = string.Empty;
var list = BLL.CostControlService.GetCostControlsByWbsSetId(this.trWBS.SelectedNodeID);
if (list.Count > 0)
{
foreach (var item in list)
{
if (item.TotalNum != null)
{
if (BLL.CostControlDetailService.IsExitWeekCostControlDetailByCostControlIdAndMonth(item.CostControlId, months))
{
BLL.CostControlDetailService.InitWeekPlanList(this.drpWeek, item.CostControlId, months, true);
this.drpWeek.SelectedValue = BLL.Const._Null;
break;
}
}
}
}
}
}
#endregion
#region
/// <summary>
/// 月份选择事件
@ -709,9 +932,14 @@ namespace FineUIPro.Web.JDGL.WBS
/// <param name="e"></param>
protected void txtMonths_TextChanged(object sender, EventArgs e)
{
//InitTreeMenu();
BindGrid();
InitWeek();
}
#endregion
protected void drpWeek_SelectedIndexChanged(object sender, EventArgs e)
{
BindGrid();
}
}
}

View File

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

View File

@ -45,6 +45,9 @@
<f:Button ID="btnSearch" Text="查询" MarginLeft="40px" EnablePostBack="true" runat="server"
OnClick="btnSearch_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>

View File

@ -2,6 +2,7 @@
using System;
using System.Data;
using System.Linq;
using System.Text;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.JDGL.WBS
@ -132,5 +133,27 @@ namespace FineUIPro.Web.JDGL.WBS
this.drpWbsSet.SelectedValue = BLL.Const._Null;
}
}
#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();
DateTime months = Convert.ToDateTime(this.txtMonths.Text.Trim());
DataTable table = BLL.WorkloadStatisticsService.GetTreeDataTable(this.CurrUser.LoginProjectId, months, this.drpCnProfession.SelectedValue, this.drpUnitProject.SelectedValue, this.drpWbsSet.SelectedValue);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
}
}

View File

@ -92,5 +92,14 @@ namespace FineUIPro.Web.JDGL.WBS {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
}
}

View File

@ -268,7 +268,11 @@ namespace FineUIPro.Web.ProjectData
this.InsertDataTypeToProject(project.ProjectId);////初始化资料类别数据
this.InsertConstructionStandardListToProject(project.ProjectId); ////初始化项目标准规范清单
this.InsertITPListProject(project.ProjectId); // 初始化ITP列表
this.InsertZT(project); //初始化总图
this.InsertAC(project); //初始化防腐绝热
this.InsertGE(project); //初始化地勘
this.InsertUP(project); //初始化全厂地下主管网
this.InsertTF(project); //初始化临时设施
this.InsertGL(project); //初始化总图
ShowNotify("保存数据成功!", MessageBoxIcon.Success);
// 2. 关闭本窗体,然后刷新父窗体
// PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
@ -645,24 +649,25 @@ namespace FineUIPro.Web.ProjectData
}
#endregion
#region
private void InsertZT(Model.Base_Project project)
#region
private void InsertAC(Model.Base_Project project)
{
var zt = Funs.DB.Project_Installation.FirstOrDefault(x => x.ProjectId == project.ProjectId && x.InstallationCode == "ZT");
if (zt == null)
var ac = Funs.DB.Project_Installation.FirstOrDefault(x => x.ProjectId == project.ProjectId && x.InstallationName == "防腐绝热");
if (ac == null)
{
Model.Project_Installation installation = new Project_Installation();
installation.InstallationId = SQLHelper.GetNewID(typeof(Model.Project_Installation));
installation.ProjectId = project.ProjectId;
installation.InstallationCode = "ZT";
installation.InstallationName = "总图";
installation.InstallationCode = "AC";
installation.InstallationName = "防腐绝热";
installation.SuperInstallationId = "0";
installation.StartDate = project.StartDate;
installation.EndDate = project.EndDate;
installation.IsEnd = true;
BLL.Project_InstallationService.AddInstallation(installation);
// 拷贝总图专业下WBS内容
//拷贝单位工程及子单位工程
var unitProjectInits = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == 20 orderby x.SuperUnitProject select x;
var unitProjectInits = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Const.ACCNProfessionalId orderby x.SuperUnitProject select x;
foreach (var unitProjectInit in unitProjectInits)
{
Model.Wbs_UnitProject unitProject = new Model.Wbs_UnitProject();
@ -688,7 +693,7 @@ namespace FineUIPro.Web.ProjectData
BLL.UnitProjectService.AddUnitProject(unitProject);
}
//拷贝分部/子分部/分项/子分项
var wbsSetInits = (from x in Funs.DB.WBS_WbsSetInit where x.CnProfessionId == 20 orderby x.SuperWbsSetCode select x).ToList();
var wbsSetInits = (from x in Funs.DB.WBS_WbsSetInit where x.CnProfessionId == Const.ACCNProfessionalId orderby x.SuperWbsSetCode select x).ToList();
foreach (var wbsSetInit in wbsSetInits)
{
Model.Wbs_WbsSet wbsSet = new Model.Wbs_WbsSet();
@ -718,6 +723,902 @@ namespace FineUIPro.Web.ProjectData
wbsSet.IsIn = true;
BLL.WbsSetService.AddWbsSet(wbsSet);
}
var totalCostControlInits = from x in Funs.DB.WBS_CostControlInit orderby x.CostControlInitCode select x;
//拷贝费用清单对应关系
var wbsSetMatchCostControlInits = from x in Funs.DB.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControlInits)
{
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
wbsSetMatchCostControl.WbsSetId = (from x in Funs.DB.Wbs_WbsSet
where x.WbsSetCode == wbsSetMatchCostControlInit.WbsSetCode && x.InstallationId == installation.InstallationId
select x.WbsSetId).FirstOrDefault();
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
//拷贝费用清单项
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.ProjectId = project.ProjectId;
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
costControl.CostControlCode = costControlInit.CostControlInitCode;
costControl.CostControlName = costControlInit.CostControlInitName;
costControl.Unit = costControlInit.Unit;
BLL.CostControlService.AddCostControl(costControl);
}
}
}
else
{
ac.IsEnd = true;
BLL.Project_InstallationService.UpdateInstallation(ac);
Model.Wbs_UnitProject up = BLL.UnitProjectService.GetUnitProjectIdByInstallationId(ac.InstallationId);
if (up == null)
{
// 拷贝总图专业下WBS内容
//拷贝单位工程及子单位工程
var unitProjectInits = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Const.ACCNProfessionalId orderby x.SuperUnitProject select x;
foreach (var unitProjectInit in unitProjectInits)
{
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 == ac.InstallationId
select x.UnitProjectId).FirstOrDefault();
}
unitProject.InstallationId = ac.InstallationId;
unitProject.ProjectId = project.ProjectId;
unitProject.StartDate = project.StartDate;
unitProject.EndDate = project.EndDate;
unitProject.Remark = unitProjectInit.Remark;
unitProject.IsIn = true;
BLL.UnitProjectService.AddUnitProject(unitProject);
}
//拷贝分部/子分部/分项/子分项
var wbsSetInits = (from x in Funs.DB.WBS_WbsSetInit where x.CnProfessionId == Const.ACCNProfessionalId orderby x.SuperWbsSetCode select x).ToList();
foreach (var wbsSetInit in wbsSetInits)
{
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 = ac.InstallationId;
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == ac.InstallationId 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 == ac.InstallationId
select x.WbsSetId).FirstOrDefault();
}
wbsSet.ProjectId = project.ProjectId;
wbsSet.StartDate = project.StartDate;
wbsSet.EndDate = project.EndDate;
wbsSet.Flag = wbsSetInit.Flag;
wbsSet.Way = wbsSetInit.Way;
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
wbsSet.Remark = wbsSetInit.Remark;
wbsSet.IsIn = true;
BLL.WbsSetService.AddWbsSet(wbsSet);
}
var totalCostControlInits = from x in Funs.DB.WBS_CostControlInit orderby x.CostControlInitCode select x;
//拷贝费用清单对应关系
var wbsSetMatchCostControlInits = from x in Funs.DB.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControlInits)
{
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
wbsSetMatchCostControl.WbsSetId = (from x in Funs.DB.Wbs_WbsSet
where x.WbsSetCode == wbsSetMatchCostControlInit.WbsSetCode && x.InstallationId == ac.InstallationId
select x.WbsSetId).FirstOrDefault();
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
//拷贝费用清单项
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.ProjectId = project.ProjectId;
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
costControl.CostControlCode = costControlInit.CostControlInitCode;
costControl.CostControlName = costControlInit.CostControlInitName;
costControl.Unit = costControlInit.Unit;
BLL.CostControlService.AddCostControl(costControl);
}
}
}
}
}
#endregion
#region
private void InsertGE(Model.Base_Project project)
{
var ge = Funs.DB.Project_Installation.FirstOrDefault(x => x.ProjectId == project.ProjectId && x.InstallationName == "地勘");
if (ge == null)
{
Model.Project_Installation installation = new Project_Installation();
installation.InstallationId = SQLHelper.GetNewID(typeof(Model.Project_Installation));
installation.ProjectId = project.ProjectId;
installation.InstallationCode = "GE";
installation.InstallationName = "地勘";
installation.SuperInstallationId = "0";
installation.StartDate = project.StartDate;
installation.EndDate = project.EndDate;
installation.IsEnd = true;
BLL.Project_InstallationService.AddInstallation(installation);
// 拷贝总图专业下WBS内容
//拷贝单位工程及子单位工程
var unitProjectInits = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Const.GECNProfessionalId orderby x.SuperUnitProject select x;
foreach (var unitProjectInit in unitProjectInits)
{
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 == installation.InstallationId
select x.UnitProjectId).FirstOrDefault();
}
unitProject.InstallationId = installation.InstallationId;
unitProject.ProjectId = project.ProjectId;
unitProject.StartDate = project.StartDate;
unitProject.EndDate = project.EndDate;
unitProject.Remark = unitProjectInit.Remark;
unitProject.IsIn = true;
BLL.UnitProjectService.AddUnitProject(unitProject);
}
//拷贝分部/子分部/分项/子分项
var wbsSetInits = (from x in Funs.DB.WBS_WbsSetInit where x.CnProfessionId == Const.GECNProfessionalId orderby x.SuperWbsSetCode select x).ToList();
foreach (var wbsSetInit in wbsSetInits)
{
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 = installation.InstallationId;
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == installation.InstallationId 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 == installation.InstallationId
select x.WbsSetId).FirstOrDefault();
}
wbsSet.ProjectId = project.ProjectId;
wbsSet.StartDate = project.StartDate;
wbsSet.EndDate = project.EndDate;
wbsSet.Flag = wbsSetInit.Flag;
wbsSet.Way = wbsSetInit.Way;
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
wbsSet.Remark = wbsSetInit.Remark;
wbsSet.IsIn = true;
BLL.WbsSetService.AddWbsSet(wbsSet);
}
var totalCostControlInits = from x in Funs.DB.WBS_CostControlInit orderby x.CostControlInitCode select x;
//拷贝费用清单对应关系
var wbsSetMatchCostControlInits = from x in Funs.DB.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControlInits)
{
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
wbsSetMatchCostControl.WbsSetId = (from x in Funs.DB.Wbs_WbsSet
where x.WbsSetCode == wbsSetMatchCostControlInit.WbsSetCode && x.InstallationId == installation.InstallationId
select x.WbsSetId).FirstOrDefault();
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
//拷贝费用清单项
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.ProjectId = project.ProjectId;
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
costControl.CostControlCode = costControlInit.CostControlInitCode;
costControl.CostControlName = costControlInit.CostControlInitName;
costControl.Unit = costControlInit.Unit;
BLL.CostControlService.AddCostControl(costControl);
}
}
}
else
{
ge.IsEnd = true;
BLL.Project_InstallationService.UpdateInstallation(ge);
Model.Wbs_UnitProject up = BLL.UnitProjectService.GetUnitProjectIdByInstallationId(ge.InstallationId);
if (up == null)
{
// 拷贝总图专业下WBS内容
//拷贝单位工程及子单位工程
var unitProjectInits = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Const.GECNProfessionalId orderby x.SuperUnitProject select x;
foreach (var unitProjectInit in unitProjectInits)
{
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 == ge.InstallationId
select x.UnitProjectId).FirstOrDefault();
}
unitProject.InstallationId = ge.InstallationId;
unitProject.ProjectId = project.ProjectId;
unitProject.StartDate = project.StartDate;
unitProject.EndDate = project.EndDate;
unitProject.Remark = unitProjectInit.Remark;
unitProject.IsIn = true;
BLL.UnitProjectService.AddUnitProject(unitProject);
}
//拷贝分部/子分部/分项/子分项
var wbsSetInits = (from x in Funs.DB.WBS_WbsSetInit where x.CnProfessionId == Const.GECNProfessionalId orderby x.SuperWbsSetCode select x).ToList();
foreach (var wbsSetInit in wbsSetInits)
{
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 = ge.InstallationId;
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == ge.InstallationId 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 == ge.InstallationId
select x.WbsSetId).FirstOrDefault();
}
wbsSet.ProjectId = project.ProjectId;
wbsSet.StartDate = project.StartDate;
wbsSet.EndDate = project.EndDate;
wbsSet.Flag = wbsSetInit.Flag;
wbsSet.Way = wbsSetInit.Way;
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
wbsSet.Remark = wbsSetInit.Remark;
wbsSet.IsIn = true;
BLL.WbsSetService.AddWbsSet(wbsSet);
}
var totalCostControlInits = from x in Funs.DB.WBS_CostControlInit orderby x.CostControlInitCode select x;
//拷贝费用清单对应关系
var wbsSetMatchCostControlInits = from x in Funs.DB.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControlInits)
{
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
wbsSetMatchCostControl.WbsSetId = (from x in Funs.DB.Wbs_WbsSet
where x.WbsSetCode == wbsSetMatchCostControlInit.WbsSetCode && x.InstallationId == ge.InstallationId
select x.WbsSetId).FirstOrDefault();
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
//拷贝费用清单项
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.ProjectId = project.ProjectId;
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
costControl.CostControlCode = costControlInit.CostControlInitCode;
costControl.CostControlName = costControlInit.CostControlInitName;
costControl.Unit = costControlInit.Unit;
BLL.CostControlService.AddCostControl(costControl);
}
}
}
}
}
#endregion
#region
private void InsertUP(Model.Base_Project project)
{
var u = Funs.DB.Project_Installation.FirstOrDefault(x => x.ProjectId == project.ProjectId && x.InstallationName == "全厂地下主管网");
if (u == null)
{
Model.Project_Installation installation = new Project_Installation();
installation.InstallationId = SQLHelper.GetNewID(typeof(Model.Project_Installation));
installation.ProjectId = project.ProjectId;
installation.InstallationCode = "UP";
installation.InstallationName = "全厂地下主管网";
installation.SuperInstallationId = "0";
installation.StartDate = project.StartDate;
installation.EndDate = project.EndDate;
installation.IsEnd = true;
BLL.Project_InstallationService.AddInstallation(installation);
// 拷贝总图专业下WBS内容
//拷贝单位工程及子单位工程
var unitProjectInits = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Const.UPCNProfessionalId orderby x.SuperUnitProject select x;
foreach (var unitProjectInit in unitProjectInits)
{
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 == installation.InstallationId
select x.UnitProjectId).FirstOrDefault();
}
unitProject.InstallationId = installation.InstallationId;
unitProject.ProjectId = project.ProjectId;
unitProject.StartDate = project.StartDate;
unitProject.EndDate = project.EndDate;
unitProject.Remark = unitProjectInit.Remark;
unitProject.IsIn = true;
BLL.UnitProjectService.AddUnitProject(unitProject);
}
//拷贝分部/子分部/分项/子分项
var wbsSetInits = (from x in Funs.DB.WBS_WbsSetInit where x.CnProfessionId == Const.UPCNProfessionalId orderby x.SuperWbsSetCode select x).ToList();
foreach (var wbsSetInit in wbsSetInits)
{
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 = installation.InstallationId;
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == installation.InstallationId 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 == installation.InstallationId
select x.WbsSetId).FirstOrDefault();
}
wbsSet.ProjectId = project.ProjectId;
wbsSet.StartDate = project.StartDate;
wbsSet.EndDate = project.EndDate;
wbsSet.Flag = wbsSetInit.Flag;
wbsSet.Way = wbsSetInit.Way;
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
wbsSet.Remark = wbsSetInit.Remark;
wbsSet.IsIn = true;
BLL.WbsSetService.AddWbsSet(wbsSet);
}
var totalCostControlInits = from x in Funs.DB.WBS_CostControlInit orderby x.CostControlInitCode select x;
//拷贝费用清单对应关系
var wbsSetMatchCostControlInits = from x in Funs.DB.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControlInits)
{
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
wbsSetMatchCostControl.WbsSetId = (from x in Funs.DB.Wbs_WbsSet
where x.WbsSetCode == wbsSetMatchCostControlInit.WbsSetCode && x.InstallationId == installation.InstallationId
select x.WbsSetId).FirstOrDefault();
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
//拷贝费用清单项
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.ProjectId = project.ProjectId;
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
costControl.CostControlCode = costControlInit.CostControlInitCode;
costControl.CostControlName = costControlInit.CostControlInitName;
costControl.Unit = costControlInit.Unit;
BLL.CostControlService.AddCostControl(costControl);
}
}
}
else
{
u.IsEnd = true;
BLL.Project_InstallationService.UpdateInstallation(u);
Model.Wbs_UnitProject up = BLL.UnitProjectService.GetUnitProjectIdByInstallationId(u.InstallationId);
if (up == null)
{
// 拷贝总图专业下WBS内容
//拷贝单位工程及子单位工程
var unitProjectInits = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Const.UPCNProfessionalId orderby x.SuperUnitProject select x;
foreach (var unitProjectInit in unitProjectInits)
{
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 == u.InstallationId
select x.UnitProjectId).FirstOrDefault();
}
unitProject.InstallationId = u.InstallationId;
unitProject.ProjectId = project.ProjectId;
unitProject.StartDate = project.StartDate;
unitProject.EndDate = project.EndDate;
unitProject.Remark = unitProjectInit.Remark;
unitProject.IsIn = true;
BLL.UnitProjectService.AddUnitProject(unitProject);
}
//拷贝分部/子分部/分项/子分项
var wbsSetInits = (from x in Funs.DB.WBS_WbsSetInit where x.CnProfessionId == Const.UPCNProfessionalId orderby x.SuperWbsSetCode select x).ToList();
foreach (var wbsSetInit in wbsSetInits)
{
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 = u.InstallationId;
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == u.InstallationId 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 == u.InstallationId
select x.WbsSetId).FirstOrDefault();
}
wbsSet.ProjectId = project.ProjectId;
wbsSet.StartDate = project.StartDate;
wbsSet.EndDate = project.EndDate;
wbsSet.Flag = wbsSetInit.Flag;
wbsSet.Way = wbsSetInit.Way;
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
wbsSet.Remark = wbsSetInit.Remark;
wbsSet.IsIn = true;
BLL.WbsSetService.AddWbsSet(wbsSet);
}
var totalCostControlInits = from x in Funs.DB.WBS_CostControlInit orderby x.CostControlInitCode select x;
//拷贝费用清单对应关系
var wbsSetMatchCostControlInits = from x in Funs.DB.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControlInits)
{
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
wbsSetMatchCostControl.WbsSetId = (from x in Funs.DB.Wbs_WbsSet
where x.WbsSetCode == wbsSetMatchCostControlInit.WbsSetCode && x.InstallationId == u.InstallationId
select x.WbsSetId).FirstOrDefault();
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
//拷贝费用清单项
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.ProjectId = project.ProjectId;
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
costControl.CostControlCode = costControlInit.CostControlInitCode;
costControl.CostControlName = costControlInit.CostControlInitName;
costControl.Unit = costControlInit.Unit;
BLL.CostControlService.AddCostControl(costControl);
}
}
}
}
}
#endregion
#region
private void InsertTF(Model.Base_Project project)
{
var tf = Funs.DB.Project_Installation.FirstOrDefault(x => x.ProjectId == project.ProjectId && x.InstallationName == "临时设施");
if (tf == null)
{
Model.Project_Installation installation = new Project_Installation();
installation.InstallationId = SQLHelper.GetNewID(typeof(Model.Project_Installation));
installation.ProjectId = project.ProjectId;
installation.InstallationCode = "TF";
installation.InstallationName = "临时设施";
installation.SuperInstallationId = "0";
installation.StartDate = project.StartDate;
installation.EndDate = project.EndDate;
installation.IsEnd = true;
BLL.Project_InstallationService.AddInstallation(installation);
// 拷贝总图专业下WBS内容
//拷贝单位工程及子单位工程
var unitProjectInits = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Const.TFCNProfessionalId orderby x.SuperUnitProject select x;
foreach (var unitProjectInit in unitProjectInits)
{
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 == installation.InstallationId
select x.UnitProjectId).FirstOrDefault();
}
unitProject.InstallationId = installation.InstallationId;
unitProject.ProjectId = project.ProjectId;
unitProject.StartDate = project.StartDate;
unitProject.EndDate = project.EndDate;
unitProject.Remark = unitProjectInit.Remark;
unitProject.IsIn = true;
BLL.UnitProjectService.AddUnitProject(unitProject);
}
//拷贝分部/子分部/分项/子分项
var wbsSetInits = (from x in Funs.DB.WBS_WbsSetInit where x.CnProfessionId == Const.TFCNProfessionalId orderby x.SuperWbsSetCode select x).ToList();
foreach (var wbsSetInit in wbsSetInits)
{
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 = installation.InstallationId;
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == installation.InstallationId 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 == installation.InstallationId
select x.WbsSetId).FirstOrDefault();
}
wbsSet.ProjectId = project.ProjectId;
wbsSet.StartDate = project.StartDate;
wbsSet.EndDate = project.EndDate;
wbsSet.Flag = wbsSetInit.Flag;
wbsSet.Way = wbsSetInit.Way;
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
wbsSet.Remark = wbsSetInit.Remark;
wbsSet.IsIn = true;
BLL.WbsSetService.AddWbsSet(wbsSet);
}
var totalCostControlInits = from x in Funs.DB.WBS_CostControlInit orderby x.CostControlInitCode select x;
//拷贝费用清单对应关系
var wbsSetMatchCostControlInits = from x in Funs.DB.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControlInits)
{
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
wbsSetMatchCostControl.WbsSetId = (from x in Funs.DB.Wbs_WbsSet
where x.WbsSetCode == wbsSetMatchCostControlInit.WbsSetCode && x.InstallationId == installation.InstallationId
select x.WbsSetId).FirstOrDefault();
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
//拷贝费用清单项
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.ProjectId = project.ProjectId;
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
costControl.CostControlCode = costControlInit.CostControlInitCode;
costControl.CostControlName = costControlInit.CostControlInitName;
costControl.Unit = costControlInit.Unit;
BLL.CostControlService.AddCostControl(costControl);
}
}
}
else
{
tf.IsEnd = true;
BLL.Project_InstallationService.UpdateInstallation(tf);
Model.Wbs_UnitProject up = BLL.UnitProjectService.GetUnitProjectIdByInstallationId(tf.InstallationId);
if (up == null)
{
// 拷贝总图专业下WBS内容
//拷贝单位工程及子单位工程
var unitProjectInits = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Const.TFCNProfessionalId orderby x.SuperUnitProject select x;
foreach (var unitProjectInit in unitProjectInits)
{
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 == tf.InstallationId
select x.UnitProjectId).FirstOrDefault();
}
unitProject.InstallationId = tf.InstallationId;
unitProject.ProjectId = project.ProjectId;
unitProject.StartDate = project.StartDate;
unitProject.EndDate = project.EndDate;
unitProject.Remark = unitProjectInit.Remark;
unitProject.IsIn = true;
BLL.UnitProjectService.AddUnitProject(unitProject);
}
//拷贝分部/子分部/分项/子分项
var wbsSetInits = (from x in Funs.DB.WBS_WbsSetInit where x.CnProfessionId == Const.TFCNProfessionalId orderby x.SuperWbsSetCode select x).ToList();
foreach (var wbsSetInit in wbsSetInits)
{
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 = tf.InstallationId;
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == tf.InstallationId 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 == tf.InstallationId
select x.WbsSetId).FirstOrDefault();
}
wbsSet.ProjectId = project.ProjectId;
wbsSet.StartDate = project.StartDate;
wbsSet.EndDate = project.EndDate;
wbsSet.Flag = wbsSetInit.Flag;
wbsSet.Way = wbsSetInit.Way;
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
wbsSet.Remark = wbsSetInit.Remark;
wbsSet.IsIn = true;
BLL.WbsSetService.AddWbsSet(wbsSet);
}
var totalCostControlInits = from x in Funs.DB.WBS_CostControlInit orderby x.CostControlInitCode select x;
//拷贝费用清单对应关系
var wbsSetMatchCostControlInits = from x in Funs.DB.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControlInits)
{
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
wbsSetMatchCostControl.WbsSetId = (from x in Funs.DB.Wbs_WbsSet
where x.WbsSetCode == wbsSetMatchCostControlInit.WbsSetCode && x.InstallationId == tf.InstallationId
select x.WbsSetId).FirstOrDefault();
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
//拷贝费用清单项
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.ProjectId = project.ProjectId;
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
costControl.CostControlCode = costControlInit.CostControlInitCode;
costControl.CostControlName = costControlInit.CostControlInitName;
costControl.Unit = costControlInit.Unit;
BLL.CostControlService.AddCostControl(costControl);
}
}
}
}
}
#endregion
#region
private void InsertGL(Model.Base_Project project)
{
var gl = Funs.DB.Project_Installation.FirstOrDefault(x => x.ProjectId == project.ProjectId && x.InstallationName == "总图");
if (gl == null)
{
Model.Project_Installation installation = new Project_Installation();
installation.InstallationId = SQLHelper.GetNewID(typeof(Model.Project_Installation));
installation.ProjectId = project.ProjectId;
installation.InstallationCode = "GL";
installation.InstallationName = "总图";
installation.SuperInstallationId = "0";
installation.StartDate = project.StartDate;
installation.EndDate = project.EndDate;
BLL.Project_InstallationService.AddInstallation(installation);
// 拷贝总图专业下WBS内容
//拷贝单位工程及子单位工程
var unitProjectInits = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Const.GLCNProfessionalId orderby x.SuperUnitProject select x;
foreach (var unitProjectInit in unitProjectInits)
{
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 == installation.InstallationId
select x.UnitProjectId).FirstOrDefault();
}
unitProject.InstallationId = installation.InstallationId;
unitProject.ProjectId = project.ProjectId;
unitProject.StartDate = project.StartDate;
unitProject.EndDate = project.EndDate;
unitProject.Remark = unitProjectInit.Remark;
unitProject.IsIn = true;
BLL.UnitProjectService.AddUnitProject(unitProject);
}
//拷贝分部/子分部/分项/子分项
var wbsSetInits = (from x in Funs.DB.WBS_WbsSetInit where x.CnProfessionId == Const.GLCNProfessionalId orderby x.SuperWbsSetCode select x).ToList();
foreach (var wbsSetInit in wbsSetInits)
{
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 = installation.InstallationId;
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == installation.InstallationId 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 == installation.InstallationId
select x.WbsSetId).FirstOrDefault();
}
wbsSet.ProjectId = project.ProjectId;
wbsSet.StartDate = project.StartDate;
wbsSet.EndDate = project.EndDate;
wbsSet.Flag = wbsSetInit.Flag;
wbsSet.Way = wbsSetInit.Way;
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
wbsSet.Remark = wbsSetInit.Remark;
wbsSet.IsIn = true;
BLL.WbsSetService.AddWbsSet(wbsSet);
}
var totalCostControlInits = from x in Funs.DB.WBS_CostControlInit orderby x.CostControlInitCode select x;
//拷贝费用清单对应关系
var wbsSetMatchCostControlInits = from x in Funs.DB.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControlInits)
{
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
wbsSetMatchCostControl.WbsSetId = (from x in Funs.DB.Wbs_WbsSet
where x.WbsSetCode == wbsSetMatchCostControlInit.WbsSetCode && x.InstallationId == installation.InstallationId
select x.WbsSetId).FirstOrDefault();
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
//拷贝费用清单项
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.ProjectId = project.ProjectId;
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
costControl.CostControlCode = costControlInit.CostControlInitCode;
costControl.CostControlName = costControlInit.CostControlInitName;
costControl.Unit = costControlInit.Unit;
BLL.CostControlService.AddCostControl(costControl);
}
}
}
else
{
gl.IsEnd = true;
BLL.Project_InstallationService.UpdateInstallation(gl);
Model.Wbs_UnitProject up = BLL.UnitProjectService.GetUnitProjectIdByInstallationId(gl.InstallationId);
if (up == null)
{
// 拷贝总图专业下WBS内容
//拷贝单位工程及子单位工程
var unitProjectInits = from x in Funs.DB.Wbs_UnitProjectInit where x.CnProfessionId == Const.GLCNProfessionalId orderby x.SuperUnitProject select x;
foreach (var unitProjectInit in unitProjectInits)
{
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 == gl.InstallationId
select x.UnitProjectId).FirstOrDefault();
}
unitProject.InstallationId = gl.InstallationId;
unitProject.ProjectId = project.ProjectId;
unitProject.StartDate = project.StartDate;
unitProject.EndDate = project.EndDate;
unitProject.Remark = unitProjectInit.Remark;
unitProject.IsIn = true;
BLL.UnitProjectService.AddUnitProject(unitProject);
}
//拷贝分部/子分部/分项/子分项
var wbsSetInits = (from x in Funs.DB.WBS_WbsSetInit where x.CnProfessionId == Const.GLCNProfessionalId orderby x.SuperWbsSetCode select x).ToList();
foreach (var wbsSetInit in wbsSetInits)
{
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 = gl.InstallationId;
wbsSet.UnitProjectId = (from x in Funs.DB.Wbs_UnitProject where x.UnitProjectCode == wbsSetInit.UnitProjectCode && x.InstallationId == gl.InstallationId 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 == gl.InstallationId
select x.WbsSetId).FirstOrDefault();
}
wbsSet.ProjectId = project.ProjectId;
wbsSet.StartDate = project.StartDate;
wbsSet.EndDate = project.EndDate;
wbsSet.Flag = wbsSetInit.Flag;
wbsSet.Way = wbsSetInit.Way;
wbsSet.ControlItemDef = wbsSetInit.ControlItemDef;
wbsSet.ControlPoint = wbsSetInit.ControlPoint;
wbsSet.Remark = wbsSetInit.Remark;
wbsSet.IsIn = true;
BLL.WbsSetService.AddWbsSet(wbsSet);
}
var totalCostControlInits = from x in Funs.DB.WBS_CostControlInit orderby x.CostControlInitCode select x;
//拷贝费用清单对应关系
var wbsSetMatchCostControlInits = from x in Funs.DB.WBS_WbsSetMatchCostControlInit orderby x.WbsSetCode select x;
foreach (var wbsSetMatchCostControlInit in wbsSetMatchCostControlInits)
{
Model.WBS_WbsSetMatchCostControl wbsSetMatchCostControl = new Model.WBS_WbsSetMatchCostControl();
wbsSetMatchCostControl.WbsSetMatchCostControlId = SQLHelper.GetNewID();
wbsSetMatchCostControl.WbsSetId = (from x in Funs.DB.Wbs_WbsSet
where x.WbsSetCode == wbsSetMatchCostControlInit.WbsSetCode && x.InstallationId == gl.InstallationId
select x.WbsSetId).FirstOrDefault();
wbsSetMatchCostControl.CostControlCode = wbsSetMatchCostControlInit.CostControlInitCode;
BLL.WbsSetMatchCostControlService.AddWbsSetMatchCostControl(wbsSetMatchCostControl);
//拷贝费用清单项
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.ProjectId = project.ProjectId;
costControl.WbsSetId = wbsSetMatchCostControl.WbsSetId;
costControl.CostControlCode = costControlInit.CostControlInitCode;
costControl.CostControlName = costControlInit.CostControlInitName;
costControl.Unit = costControlInit.Unit;
BLL.CostControlService.AddCostControl(costControl);
}
}
}
}
}
#endregion

View File

@ -1925,6 +1925,9 @@ namespace Model
partial void InsertWBS_Installation(WBS_Installation instance);
partial void UpdateWBS_Installation(WBS_Installation instance);
partial void DeleteWBS_Installation(WBS_Installation instance);
partial void InsertWBS_MilePost(WBS_MilePost instance);
partial void UpdateWBS_MilePost(WBS_MilePost instance);
partial void DeleteWBS_MilePost(WBS_MilePost instance);
partial void InsertWbs_UnitProject(Wbs_UnitProject instance);
partial void UpdateWbs_UnitProject(Wbs_UnitProject instance);
partial void DeleteWbs_UnitProject(Wbs_UnitProject instance);
@ -8011,6 +8014,14 @@ namespace Model
}
}
public System.Data.Linq.Table<WBS_MilePost> WBS_MilePost
{
get
{
return this.GetTable<WBS_MilePost>();
}
}
public System.Data.Linq.Table<Wbs_UnitProject> Wbs_UnitProject
{
get
@ -22878,6 +22889,8 @@ namespace Model
private EntitySet<WBS_ForeignBreakdownProject> _WBS_ForeignBreakdownProject;
private EntitySet<WBS_MilePost> _WBS_MilePost;
private EntitySet<Wbs_UnitProject> _Wbs_UnitProject;
private EntitySet<Wbs_WbsSet> _Wbs_WbsSet;
@ -23225,6 +23238,7 @@ namespace Model
this._WBS_CostControl = new EntitySet<WBS_CostControl>(new Action<WBS_CostControl>(this.attach_WBS_CostControl), new Action<WBS_CostControl>(this.detach_WBS_CostControl));
this._WBS_DivisionProject = new EntitySet<WBS_DivisionProject>(new Action<WBS_DivisionProject>(this.attach_WBS_DivisionProject), new Action<WBS_DivisionProject>(this.detach_WBS_DivisionProject));
this._WBS_ForeignBreakdownProject = new EntitySet<WBS_ForeignBreakdownProject>(new Action<WBS_ForeignBreakdownProject>(this.attach_WBS_ForeignBreakdownProject), new Action<WBS_ForeignBreakdownProject>(this.detach_WBS_ForeignBreakdownProject));
this._WBS_MilePost = new EntitySet<WBS_MilePost>(new Action<WBS_MilePost>(this.attach_WBS_MilePost), new Action<WBS_MilePost>(this.detach_WBS_MilePost));
this._Wbs_UnitProject = new EntitySet<Wbs_UnitProject>(new Action<Wbs_UnitProject>(this.attach_Wbs_UnitProject), new Action<Wbs_UnitProject>(this.detach_Wbs_UnitProject));
this._Wbs_WbsSet = new EntitySet<Wbs_WbsSet>(new Action<Wbs_WbsSet>(this.attach_Wbs_WbsSet), new Action<Wbs_WbsSet>(this.detach_Wbs_WbsSet));
this._WBS_WorkPackageProject = new EntitySet<WBS_WorkPackageProject>(new Action<WBS_WorkPackageProject>(this.attach_WBS_WorkPackageProject), new Action<WBS_WorkPackageProject>(this.detach_WBS_WorkPackageProject));
@ -27268,6 +27282,19 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_MilePost_Base_Project", Storage="_WBS_MilePost", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")]
public EntitySet<WBS_MilePost> WBS_MilePost
{
get
{
return this._WBS_MilePost;
}
set
{
this._WBS_MilePost.Assign(value);
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Wbs_UnitProject_Base_Project", Storage="_Wbs_UnitProject", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")]
public EntitySet<Wbs_UnitProject> Wbs_UnitProject
{
@ -30465,6 +30492,18 @@ namespace Model
entity.Base_Project = null;
}
private void attach_WBS_MilePost(WBS_MilePost entity)
{
this.SendPropertyChanging();
entity.Base_Project = this;
}
private void detach_WBS_MilePost(WBS_MilePost entity)
{
this.SendPropertyChanging();
entity.Base_Project = null;
}
private void attach_Wbs_UnitProject(Wbs_UnitProject entity)
{
this.SendPropertyChanging();
@ -244734,7 +244773,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(2000)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(200)")]
public string Address
{
get
@ -244798,7 +244837,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(200)")]
public string WorkAreaName
{
get
@ -263908,6 +263947,8 @@ namespace Model
private EntitySet<WBS_BreakdownProject> _WBS_BreakdownProject;
private EntitySet<WBS_MilePost> _WBS_MilePost;
private EntitySet<WBSRectificationMeasureSet> _WBSRectificationMeasureSet;
private EntitySet<WPQ_WPQList> _WPQ_WPQList;
@ -264345,6 +264386,7 @@ namespace Model
this._Training_TrainTestDBItem = new EntitySet<Training_TrainTestDBItem>(new Action<Training_TrainTestDBItem>(this.attach_Training_TrainTestDBItem), new Action<Training_TrainTestDBItem>(this.detach_Training_TrainTestDBItem));
this._Unqualified_WorkContactApprove = new EntitySet<Unqualified_WorkContactApprove>(new Action<Unqualified_WorkContactApprove>(this.attach_Unqualified_WorkContactApprove), new Action<Unqualified_WorkContactApprove>(this.detach_Unqualified_WorkContactApprove));
this._WBS_BreakdownProject = new EntitySet<WBS_BreakdownProject>(new Action<WBS_BreakdownProject>(this.attach_WBS_BreakdownProject), new Action<WBS_BreakdownProject>(this.detach_WBS_BreakdownProject));
this._WBS_MilePost = new EntitySet<WBS_MilePost>(new Action<WBS_MilePost>(this.attach_WBS_MilePost), new Action<WBS_MilePost>(this.detach_WBS_MilePost));
this._WBSRectificationMeasureSet = new EntitySet<WBSRectificationMeasureSet>(new Action<WBSRectificationMeasureSet>(this.attach_WBSRectificationMeasureSet), new Action<WBSRectificationMeasureSet>(this.detach_WBSRectificationMeasureSet));
this._WPQ_WPQList = new EntitySet<WPQ_WPQList>(new Action<WPQ_WPQList>(this.attach_WPQ_WPQList), new Action<WPQ_WPQList>(this.detach_WPQ_WPQList));
this._Wx_PageData = new EntitySet<Wx_PageData>(new Action<Wx_PageData>(this.attach_Wx_PageData), new Action<Wx_PageData>(this.detach_Wx_PageData));
@ -269431,6 +269473,19 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_MilePost_Sys_User", Storage="_WBS_MilePost", ThisKey="UserId", OtherKey="CompileMan", DeleteRule="NO ACTION")]
public EntitySet<WBS_MilePost> WBS_MilePost
{
get
{
return this._WBS_MilePost;
}
set
{
this._WBS_MilePost.Assign(value);
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBSRectificationMeasureSet_Sys_User", Storage="_WBSRectificationMeasureSet", ThisKey="UserId", OtherKey="CompileMan", DeleteRule="NO ACTION")]
public EntitySet<WBSRectificationMeasureSet> WBSRectificationMeasureSet
{
@ -273243,6 +273298,18 @@ namespace Model
entity.Sys_User = null;
}
private void attach_WBS_MilePost(WBS_MilePost entity)
{
this.SendPropertyChanging();
entity.Sys_User = this;
}
private void detach_WBS_MilePost(WBS_MilePost entity)
{
this.SendPropertyChanging();
entity.Sys_User = null;
}
private void attach_WBSRectificationMeasureSet(WBSRectificationMeasureSet entity)
{
this.SendPropertyChanging();
@ -326369,7 +326436,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(2000)")]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Address", DbType="NVarChar(200)")]
public string Address
{
get
@ -326385,7 +326452,7 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(MAX)", UpdateCheck=UpdateCheck.Never)]
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkAreaName", DbType="NVarChar(200)")]
public string WorkAreaName
{
get
@ -333208,6 +333275,10 @@ namespace Model
private System.Nullable<System.DateTime> _Months;
private System.Nullable<System.DateTime> _StartDate;
private System.Nullable<System.DateTime> _EndDate;
private string _CostControlCode;
private string _CostControlName;
@ -333224,9 +333295,9 @@ namespace Model
private System.Nullable<double> _TotalThisNum;
private System.Nullable<decimal> _PlanNum;
private System.Nullable<double> _PlanNum;
private System.Nullable<decimal> _ThisNum;
private System.Nullable<double> _ThisNum;
private System.Nullable<decimal> _RealPrice;
@ -333296,6 +333367,38 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime")]
public System.Nullable<System.DateTime> StartDate
{
get
{
return this._StartDate;
}
set
{
if ((this._StartDate != value))
{
this._StartDate = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
public System.Nullable<System.DateTime> EndDate
{
get
{
return this._EndDate;
}
set
{
if ((this._EndDate != value))
{
this._EndDate = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CostControlCode", DbType="NVarChar(50)")]
public string CostControlCode
{
@ -333424,8 +333527,8 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanNum", DbType="Decimal(9,2)")]
public System.Nullable<decimal> PlanNum
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanNum", DbType="Float")]
public System.Nullable<double> PlanNum
{
get
{
@ -333440,8 +333543,8 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ThisNum", DbType="Decimal(9,2)")]
public System.Nullable<decimal> ThisNum
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ThisNum", DbType="Float")]
public System.Nullable<double> ThisNum
{
get
{
@ -333748,11 +333851,15 @@ namespace Model
private System.Nullable<System.DateTime> _Months;
private System.Nullable<decimal> _ThisPlanValue;
private System.Nullable<System.DateTime> _StartDate;
private System.Nullable<decimal> _ThisRealCost;
private System.Nullable<System.DateTime> _EndDate;
private System.Nullable<decimal> _ThisPlanCost;
private System.Nullable<double> _ThisPlanValue;
private System.Nullable<double> _ThisRealCost;
private System.Nullable<double> _ThisPlanCost;
private System.Nullable<double> _TotalPlanValue;
@ -333812,8 +333919,40 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ThisPlanValue", DbType="Decimal(18,2)")]
public System.Nullable<decimal> ThisPlanValue
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime")]
public System.Nullable<System.DateTime> StartDate
{
get
{
return this._StartDate;
}
set
{
if ((this._StartDate != value))
{
this._StartDate = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
public System.Nullable<System.DateTime> EndDate
{
get
{
return this._EndDate;
}
set
{
if ((this._EndDate != value))
{
this._EndDate = value;
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ThisPlanValue", DbType="Float")]
public System.Nullable<double> ThisPlanValue
{
get
{
@ -333828,8 +333967,8 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ThisRealCost", DbType="Decimal(18,2)")]
public System.Nullable<decimal> ThisRealCost
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ThisRealCost", DbType="Float")]
public System.Nullable<double> ThisRealCost
{
get
{
@ -333844,8 +333983,8 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ThisPlanCost", DbType="Decimal(18,2)")]
public System.Nullable<decimal> ThisPlanCost
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ThisPlanCost", DbType="Float")]
public System.Nullable<double> ThisPlanCost
{
get
{
@ -336618,6 +336757,8 @@ namespace Model
private System.Nullable<int> _SortIndex;
private EntitySet<WBS_MilePost> _WBS_MilePost;
private EntitySet<Wbs_UnitProjectInit> _Wbs_UnitProjectInit;
private EntitySet<WBS_WbsSetInit> _WBS_WbsSetInit;
@ -336640,6 +336781,7 @@ namespace Model
public WBS_CnProfessionInit()
{
this._WBS_MilePost = new EntitySet<WBS_MilePost>(new Action<WBS_MilePost>(this.attach_WBS_MilePost), new Action<WBS_MilePost>(this.detach_WBS_MilePost));
this._Wbs_UnitProjectInit = new EntitySet<Wbs_UnitProjectInit>(new Action<Wbs_UnitProjectInit>(this.attach_Wbs_UnitProjectInit), new Action<Wbs_UnitProjectInit>(this.detach_Wbs_UnitProjectInit));
this._WBS_WbsSetInit = new EntitySet<WBS_WbsSetInit>(new Action<WBS_WbsSetInit>(this.attach_WBS_WbsSetInit), new Action<WBS_WbsSetInit>(this.detach_WBS_WbsSetInit));
OnCreated();
@ -336745,6 +336887,19 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_MilePost_WBS_CnProfessionInit", Storage="_WBS_MilePost", ThisKey="CnProfessionId", OtherKey="CnProfessionId", DeleteRule="NO ACTION")]
public EntitySet<WBS_MilePost> WBS_MilePost
{
get
{
return this._WBS_MilePost;
}
set
{
this._WBS_MilePost.Assign(value);
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Wbs_UnitProjectInit_WBS_CnProfessionInit", Storage="_Wbs_UnitProjectInit", ThisKey="CnProfessionId", OtherKey="CnProfessionId", DeleteRule="NO ACTION")]
public EntitySet<Wbs_UnitProjectInit> Wbs_UnitProjectInit
{
@ -336791,6 +336946,18 @@ namespace Model
}
}
private void attach_WBS_MilePost(WBS_MilePost entity)
{
this.SendPropertyChanging();
entity.WBS_CnProfessionInit = this;
}
private void detach_WBS_MilePost(WBS_MilePost entity)
{
this.SendPropertyChanging();
entity.WBS_CnProfessionInit = null;
}
private void attach_Wbs_UnitProjectInit(Wbs_UnitProjectInit entity)
{
this.SendPropertyChanging();
@ -338404,6 +338571,10 @@ namespace Model
private System.Nullable<decimal> _ThisNum;
private System.Nullable<System.DateTime> _StartDate;
private System.Nullable<System.DateTime> _EndDate;
private EntityRef<WBS_CostControl> _WBS_CostControl;
#region
@ -338420,6 +338591,10 @@ namespace Model
partial void OnPlanNumChanged();
partial void OnThisNumChanging(System.Nullable<decimal> value);
partial void OnThisNumChanged();
partial void OnStartDateChanging(System.Nullable<System.DateTime> value);
partial void OnStartDateChanged();
partial void OnEndDateChanging(System.Nullable<System.DateTime> value);
partial void OnEndDateChanged();
#endregion
public WBS_CostControlDetail()
@ -338532,6 +338707,46 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime")]
public System.Nullable<System.DateTime> StartDate
{
get
{
return this._StartDate;
}
set
{
if ((this._StartDate != value))
{
this.OnStartDateChanging(value);
this.SendPropertyChanging();
this._StartDate = value;
this.SendPropertyChanged("StartDate");
this.OnStartDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
public System.Nullable<System.DateTime> EndDate
{
get
{
return this._EndDate;
}
set
{
if ((this._EndDate != value))
{
this.OnEndDateChanging(value);
this.SendPropertyChanging();
this._EndDate = value;
this.SendPropertyChanged("EndDate");
this.OnEndDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_CostControlDetail_WBS_CostControl", Storage="_WBS_CostControl", ThisKey="CostControlId", OtherKey="CostControlId", IsForeignKey=true)]
public WBS_CostControl WBS_CostControl
{
@ -338603,6 +338818,10 @@ namespace Model
private System.Nullable<int> _VersionNum;
private System.Nullable<System.DateTime> _StartDate;
private System.Nullable<System.DateTime> _EndDate;
private EntityRef<WBS_CostControl> _WBS_CostControl;
#region
@ -338619,6 +338838,10 @@ namespace Model
partial void OnPlanNumChanged();
partial void OnVersionNumChanging(System.Nullable<int> value);
partial void OnVersionNumChanged();
partial void OnStartDateChanging(System.Nullable<System.DateTime> value);
partial void OnStartDateChanged();
partial void OnEndDateChanging(System.Nullable<System.DateTime> value);
partial void OnEndDateChanged();
#endregion
public WBS_CostControlDetailHistory()
@ -338731,6 +338954,46 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime")]
public System.Nullable<System.DateTime> StartDate
{
get
{
return this._StartDate;
}
set
{
if ((this._StartDate != value))
{
this.OnStartDateChanging(value);
this.SendPropertyChanging();
this._StartDate = value;
this.SendPropertyChanged("StartDate");
this.OnStartDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
public System.Nullable<System.DateTime> EndDate
{
get
{
return this._EndDate;
}
set
{
if ((this._EndDate != value))
{
this.OnEndDateChanging(value);
this.SendPropertyChanging();
this._EndDate = value;
this.SendPropertyChanged("EndDate");
this.OnEndDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_CostControlDetailHistory_WBS_CostControl", Storage="_WBS_CostControl", ThisKey="CostControlId", OtherKey="CostControlId", IsForeignKey=true)]
public WBS_CostControl WBS_CostControl
{
@ -338938,6 +339201,10 @@ namespace Model
private System.Nullable<decimal> _ThisPlanCost;
private System.Nullable<System.DateTime> _StartDate;
private System.Nullable<System.DateTime> _EndDate;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
@ -338954,6 +339221,10 @@ namespace Model
partial void OnThisRealCostChanged();
partial void OnThisPlanCostChanging(System.Nullable<decimal> value);
partial void OnThisPlanCostChanged();
partial void OnStartDateChanging(System.Nullable<System.DateTime> value);
partial void OnStartDateChanged();
partial void OnEndDateChanging(System.Nullable<System.DateTime> value);
partial void OnEndDateChanged();
#endregion
public WBS_CostControlParentDetail()
@ -339081,6 +339352,46 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StartDate", DbType="DateTime")]
public System.Nullable<System.DateTime> StartDate
{
get
{
return this._StartDate;
}
set
{
if ((this._StartDate != value))
{
this.OnStartDateChanging(value);
this.SendPropertyChanging();
this._StartDate = value;
this.SendPropertyChanged("StartDate");
this.OnStartDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EndDate", DbType="DateTime")]
public System.Nullable<System.DateTime> EndDate
{
get
{
return this._EndDate;
}
set
{
if ((this._EndDate != value))
{
this.OnEndDateChanging(value);
this.SendPropertyChanging();
this._EndDate = value;
this.SendPropertyChanged("EndDate");
this.OnEndDateChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
@ -340792,6 +341103,383 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.WBS_MilePost")]
public partial class WBS_MilePost : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _MilePostId;
private string _ProjectId;
private System.Nullable<int> _CnProfessionId;
private string _MilePostName;
private System.Nullable<System.DateTime> _PlanDate;
private System.Nullable<System.DateTime> _RealDate;
private string _CompileMan;
private System.Nullable<System.DateTime> _CompileDate;
private string _Remark;
private EntityRef<Base_Project> _Base_Project;
private EntityRef<Sys_User> _Sys_User;
private EntityRef<WBS_CnProfessionInit> _WBS_CnProfessionInit;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnMilePostIdChanging(string value);
partial void OnMilePostIdChanged();
partial void OnProjectIdChanging(string value);
partial void OnProjectIdChanged();
partial void OnCnProfessionIdChanging(System.Nullable<int> value);
partial void OnCnProfessionIdChanged();
partial void OnMilePostNameChanging(string value);
partial void OnMilePostNameChanged();
partial void OnPlanDateChanging(System.Nullable<System.DateTime> value);
partial void OnPlanDateChanged();
partial void OnRealDateChanging(System.Nullable<System.DateTime> value);
partial void OnRealDateChanged();
partial void OnCompileManChanging(string value);
partial void OnCompileManChanged();
partial void OnCompileDateChanging(System.Nullable<System.DateTime> value);
partial void OnCompileDateChanged();
partial void OnRemarkChanging(string value);
partial void OnRemarkChanged();
#endregion
public WBS_MilePost()
{
this._Base_Project = default(EntityRef<Base_Project>);
this._Sys_User = default(EntityRef<Sys_User>);
this._WBS_CnProfessionInit = default(EntityRef<WBS_CnProfessionInit>);
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MilePostId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string MilePostId
{
get
{
return this._MilePostId;
}
set
{
if ((this._MilePostId != value))
{
this.OnMilePostIdChanging(value);
this.SendPropertyChanging();
this._MilePostId = value;
this.SendPropertyChanged("MilePostId");
this.OnMilePostIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
public string ProjectId
{
get
{
return this._ProjectId;
}
set
{
if ((this._ProjectId != value))
{
if (this._Base_Project.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnProjectIdChanging(value);
this.SendPropertyChanging();
this._ProjectId = value;
this.SendPropertyChanged("ProjectId");
this.OnProjectIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CnProfessionId", DbType="Int")]
public System.Nullable<int> CnProfessionId
{
get
{
return this._CnProfessionId;
}
set
{
if ((this._CnProfessionId != value))
{
if (this._WBS_CnProfessionInit.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnCnProfessionIdChanging(value);
this.SendPropertyChanging();
this._CnProfessionId = value;
this.SendPropertyChanged("CnProfessionId");
this.OnCnProfessionIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MilePostName", DbType="NVarChar(100)")]
public string MilePostName
{
get
{
return this._MilePostName;
}
set
{
if ((this._MilePostName != value))
{
this.OnMilePostNameChanging(value);
this.SendPropertyChanging();
this._MilePostName = value;
this.SendPropertyChanged("MilePostName");
this.OnMilePostNameChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PlanDate", DbType="DateTime")]
public System.Nullable<System.DateTime> PlanDate
{
get
{
return this._PlanDate;
}
set
{
if ((this._PlanDate != value))
{
this.OnPlanDateChanging(value);
this.SendPropertyChanging();
this._PlanDate = value;
this.SendPropertyChanged("PlanDate");
this.OnPlanDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RealDate", DbType="DateTime")]
public System.Nullable<System.DateTime> RealDate
{
get
{
return this._RealDate;
}
set
{
if ((this._RealDate != value))
{
this.OnRealDateChanging(value);
this.SendPropertyChanging();
this._RealDate = value;
this.SendPropertyChanged("RealDate");
this.OnRealDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileMan", DbType="NVarChar(50)")]
public string CompileMan
{
get
{
return this._CompileMan;
}
set
{
if ((this._CompileMan != value))
{
if (this._Sys_User.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnCompileManChanging(value);
this.SendPropertyChanging();
this._CompileMan = value;
this.SendPropertyChanged("CompileMan");
this.OnCompileManChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CompileDate", DbType="DateTime")]
public System.Nullable<System.DateTime> CompileDate
{
get
{
return this._CompileDate;
}
set
{
if ((this._CompileDate != value))
{
this.OnCompileDateChanging(value);
this.SendPropertyChanging();
this._CompileDate = value;
this.SendPropertyChanged("CompileDate");
this.OnCompileDateChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(200)")]
public string Remark
{
get
{
return this._Remark;
}
set
{
if ((this._Remark != value))
{
this.OnRemarkChanging(value);
this.SendPropertyChanging();
this._Remark = value;
this.SendPropertyChanged("Remark");
this.OnRemarkChanged();
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_MilePost_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)]
public Base_Project Base_Project
{
get
{
return this._Base_Project.Entity;
}
set
{
Base_Project previousValue = this._Base_Project.Entity;
if (((previousValue != value)
|| (this._Base_Project.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Base_Project.Entity = null;
previousValue.WBS_MilePost.Remove(this);
}
this._Base_Project.Entity = value;
if ((value != null))
{
value.WBS_MilePost.Add(this);
this._ProjectId = value.ProjectId;
}
else
{
this._ProjectId = default(string);
}
this.SendPropertyChanged("Base_Project");
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_MilePost_Sys_User", Storage="_Sys_User", ThisKey="CompileMan", OtherKey="UserId", IsForeignKey=true)]
public Sys_User Sys_User
{
get
{
return this._Sys_User.Entity;
}
set
{
Sys_User previousValue = this._Sys_User.Entity;
if (((previousValue != value)
|| (this._Sys_User.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._Sys_User.Entity = null;
previousValue.WBS_MilePost.Remove(this);
}
this._Sys_User.Entity = value;
if ((value != null))
{
value.WBS_MilePost.Add(this);
this._CompileMan = value.UserId;
}
else
{
this._CompileMan = default(string);
}
this.SendPropertyChanged("Sys_User");
}
}
}
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_WBS_MilePost_WBS_CnProfessionInit", Storage="_WBS_CnProfessionInit", ThisKey="CnProfessionId", OtherKey="CnProfessionId", IsForeignKey=true)]
public WBS_CnProfessionInit WBS_CnProfessionInit
{
get
{
return this._WBS_CnProfessionInit.Entity;
}
set
{
WBS_CnProfessionInit previousValue = this._WBS_CnProfessionInit.Entity;
if (((previousValue != value)
|| (this._WBS_CnProfessionInit.HasLoadedOrAssignedValue == false)))
{
this.SendPropertyChanging();
if ((previousValue != null))
{
this._WBS_CnProfessionInit.Entity = null;
previousValue.WBS_MilePost.Remove(this);
}
this._WBS_CnProfessionInit.Entity = value;
if ((value != null))
{
value.WBS_MilePost.Add(this);
this._CnProfessionId = value.CnProfessionId;
}
else
{
this._CnProfessionId = default(Nullable<int>);
}
this.SendPropertyChanged("WBS_CnProfessionInit");
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Wbs_UnitProject")]
public partial class Wbs_UnitProject : INotifyPropertyChanging, INotifyPropertyChanged
{