diff --git a/DataBase/版本日志/SGGLDB_V2023-10-17.sql b/DataBase/版本日志/SGGLDB_V2023-10-17.sql index 9f6f55a8..0e2e4c69 100644 --- a/DataBase/版本日志/SGGLDB_V2023-10-17.sql +++ b/DataBase/版本日志/SGGLDB_V2023-10-17.sql @@ -11,4 +11,12 @@ Go INSERT [Sys_Menu] ([MenuId],[MenuName],[Url],[SortIndex],[SuperMenu],[MenuType],[IsOffice],[IsEnd],[IsUsed]) VALUES ( N'D791C4E1-7CF1-4F4E-9457-0CF91ACDB987',N'ĿƽЧͳ',N'PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx',30,N'A9BBF623-83AC-4353-A010-07A5D4CEB7D1',N'Menu_PHTGL',0,1,1) - Go \ No newline at end of file + Go + +alter table dbo.PHTGL_Quantity +add SerialNumber nvarchar(50) +go + +exec sp_addextendedproperty 'MS_Description', N'', 'SCHEMA', 'dbo', 'TABLE', 'PHTGL_Quantity', 'COLUMN', +'SerialNumber' +go \ No newline at end of file diff --git a/DataBase/版本日志/SGGLDB_V2023-10-20.sql b/DataBase/版本日志/SGGLDB_V2023-10-20.sql new file mode 100644 index 00000000..51233de9 --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2023-10-20.sql @@ -0,0 +1,124 @@ + +CREATE TABLE [dbo].[ZHGL_ConstructionLogWorkEfficiencyMonth]( + [ConstructionLogWorkEfficiencyMonthId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [Month] [datetime] NULL, + [ContractTrackId] [varchar](50) NULL, + [PhysicalCompletionQuantity] [decimal](18, 2) NULL, + [MaterialConsumption] [decimal](18, 2) NULL, + [UnitOfMeasurement] [nvarchar](50) NULL, + [Type] [nvarchar](20) NULL, + [TypeId] [nvarchar](50) NULL, + [ConsumeHours] [decimal](18, 2) NULL, + [WorkEfficiency] [decimal](18, 2) NULL, + CONSTRAINT [PK_ZHGL_ConstructionLogWorkEfficiencyMonth] PRIMARY KEY CLUSTERED +( + [ConstructionLogWorkEfficiencyMonthId] 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 + +SET ANSI_PADDING OFF +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogWorkEfficiencyMonth] WITH CHECK ADD CONSTRAINT [FK_ZHGL_ConstructionLogWorkEfficiencyMonth_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogWorkEfficiencyMonth] CHECK CONSTRAINT [FK_ZHGL_ConstructionLogWorkEfficiencyMonth_Base_Project] +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogWorkEfficiencyMonth] WITH CHECK ADD CONSTRAINT [FK_ZHGL_ConstructionLogWorkEfficiencyMonth_PHTGL_ContractTrack] FOREIGN KEY([ContractTrackId]) +REFERENCES [dbo].[PHTGL_ContractTrack] ([Id]) +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogWorkEfficiencyMonth] CHECK CONSTRAINT [FK_ZHGL_ConstructionLogWorkEfficiencyMonth_PHTGL_ContractTrack] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth', @level2type=N'COLUMN',@level2name=N'ConstructionLogWorkEfficiencyMonthId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth', @level2type=N'COLUMN',@level2name=N'ProjectId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'·' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth', @level2type=N'COLUMN',@level2name=N'Month' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͬId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth', @level2type=N'COLUMN',@level2name=N'ContractTrackId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ʵ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth', @level2type=N'COLUMN',@level2name=N'PhysicalCompletionQuantity' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth', @level2type=N'COLUMN',@level2name=N'MaterialConsumption' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth', @level2type=N'COLUMN',@level2name=N'UnitOfMeasurement' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͣ˹/е' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth', @level2type=N'COLUMN',@level2name=N'Type' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth', @level2type=N'COLUMN',@level2name=N'TypeId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ĺ/̨ʱ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth', @level2type=N'COLUMN',@level2name=N'ConsumeHours' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ч' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth', @level2type=N'COLUMN',@level2name=N'WorkEfficiency' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Чͳ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyMonth' +GO + + + +CREATE TABLE [dbo].[ZHGL_ConstructionLogWorkEfficiencyProject]( + [ConstructionLogWorkEfficiencyProjectId] [nvarchar](50) NOT NULL, + [ProjectId] [nvarchar](50) NULL, + [Type] [nvarchar](20) NULL, + [TypeId] [nvarchar](50) NULL, + [UnitOfMeasurement] [nvarchar](50) NULL, + [BaseWorkEfficiency] [decimal](18, 2) NULL, + [AvgWorkEfficiency] [decimal](18, 2) NULL, + CONSTRAINT [PK_ZHGL_ConstructionLogWorkEfficiencyProject] PRIMARY KEY CLUSTERED +( + [ConstructionLogWorkEfficiencyProjectId] 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].[ZHGL_ConstructionLogWorkEfficiencyProject] WITH CHECK ADD CONSTRAINT [FK_ZHGL_ConstructionLogWorkEfficiencyProject_Base_Project] FOREIGN KEY([ProjectId]) +REFERENCES [dbo].[Base_Project] ([ProjectId]) +GO + +ALTER TABLE [dbo].[ZHGL_ConstructionLogWorkEfficiencyProject] CHECK CONSTRAINT [FK_ZHGL_ConstructionLogWorkEfficiencyProject_Base_Project] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyProject', @level2type=N'COLUMN',@level2name=N'ConstructionLogWorkEfficiencyProjectId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyProject', @level2type=N'COLUMN',@level2name=N'ProjectId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ͣ˹/е' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyProject', @level2type=N'COLUMN',@level2name=N'Type' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Id' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyProject', @level2type=N'COLUMN',@level2name=N'TypeId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'λ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyProject', @level2type=N'COLUMN',@level2name=N'UnitOfMeasurement' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ч׼' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyProject', @level2type=N'COLUMN',@level2name=N'BaseWorkEfficiency' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿǰƽЧ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyProject', @level2type=N'COLUMN',@level2name=N'AvgWorkEfficiency' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ĿЧ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'ZHGL_ConstructionLogWorkEfficiencyProject' +GO + + diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index dd14cece..3b5f63e6 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -649,6 +649,8 @@ + + diff --git a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs index cf08d95d..70fca224 100644 --- a/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs +++ b/SGGL/BLL/PHTGL/ContractCompile/PhtglContracttrackService .cs @@ -838,11 +838,19 @@ namespace BLL row[7] = item.Id; if (workEfficiencys.Count() > 0) { - var we = workEfficiencys.FirstOrDefault(x => x.ContractTrackId == item.Id); - if (we != null) + var we = (from x in workEfficiencys + where x.ContractTrackId == item.Id + select new { x.ConstructionLogId, x.ContractTrackId, x.PhysicalCompletionQuantity, x.MaterialConsumption }).Distinct().ToList(); + decimal physicalCompletionQuantity = 0, materialConsumption = 0; + if (we.Count() > 0) { - row[5] = we.PhysicalCompletionQuantity; - row[6] = we.MaterialConsumption; + foreach (var w in we) + { + physicalCompletionQuantity += w.PhysicalCompletionQuantity ?? 0; + materialConsumption += w.MaterialConsumption ?? 0; + } + row[5] = physicalCompletionQuantity; + row[6] = materialConsumption; } for (int i = 0; i < workPostIds.Count; i++) { @@ -860,9 +868,9 @@ namespace BLL if (d > 0) { row[8 + i * 2] = decimal.Round(d, 2); - if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + if (physicalCompletionQuantity > 0) { - row[9 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2); + row[9 + i * 2] = decimal.Round(Convert.ToDecimal(physicalCompletionQuantity / d), 2); } } } @@ -883,9 +891,9 @@ namespace BLL if (d > 0) { row[48 + i * 2] = decimal.Round(d, 2); - if (we.PhysicalCompletionQuantity != null && we.PhysicalCompletionQuantity > 0) + if (physicalCompletionQuantity > 0) { - row[49 + i * 2] = decimal.Round(Convert.ToDecimal(we.PhysicalCompletionQuantity / d), 2); + row[49 + i * 2] = decimal.Round(Convert.ToDecimal(physicalCompletionQuantity / d), 2); } } } diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyMonthService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyMonthService.cs new file mode 100644 index 00000000..86cd9e10 --- /dev/null +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyMonthService.cs @@ -0,0 +1,63 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + public class ConstructionLogWorkEfficiencyMonthService + { + public static Model.SGGLDB db = Funs.DB; + + /// + /// 获取施工日志月工效明细列表 + /// + /// + /// + /// + public static List getListData(string projectId, DateTime month) + { + return (from x in db.ZHGL_ConstructionLogWorkEfficiencyMonth + where x.ProjectId == projectId && x.Month == month + select x).ToList(); + } + + /// + /// 增加施工日志月工效明细 + /// + /// 施工日志月工效明细实体 + public static void AddConstructionLogWorkEfficiencyMonth(Model.ZHGL_ConstructionLogWorkEfficiencyMonth constructionLogWorkEfficiencyMonth) + { + Model.SGGLDB db = Funs.DB; + Model.ZHGL_ConstructionLogWorkEfficiencyMonth newConstructionLogWorkEfficiencyMonth = new Model.ZHGL_ConstructionLogWorkEfficiencyMonth(); + newConstructionLogWorkEfficiencyMonth.ConstructionLogWorkEfficiencyMonthId = constructionLogWorkEfficiencyMonth.ConstructionLogWorkEfficiencyMonthId; + newConstructionLogWorkEfficiencyMonth.ProjectId = constructionLogWorkEfficiencyMonth.ProjectId; + newConstructionLogWorkEfficiencyMonth.Month = constructionLogWorkEfficiencyMonth.Month; + newConstructionLogWorkEfficiencyMonth.ContractTrackId = constructionLogWorkEfficiencyMonth.ContractTrackId; + newConstructionLogWorkEfficiencyMonth.PhysicalCompletionQuantity = constructionLogWorkEfficiencyMonth.PhysicalCompletionQuantity; + newConstructionLogWorkEfficiencyMonth.MaterialConsumption = constructionLogWorkEfficiencyMonth.MaterialConsumption; + newConstructionLogWorkEfficiencyMonth.UnitOfMeasurement = constructionLogWorkEfficiencyMonth.UnitOfMeasurement; + newConstructionLogWorkEfficiencyMonth.Type = constructionLogWorkEfficiencyMonth.Type; + newConstructionLogWorkEfficiencyMonth.TypeId = constructionLogWorkEfficiencyMonth.TypeId; + newConstructionLogWorkEfficiencyMonth.ConsumeHours = constructionLogWorkEfficiencyMonth.ConsumeHours; + newConstructionLogWorkEfficiencyMonth.WorkEfficiency = constructionLogWorkEfficiencyMonth.WorkEfficiency; + + db.ZHGL_ConstructionLogWorkEfficiencyMonth.InsertOnSubmit(newConstructionLogWorkEfficiencyMonth); + db.SubmitChanges(); + } + + /// + /// 根据月报id删除对应的所有施工日志月工效明细 + /// + /// 施工日志月工效明细编号 + public static void DeleteConstructionLogWorkEfficiencyMonthsByConstructionLogId(string projectId, DateTime month) + { + Model.SGGLDB db = Funs.DB; + var q = (from x in db.ZHGL_ConstructionLogWorkEfficiencyMonth where x.ProjectId == projectId && x.Month == month select x).ToList(); + if (q.Count() > 0) + { + db.ZHGL_ConstructionLogWorkEfficiencyMonth.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } + } + } +} diff --git a/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyProjectService.cs b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyProjectService.cs new file mode 100644 index 00000000..28fec743 --- /dev/null +++ b/SGGL/BLL/PZHGL/InformationProject/ConstructionLogWorkEfficiencyProjectService.cs @@ -0,0 +1,59 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + public class ConstructionLogWorkEfficiencyProjectService + { + public static Model.SGGLDB db = Funs.DB; + + /// + /// 获取施工日志项目工效明细列表 + /// + /// + /// + /// + public static List getListData(string projectId, DateTime month) + { + return (from x in db.ZHGL_ConstructionLogWorkEfficiencyProject + where x.ProjectId == projectId + select x).ToList(); + } + + /// + /// 增加施工日志项目工效明细 + /// + /// 施工日志项目工效明细实体 + public static void AddConstructionLogWorkEfficiencyProject(Model.ZHGL_ConstructionLogWorkEfficiencyProject constructionLogWorkEfficiencyProject) + { + Model.SGGLDB db = Funs.DB; + Model.ZHGL_ConstructionLogWorkEfficiencyProject newConstructionLogWorkEfficiencyProject = new Model.ZHGL_ConstructionLogWorkEfficiencyProject(); + newConstructionLogWorkEfficiencyProject.ConstructionLogWorkEfficiencyProjectId = constructionLogWorkEfficiencyProject.ConstructionLogWorkEfficiencyProjectId; + newConstructionLogWorkEfficiencyProject.ProjectId = constructionLogWorkEfficiencyProject.ProjectId; + newConstructionLogWorkEfficiencyProject.Type = constructionLogWorkEfficiencyProject.Type; + newConstructionLogWorkEfficiencyProject.TypeId = constructionLogWorkEfficiencyProject.TypeId; + newConstructionLogWorkEfficiencyProject.UnitOfMeasurement = constructionLogWorkEfficiencyProject.UnitOfMeasurement; + newConstructionLogWorkEfficiencyProject.BaseWorkEfficiency = constructionLogWorkEfficiencyProject.BaseWorkEfficiency; + newConstructionLogWorkEfficiencyProject.AvgWorkEfficiency = constructionLogWorkEfficiencyProject.AvgWorkEfficiency; + + db.ZHGL_ConstructionLogWorkEfficiencyProject.InsertOnSubmit(newConstructionLogWorkEfficiencyProject); + db.SubmitChanges(); + } + + /// + /// 根据月报id删除对应的所有施工日志项目工效明细 + /// + /// 施工日志项目工效明细编号 + public static void DeleteConstructionLogWorkEfficiencyProjectsByConstructionLogId(string projectId) + { + Model.SGGLDB db = Funs.DB; + var q = (from x in db.ZHGL_ConstructionLogWorkEfficiencyProject where x.ProjectId == projectId select x).ToList(); + if (q.Count() > 0) + { + db.ZHGL_ConstructionLogWorkEfficiencyProject.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } + } + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 27ee9d06..08258896 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1336,6 +1336,7 @@ + @@ -12921,6 +12922,13 @@ ProjectConstructionLogWorkEfficiency.aspx + + ProjectConstructionLogWorkEfficiencySum.aspx + ASPXCodeBehind + + + ProjectConstructionLogWorkEfficiencySum.aspx + ReceiveFileManager.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs index 0bce8cac..e63fab34 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogFileCabinet.aspx.cs @@ -147,11 +147,11 @@ namespace FineUIPro.Web.PZHGL.InformationProject DateTime? endTime = startTime.HasValue ? startTime.Value.AddMonths(1) : System.DateTime.Now; this.tvControlItem.Nodes.Clear(); - var persons = from x in Funs.DB.Person_Persons + var persons = (from x in Funs.DB.Person_Persons join y in Funs.DB.ZHGL_ConstructionLog on x.PersonId equals y.CompileMan where y.ProjectId == this.CurrUser.LoginProjectId && y.CompileDate >= startTime && y.CompileDate < endTime - select x; + select x).Distinct().ToList(); foreach (var person in persons) { var logs = from x in Funs.DB.ZHGL_ConstructionLog diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx.cs index 7a340691..dbc75e9a 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ConstructionLogWorkEfficiency.aspx.cs @@ -186,9 +186,6 @@ namespace FineUIPro.Web.PZHGL.InformationProject { string constructionLogId = Request.Params["ConstructionLogId"]; Model.SGGLDB db = Funs.DB; - var oldViewInfos = from x in db.ZHGL_ConstructionLogWorkEfficiency - where x.ConstructionLogId == constructionLogId - select x; BLL.ConstructionLogWorkEfficiencyService.DeleteConstructionLogWorkEfficiencysByConstructionLogId(constructionLogId); List workPostIds = Funs.GetStrListByStr(Request.Params["WorkPostId"], ','); List machineIds = Funs.GetStrListByStr(Request.Params["MachineId"], ','); diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx index 734901a9..398a4c5e 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx @@ -54,27 +54,9 @@ HeaderText="材料消耗量(净量+损耗量)" HeaderTextAlign="Center" TextAlign="Left"> - - - - diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.cs index 86fef980..25fdd6b8 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/DayConstructionLogWorkEfficiency.aspx.cs @@ -149,34 +149,6 @@ namespace FineUIPro.Web.PZHGL.InformationProject DataTable table = BLL.PhtglContractTrackService.GetProjectAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, contractNoList, professionalList, workPostIds, machineIds, this.txtCompileDate.Text.Trim()); Grid1.DataSource = table; Grid1.DataBind(); - for (int i = 0; i < this.Grid1.Rows.Count; i++) - { - if (string.IsNullOrEmpty(this.Grid1.Rows[i].DataKeys[2].ToString())) - { - foreach (GridColumn column in Grid1.Columns) - { - if (column.ColumnIndex != 0 && column.ColumnIndex != 1 && column.ColumnIndex != 2) - { - if (column.ColumnIndex > 5) - { - GroupField gf1 = column as GroupField; - foreach (var column1 in gf1.Columns) - { - GroupField gf2 = column1 as GroupField; - foreach (var column2 in gf2.Columns) - { - this.Grid1.Rows[i].CellCssClasses[column2.ColumnIndex] = "f-grid-cell-uneditable"; - } - } - } - else - { - this.Grid1.Rows[i].CellCssClasses[column.ColumnIndex] = "f-grid-cell-uneditable"; - } - } - } - } - } } protected void txtCompileDate_TextChanged(object sender, EventArgs e) diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx index 0026bdea..1b89d1a1 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx @@ -28,9 +28,15 @@ - + + + + + @@ -54,27 +60,9 @@ HeaderText="材料消耗量(净量+损耗量)" HeaderTextAlign="Center" TextAlign="Left"> - - - - diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.cs index 6ac0fce6..32b09740 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.cs @@ -107,7 +107,6 @@ namespace FineUIPro.Web.PZHGL.InformationProject if (!IsPostBack) { this.txtMonth.Text = string.Format("{0:yyyy-MM}", DateTime.Now); - GetData(); } } #endregion @@ -151,37 +150,15 @@ namespace FineUIPro.Web.PZHGL.InformationProject DataTable table = BLL.PhtglContractTrackService.GetMonthProjectAllTreeDataTable(this.CurrUser.LoginProjectId, string.Empty, contractNoList, professionalList, workPostIds, machineIds, startDate, endDate); Grid1.DataSource = table; Grid1.DataBind(); - for (int i = 0; i < this.Grid1.Rows.Count; i++) - { - if (string.IsNullOrEmpty(this.Grid1.Rows[i].DataKeys[2].ToString())) - { - foreach (GridColumn column in Grid1.Columns) - { - if (column.ColumnIndex != 0 && column.ColumnIndex != 1 && column.ColumnIndex != 2) - { - if (column.ColumnIndex > 5) - { - GroupField gf1 = column as GroupField; - foreach (var column1 in gf1.Columns) - { - GroupField gf2 = column1 as GroupField; - foreach (var column2 in gf2.Columns) - { - this.Grid1.Rows[i].CellCssClasses[column2.ColumnIndex] = "f-grid-cell-uneditable"; - } - } - } - else - { - this.Grid1.Rows[i].CellCssClasses[column.ColumnIndex] = "f-grid-cell-uneditable"; - } - } - } - } - } } - protected void txtMonth_TextChanged(object sender, EventArgs e) + #region 统计按钮事件 + /// + /// 统计 + /// + /// + /// + protected void BtnAnalyse_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.txtMonth.Text.Trim())) { @@ -194,5 +171,81 @@ namespace FineUIPro.Web.PZHGL.InformationProject Alert.ShowInTop("请选择月份!", MessageBoxIcon.Warning); } } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (!string.IsNullOrEmpty(this.txtMonth.Text.Trim())) + { + Model.SGGLDB db = Funs.DB; + DateTime month = Funs.GetNewDateTimeOrNow(this.txtMonth.Text.Trim() + "-01"); + BLL.ConstructionLogWorkEfficiencyMonthService.DeleteConstructionLogWorkEfficiencyMonthsByConstructionLogId(this.CurrUser.LoginProjectId, month); + var workEfficiencys = from x in db.ZHGL_ConstructionLogWorkEfficiency + join y in db.ZHGL_ConstructionLog on x.ConstructionLogId equals y.ConstructionLogId + where y.ProjectId == this.CurrUser.LoginProjectId + select x; + List workPostIds = (from x in workEfficiencys + where x.Type == "Person" + select x.TypeId).Distinct().ToList(); + List machineIds = (from x in workEfficiencys + where x.Type == "Machine" + select x.TypeId).Distinct().ToList(); + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + int a = mergedRow.Value("index"); + if (this.Grid1.Rows[a].DataKeys[2] != null) + { + string physicalCompletionQuantity = values.Value("PhysicalCompletionQuantity"); + string materialConsumption = values.Value("MaterialConsumption"); + string unitOfMeasurement = values.Value("UnitOfMeasurement"); + for (int i = 0; i < workPostIds.Count; i++) + { + Model.ZHGL_ConstructionLogWorkEfficiencyMonth workEfficiency = new Model.ZHGL_ConstructionLogWorkEfficiencyMonth(); + workEfficiency.ConstructionLogWorkEfficiencyMonthId = SQLHelper.GetNewID(); + workEfficiency.ProjectId = this.CurrUser.LoginProjectId; + workEfficiency.Month = month; + workEfficiency.ContractTrackId = this.Grid1.Rows[a].DataKeys[2].ToString(); + workEfficiency.PhysicalCompletionQuantity = Funs.GetNewDecimal(physicalCompletionQuantity); + workEfficiency.MaterialConsumption = Funs.GetNewDecimal(materialConsumption); + workEfficiency.UnitOfMeasurement = unitOfMeasurement; + workEfficiency.Type = "Person"; + workEfficiency.TypeId = workPostIds[i]; + workEfficiency.ConsumeHours = Funs.GetNewDecimal(values.Value("PersonConsumeHours" + i.ToString())); + workEfficiency.WorkEfficiency = Funs.GetNewDecimal(values.Value("PersonWorkEfficiency" + i.ToString())); + BLL.ConstructionLogWorkEfficiencyMonthService.AddConstructionLogWorkEfficiencyMonth(workEfficiency); + } + for (int i = 0; i < machineIds.Count; i++) + { + Model.ZHGL_ConstructionLogWorkEfficiencyMonth workEfficiency = new Model.ZHGL_ConstructionLogWorkEfficiencyMonth(); + workEfficiency.ConstructionLogWorkEfficiencyMonthId = SQLHelper.GetNewID(); + workEfficiency.ProjectId = this.CurrUser.LoginProjectId; + workEfficiency.Month = month; + workEfficiency.ContractTrackId = this.Grid1.Rows[a].DataKeys[2].ToString(); + workEfficiency.PhysicalCompletionQuantity = Funs.GetNewDecimal(physicalCompletionQuantity); + workEfficiency.MaterialConsumption = Funs.GetNewDecimal(materialConsumption); + workEfficiency.UnitOfMeasurement = unitOfMeasurement; + workEfficiency.Type = "Machine"; + workEfficiency.TypeId = machineIds[i]; + workEfficiency.ConsumeHours = Funs.GetNewDecimal(values.Value("MachineConsumeHours" + i.ToString())); + workEfficiency.WorkEfficiency = Funs.GetNewDecimal(values.Value("MachineWorkEfficiency" + i.ToString())); + BLL.ConstructionLogWorkEfficiencyMonthService.AddConstructionLogWorkEfficiencyMonth(workEfficiency); + } + } + } + ShowNotify("保存成功!", MessageBoxIcon.Success); + } + else + { + Alert.ShowInTop("请选择月份!", MessageBoxIcon.Warning); + } + } + #endregion } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.designer.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.designer.cs index 6a7d9127..05cc6ceb 100644 --- a/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/MonthConstructionLogWorkEfficiencySum.aspx.designer.cs @@ -74,5 +74,23 @@ namespace FineUIPro.Web.PZHGL.InformationProject { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox hdId; + + /// + /// BtnAnalyse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnAnalyse; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; } } diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx new file mode 100644 index 00000000..1803be71 --- /dev/null +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx @@ -0,0 +1,74 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectConstructionLogWorkEfficiencySum.aspx.cs" Inherits="FineUIPro.Web.PZHGL.InformationProject.ProjectConstructionLogWorkEfficiencySum" %> + + + + + + 工效录入 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx.cs new file mode 100644 index 00000000..57c25ab7 --- /dev/null +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx.cs @@ -0,0 +1,272 @@ +using BLL; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.PZHGL.InformationProject +{ + public partial class ProjectConstructionLogWorkEfficiencySum : PageBase + { + /// + /// 加载表头 + /// + protected void Page_Init(object sender, EventArgs e) + { + InitGrid(); + } + + #region 表头 + /// + /// 表头 + /// + private void InitGrid() + { + Model.SGGLDB db = Funs.DB; + var contracts = (from x in db.PHTGL_Contract + where x.ProjectId == this.CurrUser.LoginProjectId + orderby x.ContractNum + select x).ToList(); + GroupField gf = new GroupField(); + gf.ColumnID = "GX"; + gf.HeaderText = "工效统计"; + gf.HeaderTextAlign = TextAlign.Center; + for (int i = 0; i < contracts.Count; i++) + { + RenderField rd1 = new RenderField(); + rd1.ColumnID = "Contract" + i.ToString(); + rd1.Width = Unit.Pixel(100); + rd1.DataField = "Contract" + i.ToString(); + rd1.FieldType = FieldType.Double; + rd1.HeaderText = contracts[i].ContractNum; + rd1.HeaderTextAlign = TextAlign.Center; + gf.Columns.Add(rd1); + } + Grid1.Columns.Add(gf); + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + + } + } + #endregion + + private void GetData() + { + Model.SGGLDB db = Funs.DB; + var constructionLogWorkEfficiencyMonths = from x in db.ZHGL_ConstructionLogWorkEfficiencyMonth + join y in db.PHTGL_ContractTrack on x.ContractTrackId equals y.Id + where x.ProjectId == this.CurrUser.LoginProjectId + select new { x.TypeId, x.UnitOfMeasurement, y.ContractId, x.WorkEfficiency }; + var persons = (from x in db.ZHGL_ConstructionLogWorkEfficiencyMonth + join y in db.Base_WorkPost on x.TypeId equals y.WorkPostId + where x.ProjectId == this.CurrUser.LoginProjectId && x.Type == "Person" + select new { y.WorkPostName, x.UnitOfMeasurement, x.TypeId }).Distinct().OrderBy(x => x.WorkPostName).ToList(); + var machines = (from x in db.ZHGL_ConstructionLogWorkEfficiencyMonth + join y in db.Base_SpecialEquipment on x.TypeId equals y.SpecialEquipmentId + where x.ProjectId == this.CurrUser.LoginProjectId && x.Type == "Machine" + select new { y.SpecialEquipmentName, x.UnitOfMeasurement, x.TypeId }).Distinct().OrderBy(x => x.SpecialEquipmentName).ToList(); + var contracts = (from x in db.PHTGL_Contract + where x.ProjectId == this.CurrUser.LoginProjectId + orderby x.ContractNum + select x).ToList(); + DataTable table = new DataTable(); + table.Columns.Add(new DataColumn("Id", typeof(String))); + table.Columns.Add(new DataColumn("Code", typeof(String))); + table.Columns.Add(new DataColumn("Name", typeof(String))); + table.Columns.Add(new DataColumn("UnitOfMeasurement", typeof(String))); + table.Columns.Add(new DataColumn("BaseWorkEfficiency", typeof(String))); + table.Columns.Add(new DataColumn("AvgWorkEfficiency", typeof(String))); + table.Columns.Add(new DataColumn("Type", typeof(String))); + table.Columns.Add(new DataColumn("TypeId", typeof(String))); + table.Columns.Add(new DataColumn("Contract0", typeof(String))); + table.Columns.Add(new DataColumn("Contract1", typeof(String))); + table.Columns.Add(new DataColumn("Contract2", typeof(String))); + table.Columns.Add(new DataColumn("Contract3", typeof(String))); + table.Columns.Add(new DataColumn("Contract4", typeof(String))); + table.Columns.Add(new DataColumn("Contract5", typeof(String))); + table.Columns.Add(new DataColumn("Contract6", typeof(String))); + table.Columns.Add(new DataColumn("Contract7", typeof(String))); + table.Columns.Add(new DataColumn("Contract8", typeof(String))); + table.Columns.Add(new DataColumn("Contract9", typeof(String))); + table.Columns.Add(new DataColumn("Contract10", typeof(String))); + table.Columns.Add(new DataColumn("Contract11", typeof(String))); + table.Columns.Add(new DataColumn("Contract12", typeof(String))); + table.Columns.Add(new DataColumn("Contract13", typeof(String))); + table.Columns.Add(new DataColumn("Contract14", typeof(String))); + table.Columns.Add(new DataColumn("Contract15", typeof(String))); + table.Columns.Add(new DataColumn("Contract16", typeof(String))); + table.Columns.Add(new DataColumn("Contract17", typeof(String))); + table.Columns.Add(new DataColumn("Contract18", typeof(String))); + table.Columns.Add(new DataColumn("Contract19", typeof(String))); + table.Columns.Add(new DataColumn("Contract20", typeof(String))); + table.Columns.Add(new DataColumn("Contract21", typeof(String))); + table.Columns.Add(new DataColumn("Contract22", typeof(String))); + table.Columns.Add(new DataColumn("Contract23", typeof(String))); + table.Columns.Add(new DataColumn("Contract24", typeof(String))); + table.Columns.Add(new DataColumn("Contract25", typeof(String))); + table.Columns.Add(new DataColumn("Contract26", typeof(String))); + table.Columns.Add(new DataColumn("Contract27", typeof(String))); + table.Columns.Add(new DataColumn("Contract28", typeof(String))); + table.Columns.Add(new DataColumn("Contract29", typeof(String))); + table.Columns.Add(new DataColumn("Contract30", typeof(String))); + table.Columns.Add(new DataColumn("Contract31", typeof(String))); + table.Columns.Add(new DataColumn("Contract32", typeof(String))); + table.Columns.Add(new DataColumn("Contract33", typeof(String))); + table.Columns.Add(new DataColumn("Contract34", typeof(String))); + table.Columns.Add(new DataColumn("Contract35", typeof(String))); + table.Columns.Add(new DataColumn("Contract36", typeof(String))); + table.Columns.Add(new DataColumn("Contract37", typeof(String))); + table.Columns.Add(new DataColumn("Contract38", typeof(String))); + table.Columns.Add(new DataColumn("Contract39", typeof(String))); + table.Columns.Add(new DataColumn("Contract40", typeof(String))); + DataRow row; + row = table.NewRow(); + row[0] = SQLHelper.GetNewID(); + row[1] = "一"; + row[2] = "人工"; + table.Rows.Add(row); + int a = 1; + foreach (var person in persons) + { + row = table.NewRow(); + row[0] = SQLHelper.GetNewID(); + row[1] = a; + row[2] = person.WorkPostName; + row[3] = person.UnitOfMeasurement; + + int b = 0; + List list = new List(); + foreach (var contract in contracts) + { + var workEfficiencys = from x in constructionLogWorkEfficiencyMonths + where x.TypeId == person.TypeId && x.UnitOfMeasurement == person.UnitOfMeasurement && x.ContractId == contract.ContractId && x.WorkEfficiency != null + select x; + if (workEfficiencys.Count() > 0) + { + decimal totalWorkEfficiencys = workEfficiencys.Sum(x => x.WorkEfficiency ?? 0); + decimal d = decimal.Round(Convert.ToDecimal(totalWorkEfficiencys / Convert.ToDecimal(workEfficiencys.Count())), 2); + row[8 + b] = d; + list.Add(d); + } + b++; + } + if (list.Count > 0) + { + row[5] = decimal.Round(Convert.ToDecimal(list.Sum() / Convert.ToDecimal(list.Count)), 2); + } + row[6] = "Person"; + row[7] = person.TypeId; + table.Rows.Add(row); + a++; + } + row = table.NewRow(); + row[0] = SQLHelper.GetNewID(); + row[1] = "二"; + row[2] = "机械"; + table.Rows.Add(row); + a = 1; + foreach (var machine in machines) + { + row = table.NewRow(); + row[0] = SQLHelper.GetNewID(); + row[1] = a; + row[2] = machine.SpecialEquipmentName; + row[3] = machine.UnitOfMeasurement; + + int b = 0; + List list = new List(); + foreach (var contract in contracts) + { + var workEfficiencys = from x in constructionLogWorkEfficiencyMonths + where x.TypeId == machine.TypeId && x.UnitOfMeasurement == machine.UnitOfMeasurement && x.ContractId == contract.ContractId && x.WorkEfficiency != null + select x; + if (workEfficiencys.Count() > 0) + { + decimal totalWorkEfficiencys = workEfficiencys.Sum(x => x.WorkEfficiency ?? 0); + decimal d = decimal.Round(Convert.ToDecimal(totalWorkEfficiencys / Convert.ToDecimal(workEfficiencys.Count())), 2); + row[8 + b] = d; + list.Add(d); + } + b++; + } + if (list.Count > 0) + { + row[5] = decimal.Round(Convert.ToDecimal(list.Sum() / Convert.ToDecimal(list.Count)), 2); + } + row[6] = "Machine"; + row[7] = machine.TypeId; + table.Rows.Add(row); + a++; + } + Grid1.DataSource = table; + Grid1.DataBind(); + } + + #region 统计按钮事件 + /// + /// 统计 + /// + /// + /// + protected void BtnAnalyse_Click(object sender, EventArgs e) + { + GetData(); + } + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (this.Grid1.Rows.Count > 0) + { + BLL.ConstructionLogWorkEfficiencyProjectService.DeleteConstructionLogWorkEfficiencyProjectsByConstructionLogId(this.CurrUser.LoginProjectId); + foreach (JObject mergedRow in Grid1.GetMergedData()) + { + JObject values = mergedRow.Value("values"); + int a = mergedRow.Value("index"); + string type = values.Value("Type"); + if (!string.IsNullOrEmpty(type)) + { + string unitOfMeasurement = values.Value("UnitOfMeasurement"); + string baseWorkEfficiency = values.Value("BaseWorkEfficiency"); + string avgWorkEfficiency = values.Value("AvgWorkEfficiency"); + string typeId = values.Value("TypeId"); + Model.ZHGL_ConstructionLogWorkEfficiencyProject workEfficiency = new Model.ZHGL_ConstructionLogWorkEfficiencyProject(); + workEfficiency.ConstructionLogWorkEfficiencyProjectId = SQLHelper.GetNewID(); + workEfficiency.ProjectId = this.CurrUser.LoginProjectId; + workEfficiency.Type = type; + workEfficiency.TypeId = typeId; + workEfficiency.UnitOfMeasurement = unitOfMeasurement; + workEfficiency.BaseWorkEfficiency = Funs.GetNewDecimal(baseWorkEfficiency); + workEfficiency.AvgWorkEfficiency = Funs.GetNewDecimal(avgWorkEfficiency); + BLL.ConstructionLogWorkEfficiencyProjectService.AddConstructionLogWorkEfficiencyProject(workEfficiency); + } + } + ShowNotify("保存成功!", MessageBoxIcon.Success); + } + else + { + Alert.ShowInTop("请先统计后再保存!", MessageBoxIcon.Warning); + } + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx.designer.cs b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx.designer.cs new file mode 100644 index 00000000..10c8de27 --- /dev/null +++ b/SGGL/FineUIPro.Web/PZHGL/InformationProject/ProjectConstructionLogWorkEfficiencySum.aspx.designer.cs @@ -0,0 +1,87 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.PZHGL.InformationProject { + + + public partial class ProjectConstructionLogWorkEfficiencySum { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// BtnAnalyse 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button BtnAnalyse; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// nbBaseWorkEfficiency 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox nbBaseWorkEfficiency; + } +} diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index d2e9000f..5afc0887 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -1733,6 +1733,12 @@ namespace Model partial void InsertZHGL_ConstructionLogWorkEfficiency(ZHGL_ConstructionLogWorkEfficiency instance); partial void UpdateZHGL_ConstructionLogWorkEfficiency(ZHGL_ConstructionLogWorkEfficiency instance); partial void DeleteZHGL_ConstructionLogWorkEfficiency(ZHGL_ConstructionLogWorkEfficiency instance); + partial void InsertZHGL_ConstructionLogWorkEfficiencyMonth(ZHGL_ConstructionLogWorkEfficiencyMonth instance); + partial void UpdateZHGL_ConstructionLogWorkEfficiencyMonth(ZHGL_ConstructionLogWorkEfficiencyMonth instance); + partial void DeleteZHGL_ConstructionLogWorkEfficiencyMonth(ZHGL_ConstructionLogWorkEfficiencyMonth instance); + partial void InsertZHGL_ConstructionLogWorkEfficiencyProject(ZHGL_ConstructionLogWorkEfficiencyProject instance); + partial void UpdateZHGL_ConstructionLogWorkEfficiencyProject(ZHGL_ConstructionLogWorkEfficiencyProject instance); + partial void DeleteZHGL_ConstructionLogWorkEfficiencyProject(ZHGL_ConstructionLogWorkEfficiencyProject instance); partial void InsertZHGL_ConstructionMonthReport(ZHGL_ConstructionMonthReport instance); partial void UpdateZHGL_ConstructionMonthReport(ZHGL_ConstructionMonthReport instance); partial void DeleteZHGL_ConstructionMonthReport(ZHGL_ConstructionMonthReport instance); @@ -7112,6 +7118,22 @@ namespace Model } } + public System.Data.Linq.Table ZHGL_ConstructionLogWorkEfficiencyMonth + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table ZHGL_ConstructionLogWorkEfficiencyProject + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table ZHGL_ConstructionMonthReport { get @@ -11730,7 +11752,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ApproveIdea", DbType="NVarChar(200)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ApproveIdea", DbType="NVarChar(2000)")] public string ApproveIdea { get @@ -24117,6 +24139,10 @@ namespace Model private EntitySet _ZHGL_ConstructionLog; + private EntitySet _ZHGL_ConstructionLogWorkEfficiencyMonth; + + private EntitySet _ZHGL_ConstructionLogWorkEfficiencyProject; + private EntitySet _ZHGL_ConstructionMonthReport; private EntitySet _ZHGL_ConstructionPlan; @@ -24362,6 +24388,8 @@ namespace Model this._WPQ_WPQList = new EntitySet(new Action(this.attach_WPQ_WPQList), new Action(this.detach_WPQ_WPQList)); this._Wx_PageData = new EntitySet(new Action(this.attach_Wx_PageData), new Action(this.detach_Wx_PageData)); this._ZHGL_ConstructionLog = new EntitySet(new Action(this.attach_ZHGL_ConstructionLog), new Action(this.detach_ZHGL_ConstructionLog)); + this._ZHGL_ConstructionLogWorkEfficiencyMonth = new EntitySet(new Action(this.attach_ZHGL_ConstructionLogWorkEfficiencyMonth), new Action(this.detach_ZHGL_ConstructionLogWorkEfficiencyMonth)); + this._ZHGL_ConstructionLogWorkEfficiencyProject = new EntitySet(new Action(this.attach_ZHGL_ConstructionLogWorkEfficiencyProject), new Action(this.detach_ZHGL_ConstructionLogWorkEfficiencyProject)); this._ZHGL_ConstructionMonthReport = new EntitySet(new Action(this.attach_ZHGL_ConstructionMonthReport), new Action(this.detach_ZHGL_ConstructionMonthReport)); this._ZHGL_ConstructionPlan = new EntitySet(new Action(this.attach_ZHGL_ConstructionPlan), new Action(this.detach_ZHGL_ConstructionPlan)); this._ZHGL_ConstructionReport = new EntitySet(new Action(this.attach_ZHGL_ConstructionReport), new Action(this.detach_ZHGL_ConstructionReport)); @@ -27203,6 +27231,32 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ZHGL_ConstructionLogWorkEfficiencyMonth_Base_Project", Storage="_ZHGL_ConstructionLogWorkEfficiencyMonth", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] + public EntitySet ZHGL_ConstructionLogWorkEfficiencyMonth + { + get + { + return this._ZHGL_ConstructionLogWorkEfficiencyMonth; + } + set + { + this._ZHGL_ConstructionLogWorkEfficiencyMonth.Assign(value); + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ZHGL_ConstructionLogWorkEfficiencyProject_Base_Project", Storage="_ZHGL_ConstructionLogWorkEfficiencyProject", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] + public EntitySet ZHGL_ConstructionLogWorkEfficiencyProject + { + get + { + return this._ZHGL_ConstructionLogWorkEfficiencyProject; + } + set + { + this._ZHGL_ConstructionLogWorkEfficiencyProject.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ZHGL_ConstructionMonthReport_Base_Project", Storage="_ZHGL_ConstructionMonthReport", ThisKey="ProjectId", OtherKey="ProjectId", DeleteRule="NO ACTION")] public EntitySet ZHGL_ConstructionMonthReport { @@ -29316,6 +29370,30 @@ namespace Model entity.Base_Project = null; } + private void attach_ZHGL_ConstructionLogWorkEfficiencyMonth(ZHGL_ConstructionLogWorkEfficiencyMonth entity) + { + this.SendPropertyChanging(); + entity.Base_Project = this; + } + + private void detach_ZHGL_ConstructionLogWorkEfficiencyMonth(ZHGL_ConstructionLogWorkEfficiencyMonth entity) + { + this.SendPropertyChanging(); + entity.Base_Project = null; + } + + private void attach_ZHGL_ConstructionLogWorkEfficiencyProject(ZHGL_ConstructionLogWorkEfficiencyProject entity) + { + this.SendPropertyChanging(); + entity.Base_Project = this; + } + + private void detach_ZHGL_ConstructionLogWorkEfficiencyProject(ZHGL_ConstructionLogWorkEfficiencyProject entity) + { + this.SendPropertyChanging(); + entity.Base_Project = null; + } + private void attach_ZHGL_ConstructionMonthReport(ZHGL_ConstructionMonthReport entity) { this.SendPropertyChanging(); @@ -151181,7 +151259,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttentPerson", DbType="NVarChar(500)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AttentPerson", DbType="NVarChar(3000)")] public string AttentPerson { get @@ -181863,6 +181941,8 @@ namespace Model private EntitySet _ZHGL_ConstructionLogWorkEfficiency; + private EntitySet _ZHGL_ConstructionLogWorkEfficiencyMonth; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -181930,6 +182010,7 @@ namespace Model public PHTGL_ContractTrack() { this._ZHGL_ConstructionLogWorkEfficiency = new EntitySet(new Action(this.attach_ZHGL_ConstructionLogWorkEfficiency), new Action(this.detach_ZHGL_ConstructionLogWorkEfficiency)); + this._ZHGL_ConstructionLogWorkEfficiencyMonth = new EntitySet(new Action(this.attach_ZHGL_ConstructionLogWorkEfficiencyMonth), new Action(this.detach_ZHGL_ConstructionLogWorkEfficiencyMonth)); OnCreated(); } @@ -182526,6 +182607,19 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ZHGL_ConstructionLogWorkEfficiencyMonth_PHTGL_ContractTrack", Storage="_ZHGL_ConstructionLogWorkEfficiencyMonth", ThisKey="Id", OtherKey="ContractTrackId", DeleteRule="NO ACTION")] + public EntitySet ZHGL_ConstructionLogWorkEfficiencyMonth + { + get + { + return this._ZHGL_ConstructionLogWorkEfficiencyMonth; + } + set + { + this._ZHGL_ConstructionLogWorkEfficiencyMonth.Assign(value); + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -182557,6 +182651,18 @@ namespace Model this.SendPropertyChanging(); entity.PHTGL_ContractTrack = null; } + + private void attach_ZHGL_ConstructionLogWorkEfficiencyMonth(ZHGL_ConstructionLogWorkEfficiencyMonth entity) + { + this.SendPropertyChanging(); + entity.PHTGL_ContractTrack = this; + } + + private void detach_ZHGL_ConstructionLogWorkEfficiencyMonth(ZHGL_ConstructionLogWorkEfficiencyMonth entity) + { + this.SendPropertyChanging(); + entity.PHTGL_ContractTrack = null; + } } [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.PHTGL_ContractTrackMatchWBS")] @@ -182652,7 +182758,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageEstimate", DbType="Decimal(18,2)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackageEstimate", DbType="Decimal(18,3)")] public System.Nullable WorkPackageEstimate { get @@ -292410,7 +292516,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(81)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Name", DbType="NVarChar(50)")] public string Name { get @@ -305618,6 +305724,637 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.ZHGL_ConstructionLogWorkEfficiencyMonth")] + public partial class ZHGL_ConstructionLogWorkEfficiencyMonth : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ConstructionLogWorkEfficiencyMonthId; + + private string _ProjectId; + + private System.Nullable _Month; + + private string _ContractTrackId; + + private System.Nullable _PhysicalCompletionQuantity; + + private System.Nullable _MaterialConsumption; + + private string _UnitOfMeasurement; + + private string _Type; + + private string _TypeId; + + private System.Nullable _ConsumeHours; + + private System.Nullable _WorkEfficiency; + + private EntityRef _Base_Project; + + private EntityRef _PHTGL_ContractTrack; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnConstructionLogWorkEfficiencyMonthIdChanging(string value); + partial void OnConstructionLogWorkEfficiencyMonthIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnMonthChanging(System.Nullable value); + partial void OnMonthChanged(); + partial void OnContractTrackIdChanging(string value); + partial void OnContractTrackIdChanged(); + partial void OnPhysicalCompletionQuantityChanging(System.Nullable value); + partial void OnPhysicalCompletionQuantityChanged(); + partial void OnMaterialConsumptionChanging(System.Nullable value); + partial void OnMaterialConsumptionChanged(); + partial void OnUnitOfMeasurementChanging(string value); + partial void OnUnitOfMeasurementChanged(); + partial void OnTypeChanging(string value); + partial void OnTypeChanged(); + partial void OnTypeIdChanging(string value); + partial void OnTypeIdChanged(); + partial void OnConsumeHoursChanging(System.Nullable value); + partial void OnConsumeHoursChanged(); + partial void OnWorkEfficiencyChanging(System.Nullable value); + partial void OnWorkEfficiencyChanged(); + #endregion + + public ZHGL_ConstructionLogWorkEfficiencyMonth() + { + this._Base_Project = default(EntityRef); + this._PHTGL_ContractTrack = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionLogWorkEfficiencyMonthId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ConstructionLogWorkEfficiencyMonthId + { + get + { + return this._ConstructionLogWorkEfficiencyMonthId; + } + set + { + if ((this._ConstructionLogWorkEfficiencyMonthId != value)) + { + this.OnConstructionLogWorkEfficiencyMonthIdChanging(value); + this.SendPropertyChanging(); + this._ConstructionLogWorkEfficiencyMonthId = value; + this.SendPropertyChanged("ConstructionLogWorkEfficiencyMonthId"); + this.OnConstructionLogWorkEfficiencyMonthIdChanged(); + } + } + } + + [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="_Month", DbType="DateTime")] + public System.Nullable Month + { + get + { + return this._Month; + } + set + { + if ((this._Month != value)) + { + this.OnMonthChanging(value); + this.SendPropertyChanging(); + this._Month = value; + this.SendPropertyChanged("Month"); + this.OnMonthChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractTrackId", DbType="VarChar(50)")] + public string ContractTrackId + { + get + { + return this._ContractTrackId; + } + set + { + if ((this._ContractTrackId != value)) + { + if (this._PHTGL_ContractTrack.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnContractTrackIdChanging(value); + this.SendPropertyChanging(); + this._ContractTrackId = value; + this.SendPropertyChanged("ContractTrackId"); + this.OnContractTrackIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PhysicalCompletionQuantity", DbType="Decimal(18,2)")] + public System.Nullable PhysicalCompletionQuantity + { + get + { + return this._PhysicalCompletionQuantity; + } + set + { + if ((this._PhysicalCompletionQuantity != value)) + { + this.OnPhysicalCompletionQuantityChanging(value); + this.SendPropertyChanging(); + this._PhysicalCompletionQuantity = value; + this.SendPropertyChanged("PhysicalCompletionQuantity"); + this.OnPhysicalCompletionQuantityChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialConsumption", DbType="Decimal(18,2)")] + public System.Nullable MaterialConsumption + { + get + { + return this._MaterialConsumption; + } + set + { + if ((this._MaterialConsumption != value)) + { + this.OnMaterialConsumptionChanging(value); + this.SendPropertyChanging(); + this._MaterialConsumption = value; + this.SendPropertyChanged("MaterialConsumption"); + this.OnMaterialConsumptionChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitOfMeasurement", DbType="NVarChar(50)")] + public string UnitOfMeasurement + { + get + { + return this._UnitOfMeasurement; + } + set + { + if ((this._UnitOfMeasurement != value)) + { + this.OnUnitOfMeasurementChanging(value); + this.SendPropertyChanging(); + this._UnitOfMeasurement = value; + this.SendPropertyChanged("UnitOfMeasurement"); + this.OnUnitOfMeasurementChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Type", DbType="NVarChar(20)")] + public string Type + { + get + { + return this._Type; + } + set + { + if ((this._Type != value)) + { + this.OnTypeChanging(value); + this.SendPropertyChanging(); + this._Type = value; + this.SendPropertyChanged("Type"); + this.OnTypeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TypeId", DbType="NVarChar(50)")] + public string TypeId + { + get + { + return this._TypeId; + } + set + { + if ((this._TypeId != value)) + { + this.OnTypeIdChanging(value); + this.SendPropertyChanging(); + this._TypeId = value; + this.SendPropertyChanged("TypeId"); + this.OnTypeIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConsumeHours", DbType="Decimal(18,2)")] + public System.Nullable ConsumeHours + { + get + { + return this._ConsumeHours; + } + set + { + if ((this._ConsumeHours != value)) + { + this.OnConsumeHoursChanging(value); + this.SendPropertyChanging(); + this._ConsumeHours = value; + this.SendPropertyChanged("ConsumeHours"); + this.OnConsumeHoursChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkEfficiency", DbType="Decimal(18,2)")] + public System.Nullable WorkEfficiency + { + get + { + return this._WorkEfficiency; + } + set + { + if ((this._WorkEfficiency != value)) + { + this.OnWorkEfficiencyChanging(value); + this.SendPropertyChanging(); + this._WorkEfficiency = value; + this.SendPropertyChanged("WorkEfficiency"); + this.OnWorkEfficiencyChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ZHGL_ConstructionLogWorkEfficiencyMonth_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.ZHGL_ConstructionLogWorkEfficiencyMonth.Remove(this); + } + this._Base_Project.Entity = value; + if ((value != null)) + { + value.ZHGL_ConstructionLogWorkEfficiencyMonth.Add(this); + this._ProjectId = value.ProjectId; + } + else + { + this._ProjectId = default(string); + } + this.SendPropertyChanged("Base_Project"); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ZHGL_ConstructionLogWorkEfficiencyMonth_PHTGL_ContractTrack", Storage="_PHTGL_ContractTrack", ThisKey="ContractTrackId", OtherKey="Id", IsForeignKey=true)] + public PHTGL_ContractTrack PHTGL_ContractTrack + { + get + { + return this._PHTGL_ContractTrack.Entity; + } + set + { + PHTGL_ContractTrack previousValue = this._PHTGL_ContractTrack.Entity; + if (((previousValue != value) + || (this._PHTGL_ContractTrack.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._PHTGL_ContractTrack.Entity = null; + previousValue.ZHGL_ConstructionLogWorkEfficiencyMonth.Remove(this); + } + this._PHTGL_ContractTrack.Entity = value; + if ((value != null)) + { + value.ZHGL_ConstructionLogWorkEfficiencyMonth.Add(this); + this._ContractTrackId = value.Id; + } + else + { + this._ContractTrackId = default(string); + } + this.SendPropertyChanged("PHTGL_ContractTrack"); + } + } + } + + 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.ZHGL_ConstructionLogWorkEfficiencyProject")] + public partial class ZHGL_ConstructionLogWorkEfficiencyProject : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ConstructionLogWorkEfficiencyProjectId; + + private string _ProjectId; + + private string _Type; + + private string _TypeId; + + private string _UnitOfMeasurement; + + private System.Nullable _BaseWorkEfficiency; + + private System.Nullable _AvgWorkEfficiency; + + private EntityRef _Base_Project; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnConstructionLogWorkEfficiencyProjectIdChanging(string value); + partial void OnConstructionLogWorkEfficiencyProjectIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnTypeChanging(string value); + partial void OnTypeChanged(); + partial void OnTypeIdChanging(string value); + partial void OnTypeIdChanged(); + partial void OnUnitOfMeasurementChanging(string value); + partial void OnUnitOfMeasurementChanged(); + partial void OnBaseWorkEfficiencyChanging(System.Nullable value); + partial void OnBaseWorkEfficiencyChanged(); + partial void OnAvgWorkEfficiencyChanging(System.Nullable value); + partial void OnAvgWorkEfficiencyChanged(); + #endregion + + public ZHGL_ConstructionLogWorkEfficiencyProject() + { + this._Base_Project = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ConstructionLogWorkEfficiencyProjectId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ConstructionLogWorkEfficiencyProjectId + { + get + { + return this._ConstructionLogWorkEfficiencyProjectId; + } + set + { + if ((this._ConstructionLogWorkEfficiencyProjectId != value)) + { + this.OnConstructionLogWorkEfficiencyProjectIdChanging(value); + this.SendPropertyChanging(); + this._ConstructionLogWorkEfficiencyProjectId = value; + this.SendPropertyChanged("ConstructionLogWorkEfficiencyProjectId"); + this.OnConstructionLogWorkEfficiencyProjectIdChanged(); + } + } + } + + [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="_Type", DbType="NVarChar(20)")] + public string Type + { + get + { + return this._Type; + } + set + { + if ((this._Type != value)) + { + this.OnTypeChanging(value); + this.SendPropertyChanging(); + this._Type = value; + this.SendPropertyChanged("Type"); + this.OnTypeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TypeId", DbType="NVarChar(50)")] + public string TypeId + { + get + { + return this._TypeId; + } + set + { + if ((this._TypeId != value)) + { + this.OnTypeIdChanging(value); + this.SendPropertyChanging(); + this._TypeId = value; + this.SendPropertyChanged("TypeId"); + this.OnTypeIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitOfMeasurement", DbType="NVarChar(50)")] + public string UnitOfMeasurement + { + get + { + return this._UnitOfMeasurement; + } + set + { + if ((this._UnitOfMeasurement != value)) + { + this.OnUnitOfMeasurementChanging(value); + this.SendPropertyChanging(); + this._UnitOfMeasurement = value; + this.SendPropertyChanged("UnitOfMeasurement"); + this.OnUnitOfMeasurementChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_BaseWorkEfficiency", DbType="Decimal(18,2)")] + public System.Nullable BaseWorkEfficiency + { + get + { + return this._BaseWorkEfficiency; + } + set + { + if ((this._BaseWorkEfficiency != value)) + { + this.OnBaseWorkEfficiencyChanging(value); + this.SendPropertyChanging(); + this._BaseWorkEfficiency = value; + this.SendPropertyChanged("BaseWorkEfficiency"); + this.OnBaseWorkEfficiencyChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AvgWorkEfficiency", DbType="Decimal(18,2)")] + public System.Nullable AvgWorkEfficiency + { + get + { + return this._AvgWorkEfficiency; + } + set + { + if ((this._AvgWorkEfficiency != value)) + { + this.OnAvgWorkEfficiencyChanging(value); + this.SendPropertyChanging(); + this._AvgWorkEfficiency = value; + this.SendPropertyChanged("AvgWorkEfficiency"); + this.OnAvgWorkEfficiencyChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_ZHGL_ConstructionLogWorkEfficiencyProject_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.ZHGL_ConstructionLogWorkEfficiencyProject.Remove(this); + } + this._Base_Project.Entity = value; + if ((value != null)) + { + value.ZHGL_ConstructionLogWorkEfficiencyProject.Add(this); + this._ProjectId = value.ProjectId; + } + else + { + this._ProjectId = default(string); + } + this.SendPropertyChanged("Base_Project"); + } + } + } + + 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.ZHGL_ConstructionMonthReport")] public partial class ZHGL_ConstructionMonthReport : INotifyPropertyChanging, INotifyPropertyChanged {