From 5763ff9468a2d1329484a7954788622fa2f23eef Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Tue, 3 Nov 2026 15:09:22 +0800 Subject: [PATCH] =?UTF-8?q?20261103=20HSE=E6=9C=88=E6=8A=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CreateModel.bat | 2 +- DataBase/版本日志/SGGLDB_V2026-11-03-bwj.sql | 115 +++ SGGL/BLL/BLL.csproj | 1 + SGGL/BLL/Common/Const.cs | 5 + .../SafeEnvBudget/HSEMonthReportService.cs | 114 +++ SGGL/FineUIPro.Web/FineUIPro.Web.csproj | 18 +- .../SafeEnvBudget/HSEMonthReport.aspx | 127 +++ .../SafeEnvBudget/HSEMonthReport.aspx.cs | 387 ++++++++++ .../HSEMonthReport.aspx.designer.cs | 179 +++++ .../SafeEnvBudget/HSEMonthReportEdit.aspx | 128 +++ .../SafeEnvBudget/HSEMonthReportEdit.aspx.cs | 145 ++++ .../HSEMonthReportEdit.aspx.designer.cs | 296 +++++++ SGGL/FineUIPro.Web/common/main.aspx | 19 +- SGGL/FineUIPro.Web/common/main.aspx.cs | 23 + SGGL/Model/Model.cs | 727 +++++++++++++++++- 15 files changed, 2252 insertions(+), 34 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2026-11-03-bwj.sql create mode 100644 SGGL/BLL/ReportManage/SafeEnvBudget/HSEMonthReportService.cs create mode 100644 SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx create mode 100644 SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx.cs create mode 100644 SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx create mode 100644 SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx.designer.cs diff --git a/CreateModel.bat b/CreateModel.bat index cee3c9c2..59e2315e 100644 --- a/CreateModel.bat +++ b/CreateModel.bat @@ -27,7 +27,7 @@ REM -------------- @echo. @call "%VS100COMNTOOLS%"vsvars32.bat -SqlMetal /views /server:.\SQL2012 /database:CNPC_XJYJ /code:%Model_ROOT%\Model.cs /namespace:Model +SqlMetal /views /server:.\SQL2022 /database:CNPC_XJYJ /code:%Model_ROOT%\Model.cs /namespace:Model @ECHO Íê³É pause diff --git a/DataBase/版本日志/SGGLDB_V2026-11-03-bwj.sql b/DataBase/版本日志/SGGLDB_V2026-11-03-bwj.sql new file mode 100644 index 00000000..31e32b7a --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-11-03-bwj.sql @@ -0,0 +1,115 @@ +insert into Sys_Menu(MenuId,MenuName,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed) +values('2CACC0DE-5EA9-48B2-ADB2-03E79D8D1C13','HSEÔ±¨','ReportManage/SafeEnvBudget/HSEMonthReport.aspx',25,'224F8F8B-C5E7-4763-AEE1-1C54909F0C1A','Menu_S_Report',1,1,1) +go +insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('86A0532C-852D-4D1D-93F3-78783D10418D','2CACC0DE-5EA9-48B2-ADB2-03E79D8D1C13','Ôö¼Ó',1) +insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('38D25510-4527-4066-A6EC-A9F10B82DAC5','2CACC0DE-5EA9-48B2-ADB2-03E79D8D1C13','Ð޸Ä',2) +insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('A0EC16ED-B584-438A-BDD9-A23327DE1A38','2CACC0DE-5EA9-48B2-ADB2-03E79D8D1C13','ɾ³ý',3) +insert into Sys_ButtonToMenu(ButtonToMenuId,MenuId,ButtonName,SortIndex) +values('95EA9BA7-220F-4408-B4E0-6C232B38FA4A','2CACC0DE-5EA9-48B2-ADB2-03E79D8D1C13','±£´æ',4) +go + +CREATE TABLE [dbo].[Report_HSEMonthReport]( + [ReportId] [nvarchar](50) NOT NULL, + [UnitId] [nvarchar](50) NOT NULL, + [ReportDate] [datetime] NOT NULL, + [TotalEmployees] [int] NULL, + [TotalHours] [decimal](18, 2) NULL, + [ContractorEmployees] [int] NULL, + [ContractorHours] [decimal](18, 2) NULL, + [MonthHours] [numeric](18, 2) NULL, + [MonthHoursAvg] [numeric](18, 2) NULL, + [YearHours] [decimal](18, 2) NULL, + [Remark] [nvarchar](500) NULL, + [BranchTraining] [int] NULL, + [ProjectTraining] [int] NULL, + [TeamGroupTraining] [int] NULL, + [SelfTraining] [int] NULL, + [ContractorOrganizeTraining] [int] NULL, + [ContractorTraining] [int] NULL, + [CompileMan] [nvarchar](50) NULL, + [CompileDate] [datetime] NULL, + CONSTRAINT [PK_Report_HSEMonthReport] PRIMARY KEY CLUSTERED +( + [ReportId] ASC +)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY] +) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[Report_HSEMonthReport] WITH CHECK ADD CONSTRAINT [FK_Report_HSEMonthReport_Base_Unit] FOREIGN KEY([UnitId]) +REFERENCES [dbo].[Base_Unit] ([UnitId]) +GO + +ALTER TABLE [dbo].[Report_HSEMonthReport] CHECK CONSTRAINT [FK_Report_HSEMonthReport_Base_Unit] +GO + +ALTER TABLE [dbo].[Report_HSEMonthReport] WITH CHECK ADD CONSTRAINT [FK_Report_HSEMonthReport_Sys_User] FOREIGN KEY([CompileMan]) +REFERENCES [dbo].[Sys_User] ([UserId]) +GO + +ALTER TABLE [dbo].[Report_HSEMonthReport] CHECK CONSTRAINT [FK_Report_HSEMonthReport_Sys_User] +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ö÷¼ü' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'ReportId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'µ¥λId' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'UnitId' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'Ô±¨ÈÕÆÚ' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'ReportDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'±¾µ¥λԱ¹¤×ÜÊý' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'TotalEmployees' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'±¾µ¥λԱ¹¤¹¤ʱ×ÜÊý' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'TotalHours' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'³аüÉÌԱ¹¤×ÜÊý' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'ContractorEmployees' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'³аüÉÌԱ¹¤¹¤ʱ×ÜÊý' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'ContractorHours' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'±¾µ¥λ±¾Ô¹¤ʱ×ÜÊý' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'MonthHours' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'±¾ÔÂÈ˾ù¹¤ʱÊý' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'MonthHoursAvg' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'±¾µ¥λÄê¶ȹ¤ʱ×ÜÊý' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'YearHours' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'±¸ע' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @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'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'BranchTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'ÏîĿ²¿¼¶Åàѵ´ÎÊý' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'ProjectTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'°à×鼶Åàѵ´ÎÊý' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'TeamGroupTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'×ÔÐÐÅàѵÈ˴Î' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'SelfTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'³аüÉÌ×é֯Åàѵ´ÎÊý' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'ContractorOrganizeTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'³аüÉÌÅàѵÈ˴Î' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'ContractorTraining' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'±àÖÆÈË' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport', @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'Report_HSEMonthReport', @level2type=N'COLUMN',@level2name=N'CompileDate' +GO + +EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'HSEÔ±¨' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Report_HSEMonthReport' +GO + + diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index 475c7840..d4a608e8 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -863,6 +863,7 @@ + diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 1bb09b5d..73a389e4 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3543,6 +3543,11 @@ namespace BLL /// public const string SafetyManagementDataTotalMenuId = "B2E6FF41-8379-4603-9560-E2DD84080058"; + /// + /// HSE月报 + /// + public const string HSEMonthReportMenuId = "2CACC0DE-5EA9-48B2-ADB2-03E79D8D1C13"; + /// /// 安全危害因素清单 /// diff --git a/SGGL/BLL/ReportManage/SafeEnvBudget/HSEMonthReportService.cs b/SGGL/BLL/ReportManage/SafeEnvBudget/HSEMonthReportService.cs new file mode 100644 index 00000000..1048d759 --- /dev/null +++ b/SGGL/BLL/ReportManage/SafeEnvBudget/HSEMonthReportService.cs @@ -0,0 +1,114 @@ +using FastReport; +using Model; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + /// + /// HSE月报 + /// + public class HSEMonthReportService + { + /// + /// 根据主键获取HSE月报 + /// + /// + /// + public static Model.Report_HSEMonthReport GetHSEMonthReportById(string reportId) + { + return Funs.DB.Report_HSEMonthReport.FirstOrDefault(e => e.ReportId == reportId); + } + + /// + /// 添加HSE月报 + /// + /// + public static void AddHSEMonthReport(Model.Report_HSEMonthReport report) + { + CNPCDB db = Funs.DB; + Model.Report_HSEMonthReport newReport = new Report_HSEMonthReport(); + newReport.ReportId = report.ReportId; + newReport.UnitId = report.UnitId; + newReport.ReportDate = report.ReportDate; + newReport.TotalEmployees = report.TotalEmployees; + newReport.TotalHours = report.TotalHours; + newReport.ContractorEmployees = report.ContractorEmployees; + newReport.ContractorHours = report.ContractorHours; + newReport.MonthHours = report.MonthHours; + newReport.MonthHoursAvg = report.MonthHoursAvg; + newReport.YearHours = report.YearHours; + newReport.Remark = report.Remark; + newReport.BranchTraining = report.BranchTraining; + newReport.ProjectTraining = report.ProjectTraining; + newReport.TeamGroupTraining = report.TeamGroupTraining; + newReport.SelfTraining = report.SelfTraining; + newReport.ContractorOrganizeTraining = report.ContractorOrganizeTraining; + newReport.ContractorTraining = report.ContractorTraining; + newReport.CompileMan = report.CompileMan; + newReport.CompileDate = report.CompileDate; + db.Report_HSEMonthReport.InsertOnSubmit(newReport); + db.SubmitChanges(); + } + + /// + /// 修改HSE月报 + /// + /// + public static void UpdateHSEMonthReport(Model.Report_HSEMonthReport report) + { + CNPCDB db = Funs.DB; + Model.Report_HSEMonthReport newReport = db.Report_HSEMonthReport.FirstOrDefault(e => e.ReportId == report.ReportId); + if (newReport != null) + { + newReport.UnitId = report.UnitId; + newReport.ReportDate = report.ReportDate; + newReport.TotalEmployees = report.TotalEmployees; + newReport.TotalHours = report.TotalHours; + newReport.ContractorEmployees = report.ContractorEmployees; + newReport.ContractorHours = report.ContractorHours; + newReport.MonthHours = report.MonthHours; + newReport.MonthHoursAvg = report.MonthHoursAvg; + newReport.YearHours = report.YearHours; + newReport.Remark = report.Remark; + newReport.BranchTraining = report.BranchTraining; + newReport.ProjectTraining = report.ProjectTraining; + newReport.TeamGroupTraining = report.TeamGroupTraining; + newReport.SelfTraining = report.SelfTraining; + newReport.ContractorOrganizeTraining = report.ContractorOrganizeTraining; + newReport.ContractorTraining = report.ContractorTraining; + db.SubmitChanges(); + } + } + + /// + /// 根据主键删除HSE月报 + /// + /// + public static void DeleteHSEMonthReportByReportId(string reportId) + { + CNPCDB db = Funs.DB; + Model.Report_HSEMonthReport report = db.Report_HSEMonthReport.FirstOrDefault(e => e.ReportId == reportId); + if (report != null) + { + db.Report_HSEMonthReport.DeleteOnSubmit(report); + db.SubmitChanges(); + } + } + + /// + /// 根据月报日期获取HSE月报信息 + /// + /// + /// + /// + public static Model.Report_HSEMonthReport GetHSEMonthReportByReportDate(string unitId, DateTime? reportDate) + { + return Funs.DB.Report_HSEMonthReport.FirstOrDefault(e => e.UnitId == unitId && e.ReportDate == reportDate); + } + + } +} diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index 0769da83..4988ac58 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -2604,6 +2604,8 @@ + + @@ -17648,6 +17650,20 @@ HazardFactorSafetyEdit.aspx + + HSEMonthReport.aspx + ASPXCodeBehind + + + HSEMonthReport.aspx + + + HSEMonthReportEdit.aspx + ASPXCodeBehind + + + HSEMonthReportEdit.aspx + SafeEnvBudgetIn.aspx ASPXCodeBehind @@ -20447,7 +20463,7 @@ - + diff --git a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx new file mode 100644 index 00000000..a567f65d --- /dev/null +++ b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx @@ -0,0 +1,127 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HSEMonthReport.aspx.cs" Inherits="FineUIPro.Web.ReportManage.SafeEnvBudget.HSEMonthReport" %> + + + + + + + HSE月报 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx.cs new file mode 100644 index 00000000..9cd76485 --- /dev/null +++ b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx.cs @@ -0,0 +1,387 @@ +using BLL; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Text; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ReportManage.SafeEnvBudget +{ + public partial class HSEMonthReport : PageBase + { + #region 加载页面 + /// + /// 加载页面 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.txtReportDate.Text = string.Format("{0:yyyy-MM}", DateTime.Now); + Funs.DropDownPageSize(this.ddlPageSize); + ///单位 + UnitService.InitBranchUnitDropDownList(this.drpUnitId, true, true); + if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.Base_Unit.IsBranch == true) + { + //分公司只能查看本分公司填报数据 + this.drpUnitId.SelectedValue = this.CurrUser.UnitId; + this.drpUnitId.Readonly = true; + } + ////权限按钮方法 + this.GetButtonPower(); + btnNew.OnClientClick = Window1.GetShowReference("HSEMonthReportEdit.aspx") + "return false;"; + ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + // 绑定表格 + BindGrid(); + } + } + + private DataTable GetSourceDataTable() + { + string strSql = @" SELECT report.ReportId, + report.UnitId, + report.ReportDate, + report.TotalEmployees, + report.TotalHours, + report.ContractorEmployees, + report.ContractorHours, + report.MonthHours, + report.MonthHoursAvg, + report.YearHours, + report.Remark, + report.BranchTraining, + report.ProjectTraining, + report.TeamGroupTraining, + report.SelfTraining, + report.ContractorOrganizeTraining, + report.ContractorTraining, + report.CompileMan, + report.CompileDate, + unit.UnitName + FROM Report_HSEMonthReport AS report + LEFT JOIN Base_Unit AS unit ON unit.UnitId = report.UnitId where 1=1 ";// s.ProjectId=@projectId + List listStr = new List(); + if (!string.IsNullOrEmpty(this.drpUnitId.SelectedValue) && this.drpUnitId.SelectedValue != Const._Null) + { + strSql += " AND report.UnitId=@UnitId"; + listStr.Add(new SqlParameter("@UnitId", this.drpUnitId.SelectedValue)); + } + if (!string.IsNullOrEmpty(this.txtReportDate.Text.Trim())) + { + strSql += " AND report.ReportDate = @reportDate"; + listStr.Add(new SqlParameter("@reportDate", Funs.GetNewDateTime(this.txtReportDate.Text.Trim()))); + } + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + return tb; + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + DataTable tb = GetSourceDataTable(); + Grid1.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(Grid1, tb); + Grid1.DataSource = table; + Grid1.DataBind(); + + JObject summary = new JObject(); + int TotalEmployees = 0; + decimal TotalHours = 0; + int ContractorEmployees = 0; + decimal ContractorHours = 0; + decimal MonthHours = 0; + decimal MonthHoursAvg = 0; + decimal YearHours = 0; + int BranchTraining = 0; + int ProjectTraining = 0; + int TeamGroupTraining = 0; + int SelfTraining = 0; + int ContractorOrganizeTraining = 0; + int ContractorTraining = 0; + + foreach (DataRow row in tb.Rows) + { + TotalEmployees += Funs.GetNewIntOrZero(row["TotalEmployees"].ToString()); + TotalHours += Funs.GetNewDecimalOrZero(row["TotalHours"].ToString()); + ContractorEmployees += Funs.GetNewIntOrZero(row["ContractorEmployees"].ToString()); + ContractorHours += Funs.GetNewDecimalOrZero(row["ContractorHours"].ToString()); + MonthHours += Funs.GetNewDecimalOrZero(row["MonthHours"].ToString()); + MonthHoursAvg += Funs.GetNewDecimalOrZero(row["MonthHoursAvg"].ToString()); + YearHours += Funs.GetNewDecimalOrZero(row["YearHours"].ToString()); + BranchTraining += Funs.GetNewIntOrZero(row["BranchTraining"].ToString()); + ProjectTraining += Funs.GetNewIntOrZero(row["ProjectTraining"].ToString()); + TeamGroupTraining += Funs.GetNewIntOrZero(row["TeamGroupTraining"].ToString()); + SelfTraining += Funs.GetNewIntOrZero(row["SelfTraining"].ToString()); + ContractorOrganizeTraining += Funs.GetNewIntOrZero(row["ContractorOrganizeTraining"].ToString()); + ContractorTraining += Funs.GetNewIntOrZero(row["ContractorTraining"].ToString()); + } + summary.Add("UnitName", "合计"); + summary.Add("TotalEmployees", TotalEmployees); + summary.Add("TotalHours", TotalHours); + summary.Add("ContractorEmployees", ContractorEmployees); + summary.Add("ContractorHours", ContractorHours); + summary.Add("MonthHours", MonthHours); + summary.Add("MonthHoursAvg", MonthHoursAvg); + summary.Add("YearHours", YearHours); + summary.Add("BranchTraining", BranchTraining); + summary.Add("ProjectTraining", ProjectTraining); + summary.Add("TeamGroupTraining", TeamGroupTraining); + summary.Add("SelfTraining", SelfTraining); + summary.Add("ContractorOrganizeTraining", ContractorOrganizeTraining); + summary.Add("ContractorTraining", ContractorTraining); + Grid1.SummaryData = summary; + + } + #endregion + + #region 表排序、分页、关闭窗口 + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + #endregion + + #region Grid双击事件 + /// + /// Grid行双击事件 + /// + /// + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + btnMenuModify_Click(null, null); + } + #endregion + + #region 编辑 + /// + /// 编辑按钮 + /// + /// + /// + protected void btnMenuModify_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string rowId = Grid1.SelectedRowID; + if (!string.IsNullOrEmpty(rowId)) + { + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("HSEMonthReportEdit.aspx?reportId={0}", rowId, "编辑 - "))); + } + } + #endregion + + #region 删除 + /// + /// 批量删除 + /// + /// + /// + 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 data = BLL.HSEMonthReportService.GetHSEMonthReportById(rowID); + if (data != null) + { + BLL.LogService.AddSys_Log(this.CurrUser, data.ReportId, data.ReportId, BLL.Const.HSEMonthReportMenuId, BLL.Const.BtnDelete); + BLL.HSEMonthReportService.DeleteHSEMonthReportByReportId(rowID); + } + } + BindGrid(); + ShowNotify("删除数据成功!"); + } + } + #endregion + + #region 获取按钮权限 + /// + /// 获取按钮权限 + /// + /// + /// + private void GetButtonPower() + { + try + { + if (Request.Params["value"] == "0") + { + return; + } + var buttonList = BLL.CommonService.GetAllButtonList(null, this.CurrUser.UserId, BLL.Const.HSEMonthReportMenuId); + if (buttonList.Count() > 0) + { + if (buttonList.Contains(BLL.Const.BtnAdd)) + { + this.btnNew.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnModify)) + { + this.btnMenuModify.Hidden = false; + } + if (buttonList.Contains(BLL.Const.BtnDelete)) + { + this.btnMenuDel.Hidden = false; + } + } + } + catch (Exception e) + { + + } + } + #endregion + + #region 查询 + /// + /// 查询 + /// + /// + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 导出按钮 + /// 导出按钮 + /// + /// + /// + protected void btnOut_Click(object sender, EventArgs e) + { + Response.ClearContent(); + string fileName = System.Web.HttpUtility.UrlEncode($"HSE月报" + Funs.GetNewFileName(), System.Text.Encoding.UTF8); + Response.AddHeader("content-disposition", "attachment; filename=" + fileName + ".xls"); + Response.ContentType = "application/excel"; + Response.ContentEncoding = System.Text.Encoding.UTF8; + + DataTable dtAll = GetSourceDataTable(); + string html = GetGridMultiHeaderTableHtml(Grid1, dtAll); + Response.Write(html); + Response.End(); + } + + /// + /// 多表头导出 + /// + public string GetGridMultiHeaderTableHtml(Grid grid, DataTable dtSource) + { + StringBuilder sb = new StringBuilder(); + sb.Append(""); + sb.Append(""); + + MultiHeaderTable mht = new MultiHeaderTable(); + mht.ResolveMultiHeaderTable(grid.Columns); + + foreach (List rows in mht.MultiTable) + { + sb.Append(""); + foreach (object[] cell in rows) + { + int rowspan = Convert.ToInt32(cell[0]); + int colspan = Convert.ToInt32(cell[1]); + GridColumn column = cell[2] as GridColumn; + if (column.Hidden == false) + { + sb.AppendFormat("{3}", + rowspan != 1 ? " rowspan=\"" + rowspan + "\"" : "", + colspan != 1 ? " colspan=\"" + colspan + "\"" : "", + colspan != 1 ? " style=\"text-align:center;\"" : "", + column.HeaderText); + } + } + sb.Append(""); + } + + int rowIndex = 0; + foreach (DataRow dr in dtSource.Rows) + { + sb.Append(""); + foreach (GridColumn column in mht.Columns) + { + if (column.ColumnID == "ckbIsSelected" || column.ColumnID == "Punish" || column.ColumnID == "Del") + continue; + + string cellValue = ""; + if (column.ColumnID == "tfNumber") + { + //导出序号:全部数据的序号 + cellValue = (rowIndex + 1).ToString(); + } + else if (column.ColumnID == "ReportDate") + { + cellValue = string.Format("{0:yyyy-MM}", dr[column.ColumnID]); + } + else + { + if (!string.IsNullOrEmpty(column.ColumnID) && dtSource.Columns.Contains(column.ColumnID)) + { + cellValue = dr[column.ColumnID] == DBNull.Value ? "" : dr[column.ColumnID].ToString(); + } + } + sb.AppendFormat("", System.Web.HttpUtility.HtmlEncode(cellValue)); + } + sb.Append(""); + rowIndex++; + } + sb.Append("
{0}
"); + return sb.ToString(); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx.designer.cs b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx.designer.cs new file mode 100644 index 00000000..9dc94e5e --- /dev/null +++ b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReport.aspx.designer.cs @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ReportManage.SafeEnvBudget +{ + + + public partial class HSEMonthReport + { + + /// + /// 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; + + /// + /// drpUnitId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnitId; + + /// + /// txtReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtReportDate; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// btnOut 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnOut; + + /// + /// labNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label labNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuModify 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuModify; + + /// + /// btnMenuDel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDel; + } +} diff --git a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx new file mode 100644 index 00000000..1ebb4de0 --- /dev/null +++ b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx @@ -0,0 +1,128 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HSEMonthReportEdit.aspx.cs" Inherits="FineUIPro.Web.ReportManage.SafeEnvBudget.HSEMonthReportEdit" %> + + + + + + + 编辑HSE月报 + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx.cs b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx.cs new file mode 100644 index 00000000..056ecda8 --- /dev/null +++ b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx.cs @@ -0,0 +1,145 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.ReportManage.SafeEnvBudget +{ + public partial class HSEMonthReportEdit : PageBase + { + #region 定义变量 + /// + /// 主键 + /// + public string ReportId + { + get + { + return (string)ViewState["ReportId"]; + } + set + { + ViewState["ReportId"] = value; + } + } + #endregion + + #region 加载页面 + /// + /// 加载数据 + /// + /// + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + //单位 + UnitService.InitBranchUnitDropDownList(this.drpUnitId, true, true); + if (!string.IsNullOrWhiteSpace(this.CurrUser.UnitId) && this.CurrUser.Base_Unit.IsBranch == true) + { + this.drpUnitId.SelectedValue = this.CurrUser.UnitId; + this.drpUnitId.Readonly = true; + } + this.ReportId = Request.Params["reportId"]; + if (!string.IsNullOrEmpty(this.ReportId)) + { + var report = BLL.HSEMonthReportService.GetHSEMonthReportById(this.ReportId); + if (report != null) + { + txtReportDate.Text = string.Format("{0:yyyy-MM}", report.ReportDate); + if (!string.IsNullOrEmpty(report.UnitId)) + { + this.drpUnitId.SelectedValue = report.UnitId; + this.drpUnitId.Readonly = true; + } + this.txtReportDate.Readonly = true; + + txtTotalEmployees.Text = report.TotalEmployees.HasValue ? report.TotalEmployees.ToString() : ""; + txtTotalHours.Text = report.TotalHours.HasValue ? report.TotalHours.ToString() : ""; + txtContractorEmployees.Text = report.ContractorEmployees.HasValue ? report.ContractorEmployees.ToString() : ""; + txtContractorHours.Text = report.ContractorHours.HasValue ? report.ContractorHours.ToString() : ""; + txtMonthHours.Text = report.MonthHours.HasValue ? report.MonthHours.ToString() : ""; + txtMonthHoursAvg.Text = report.MonthHoursAvg.HasValue ? report.MonthHoursAvg.ToString() : ""; + txtYearHours.Text = report.YearHours.HasValue ? report.YearHours.ToString() : ""; + txtBranchTraining.Text = report.BranchTraining.HasValue ? report.BranchTraining.ToString() : ""; + txtProjectTraining.Text = report.ProjectTraining.HasValue ? report.ProjectTraining.ToString() : ""; + txtTeamGroupTraining.Text = report.TeamGroupTraining.HasValue ? report.TeamGroupTraining.ToString() : ""; + txtSelfTraining.Text = report.SelfTraining.HasValue ? report.SelfTraining.ToString() : ""; + txtContractorOrganizeTraining.Text = report.ContractorOrganizeTraining.HasValue ? report.ContractorOrganizeTraining.ToString() : ""; + txtContractorTraining.Text = report.ContractorTraining.HasValue ? report.ContractorTraining.ToString() : ""; + txtRemark.Text = report.Remark; + } + } + else + { + this.txtReportDate.Text = string.Format("{0:yyyy-MM}", DateTime.Now); + } + } + } + #endregion + + #region 保存 + /// + /// 保存数据 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + DateTime? reportDate = Funs.GetNewDateTime(this.txtReportDate.Text.Trim()); + if (string.IsNullOrEmpty(this.ReportId)) + { + var data = BLL.HSEMonthReportService.GetHSEMonthReportByReportDate(this.drpUnitId.SelectedValue, reportDate); + if (data != null) + { + Alert.ShowInTop("本月HSE月报已上报!", MessageBoxIcon.Warning); + return; + } + if (this.drpUnitId.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpUnitId.SelectedValue)) + { + Alert.ShowInTop("请选择单位!", MessageBoxIcon.Warning); + return; + } + } + Model.Report_HSEMonthReport newReport = new Model.Report_HSEMonthReport(); + newReport.UnitId = this.drpUnitId.SelectedValue; + newReport.ReportDate = Convert.ToDateTime(reportDate); + newReport.TotalEmployees = Funs.GetNewInt(txtTotalEmployees.Text); + newReport.TotalHours = Funs.GetNewInt(txtTotalHours.Text); + newReport.ContractorEmployees = Funs.GetNewInt(txtContractorEmployees.Text); + newReport.ContractorHours = Funs.GetNewInt(txtContractorHours.Text); + newReport.MonthHours = Funs.GetNewInt(txtMonthHours.Text); + newReport.MonthHoursAvg = Funs.GetNewInt(txtMonthHoursAvg.Text); + newReport.YearHours = Funs.GetNewInt(txtYearHours.Text); + newReport.BranchTraining = Funs.GetNewInt(txtBranchTraining.Text); + newReport.ProjectTraining = Funs.GetNewInt(txtProjectTraining.Text); + newReport.TeamGroupTraining = Funs.GetNewInt(txtTeamGroupTraining.Text); + newReport.SelfTraining = Funs.GetNewInt(txtSelfTraining.Text); + newReport.ContractorOrganizeTraining = Funs.GetNewInt(txtContractorOrganizeTraining.Text); + newReport.ContractorTraining = Funs.GetNewInt(txtContractorTraining.Text); + newReport.Remark = this.txtRemark.Text; + if (!string.IsNullOrEmpty(this.ReportId)) + { + newReport.ReportId = this.ReportId; + BLL.HSEMonthReportService.UpdateHSEMonthReport(newReport); + BLL.LogService.AddSys_Log(this.CurrUser, newReport.ReportId, newReport.ReportId, BLL.Const.HSEMonthReportMenuId, BLL.Const.BtnModify); + ShowNotify("修改成功!", MessageBoxIcon.Success); + } + else + { + newReport.CompileMan = this.CurrUser.UserId; + newReport.CompileDate = DateTime.Now; + newReport.ReportId = SQLHelper.GetNewID(); + BLL.HSEMonthReportService.AddHSEMonthReport(newReport); + BLL.LogService.AddSys_Log(this.CurrUser, newReport.ReportId, newReport.ReportId, BLL.Const.HSEMonthReportMenuId, BLL.Const.BtnAdd); + ShowNotify("保存成功!", MessageBoxIcon.Success); + } + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx.designer.cs new file mode 100644 index 00000000..6dbf44a9 --- /dev/null +++ b/SGGL/FineUIPro.Web/ReportManage/SafeEnvBudget/HSEMonthReportEdit.aspx.designer.cs @@ -0,0 +1,296 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.ReportManage.SafeEnvBudget +{ + + + public partial class HSEMonthReportEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtReportDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker txtReportDate; + + /// + /// drpUnitId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpUnitId; + + /// + /// Label4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label4; + + /// + /// GroupPanel35 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel35; + + /// + /// Form36 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form36; + + /// + /// txtTotalEmployees 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtTotalEmployees; + + /// + /// txtTotalHours 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtTotalHours; + + /// + /// txtContractorEmployees 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtContractorEmployees; + + /// + /// txtContractorHours 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtContractorHours; + + /// + /// txtMonthHours 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtMonthHours; + + /// + /// txtMonthHoursAvg 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtMonthHoursAvg; + + /// + /// txtYearHours 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtYearHours; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// Label2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label2; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtRemark; + + /// + /// GroupPanel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.GroupPanel GroupPanel1; + + /// + /// Form3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form3; + + /// + /// Form2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form2; + + /// + /// txtBranchTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtBranchTraining; + + /// + /// txtProjectTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtProjectTraining; + + /// + /// txtTeamGroupTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtTeamGroupTraining; + + /// + /// Form4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form Form4; + + /// + /// txtSelfTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSelfTraining; + + /// + /// txtContractorOrganizeTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtContractorOrganizeTraining; + + /// + /// txtContractorTraining 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtContractorTraining; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + } +} diff --git a/SGGL/FineUIPro.Web/common/main.aspx b/SGGL/FineUIPro.Web/common/main.aspx index 45cda4c7..4451279c 100644 --- a/SGGL/FineUIPro.Web/common/main.aspx +++ b/SGGL/FineUIPro.Web/common/main.aspx @@ -30,49 +30,49 @@ -
+

教育培训

公司级培训
-
0个
+
{{form?.monthReport?.branchTrainingNum}}个
项目级培训
-
0个
+
{{form?.monthReport?.projectTrainingNum}}个
班组级培训
-
0个
+
{{form?.monthReport?.teamGroupTrainingNum}}个
自行培训
-
0个
+
{{form?.monthReport?.selfTrainingNum}}个
承包商组织培训
-
0个
+
{{form?.monthReport?.contractorOrganizeTrainingNum}}个
承包商培训
-
0个
+
{{form?.monthReport?.contractorTrainingNum}}个
@@ -811,7 +811,10 @@ break case "HazardFactorOccHealth"://职业健康危害因素 window.open('../DataShow/HazardFactorOccHealth.aspx') - break + break + case "MonthReport": //教育培训 + window.open('../ReportManage/SafeEnvBudget/HSEMonthReport.aspx') + break } $(".popu").show() }) diff --git a/SGGL/FineUIPro.Web/common/main.aspx.cs b/SGGL/FineUIPro.Web/common/main.aspx.cs index 5889002c..e0f06a5c 100644 --- a/SGGL/FineUIPro.Web/common/main.aspx.cs +++ b/SGGL/FineUIPro.Web/common/main.aspx.cs @@ -2,6 +2,7 @@ using FineUIPro.Web.DataShow; using Model; using NPOI.POIFS.Crypt.Dsig; +using RestSharp.Extensions; using System; using System.Collections.Generic; using System.Data; @@ -117,6 +118,19 @@ namespace FineUIPro.Web.common var largerRiskOcc = getHazardFactorOccHealthList.Where(x => x.Title == "较大风险").FirstOrDefault(); var majorRiskOcc = getHazardFactorOccHealthList.Where(x => x.Title == "重大风险").FirstOrDefault(); + //教育培训 + var monthReportList = (from x in Funs.DB.Report_HSEMonthReport select x).ToList(); + if(!string.IsNullOrEmpty(hfUnitId)) + { + monthReportList = monthReportList.Where(x => x.UnitId == hfUnitId).ToList(); + } + int branchTraining = monthReportList.Sum(x => x.BranchTraining).Value; + int projectTraining = monthReportList.Sum(x => x.ProjectTraining).Value; + int teamGroupTraining = monthReportList.Sum(x => x.TeamGroupTraining).Value; + int selfTraining = monthReportList.Sum(x => x.SelfTraining).Value; + int contractorOrganizeTraining = monthReportList.Sum(x => x.ContractorOrganizeTraining).Value; + int contractorTraining = monthReportList.Sum(x => x.ContractorTraining).Value; + //构造返回数据 return new { @@ -183,6 +197,15 @@ namespace FineUIPro.Web.common generalRiskNum = generalRiskOcc != null ? generalRiskOcc.Num : 0, largerRiskNum = largerRiskOcc != null ? largerRiskOcc.Num : 0, majorRiskNum = majorRiskOcc != null ? majorRiskOcc.Num : 0, + }, + monthReport = new + {//教育培训 + branchTrainingNum = branchTraining > 0 ? branchTraining : 0, + projectTrainingNum = projectTraining > 0 ? projectTraining : 0, + teamGroupTrainingNum = teamGroupTraining > 0 ? teamGroupTraining : 0, + selfTrainingNum = selfTraining > 0 ? selfTraining : 0, + contractorOrganizeTrainingNum = contractorOrganizeTraining > 0 ? contractorOrganizeTraining : 0, + contractorTrainingNum = contractorTraining > 0 ? contractorTraining : 0, } } }; diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 2de199f1..73ca832e 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -2102,6 +2102,9 @@ namespace Model partial void InsertReport_ConstructionProblems(Report_ConstructionProblems instance); partial void UpdateReport_ConstructionProblems(Report_ConstructionProblems instance); partial void DeleteReport_ConstructionProblems(Report_ConstructionProblems instance); + partial void InsertReport_HSEMonthReport(Report_HSEMonthReport instance); + partial void UpdateReport_HSEMonthReport(Report_HSEMonthReport instance); + partial void DeleteReport_HSEMonthReport(Report_HSEMonthReport instance); partial void InsertReport_NextQualityControl(Report_NextQualityControl instance); partial void UpdateReport_NextQualityControl(Report_NextQualityControl instance); partial void DeleteReport_NextQualityControl(Report_NextQualityControl instance); @@ -8295,6 +8298,14 @@ namespace Model } } + public System.Data.Linq.Table Report_HSEMonthReport + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table Report_NextQualityControl { get @@ -45148,6 +45159,8 @@ namespace Model private EntitySet _Report_ConstructionProblems; + private EntitySet _Report_HSEMonthReport; + private EntitySet _SafetyManagementData; private EntitySet _SecuritySystem_SafetyOrganization; @@ -45439,6 +45452,7 @@ namespace Model this._QualityAudit_SubUnitQualityAuditDetail = new EntitySet(new Action(this.attach_QualityAudit_SubUnitQualityAuditDetail), new Action(this.detach_QualityAudit_SubUnitQualityAuditDetail)); this._RealName_SynchroSet = new EntitySet(new Action(this.attach_RealName_SynchroSet), new Action(this.detach_RealName_SynchroSet)); this._Report_ConstructionProblems = new EntitySet(new Action(this.attach_Report_ConstructionProblems), new Action(this.detach_Report_ConstructionProblems)); + this._Report_HSEMonthReport = new EntitySet(new Action(this.attach_Report_HSEMonthReport), new Action(this.detach_Report_HSEMonthReport)); this._SafetyManagementData = new EntitySet(new Action(this.attach_SafetyManagementData), new Action(this.detach_SafetyManagementData)); this._SecuritySystem_SafetyOrganization = new EntitySet(new Action(this.attach_SecuritySystem_SafetyOrganization), new Action(this.detach_SecuritySystem_SafetyOrganization)); this._SitePerson_DayReportDetail_Bak = new EntitySet(new Action(this.attach_SitePerson_DayReportDetail_Bak), new Action(this.detach_SitePerson_DayReportDetail_Bak)); @@ -48203,6 +48217,19 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Report_HSEMonthReport_Base_Unit", Storage="_Report_HSEMonthReport", ThisKey="UnitId", OtherKey="UnitId", DeleteRule="NO ACTION")] + public EntitySet Report_HSEMonthReport + { + get + { + return this._Report_HSEMonthReport; + } + set + { + this._Report_HSEMonthReport.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SafetyManagementData_Base_Unit", Storage="_SafetyManagementData", ThisKey="UnitId", OtherKey="UnitId", DeleteRule="NO ACTION")] public EntitySet SafetyManagementData { @@ -50617,6 +50644,18 @@ namespace Model entity.Base_Unit = null; } + private void attach_Report_HSEMonthReport(Report_HSEMonthReport entity) + { + this.SendPropertyChanging(); + entity.Base_Unit = this; + } + + private void detach_Report_HSEMonthReport(Report_HSEMonthReport entity) + { + this.SendPropertyChanging(); + entity.Base_Unit = null; + } + private void attach_SafetyManagementData(SafetyManagementData entity) { this.SendPropertyChanging(); @@ -156069,9 +156108,9 @@ namespace Model private string _ProjectId; - private System.Nullable _EnergySavingIndex; + private System.Nullable _EnergySavingIndex; - private System.Nullable _WaterSavingIndex; + private System.Nullable _WaterSavingIndex; private string _EnergySavingSchemes; @@ -156083,13 +156122,13 @@ namespace Model private string _SupportingDocuments; - private System.Nullable _ActualEnergySaving; + private System.Nullable _ActualEnergySaving; - private System.Nullable _ActualWaterSaving; + private System.Nullable _ActualWaterSaving; - private System.Nullable _EnergySavingCompletionRate; + private System.Nullable _EnergySavingCompletionRate; - private System.Nullable _WaterSavingCompletionRate; + private System.Nullable _WaterSavingCompletionRate; private string _CompileMan; @@ -156109,9 +156148,9 @@ namespace Model partial void OnEnergyWaterConservationIdChanged(); partial void OnProjectIdChanging(string value); partial void OnProjectIdChanged(); - partial void OnEnergySavingIndexChanging(System.Nullable value); + partial void OnEnergySavingIndexChanging(System.Nullable value); partial void OnEnergySavingIndexChanged(); - partial void OnWaterSavingIndexChanging(System.Nullable value); + partial void OnWaterSavingIndexChanging(System.Nullable value); partial void OnWaterSavingIndexChanged(); partial void OnEnergySavingSchemesChanging(string value); partial void OnEnergySavingSchemesChanged(); @@ -156123,13 +156162,13 @@ namespace Model partial void OnSummaryChanged(); partial void OnSupportingDocumentsChanging(string value); partial void OnSupportingDocumentsChanged(); - partial void OnActualEnergySavingChanging(System.Nullable value); + partial void OnActualEnergySavingChanging(System.Nullable value); partial void OnActualEnergySavingChanged(); - partial void OnActualWaterSavingChanging(System.Nullable value); + partial void OnActualWaterSavingChanging(System.Nullable value); partial void OnActualWaterSavingChanged(); - partial void OnEnergySavingCompletionRateChanging(System.Nullable value); + partial void OnEnergySavingCompletionRateChanging(System.Nullable value); partial void OnEnergySavingCompletionRateChanged(); - partial void OnWaterSavingCompletionRateChanging(System.Nullable value); + partial void OnWaterSavingCompletionRateChanging(System.Nullable value); partial void OnWaterSavingCompletionRateChanged(); partial void OnCompileManChanging(string value); partial void OnCompileManChanged(); @@ -156190,8 +156229,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EnergySavingIndex", DbType="Decimal(18,2)")] - public System.Nullable EnergySavingIndex + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EnergySavingIndex", DbType="Int")] + public System.Nullable EnergySavingIndex { get { @@ -156210,8 +156249,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WaterSavingIndex", DbType="Decimal(18,2)")] - public System.Nullable WaterSavingIndex + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WaterSavingIndex", DbType="Int")] + public System.Nullable WaterSavingIndex { get { @@ -156330,8 +156369,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ActualEnergySaving", DbType="Decimal(18,2)")] - public System.Nullable ActualEnergySaving + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ActualEnergySaving", DbType="Int")] + public System.Nullable ActualEnergySaving { get { @@ -156350,8 +156389,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ActualWaterSaving", DbType="Decimal(18,2)")] - public System.Nullable ActualWaterSaving + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ActualWaterSaving", DbType="Int")] + public System.Nullable ActualWaterSaving { get { @@ -156370,8 +156409,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EnergySavingCompletionRate", DbType="Decimal(18,2)")] - public System.Nullable EnergySavingCompletionRate + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EnergySavingCompletionRate", DbType="Int")] + public System.Nullable EnergySavingCompletionRate { get { @@ -156390,8 +156429,8 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WaterSavingCompletionRate", DbType="Decimal(18,2)")] - public System.Nullable WaterSavingCompletionRate + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WaterSavingCompletionRate", DbType="Int")] + public System.Nullable WaterSavingCompletionRate { get { @@ -334520,6 +334559,582 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Report_HSEMonthReport")] + public partial class Report_HSEMonthReport : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _ReportId; + + private string _UnitId; + + private System.DateTime _ReportDate; + + private System.Nullable _TotalEmployees; + + private System.Nullable _TotalHours; + + private System.Nullable _ContractorEmployees; + + private System.Nullable _ContractorHours; + + private System.Nullable _MonthHours; + + private System.Nullable _MonthHoursAvg; + + private System.Nullable _YearHours; + + private string _Remark; + + private System.Nullable _BranchTraining; + + private System.Nullable _ProjectTraining; + + private System.Nullable _TeamGroupTraining; + + private System.Nullable _SelfTraining; + + private System.Nullable _ContractorOrganizeTraining; + + private System.Nullable _ContractorTraining; + + private string _CompileMan; + + private System.Nullable _CompileDate; + + private EntityRef _Base_Unit; + + private EntityRef _Sys_User; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnReportIdChanging(string value); + partial void OnReportIdChanged(); + partial void OnUnitIdChanging(string value); + partial void OnUnitIdChanged(); + partial void OnReportDateChanging(System.DateTime value); + partial void OnReportDateChanged(); + partial void OnTotalEmployeesChanging(System.Nullable value); + partial void OnTotalEmployeesChanged(); + partial void OnTotalHoursChanging(System.Nullable value); + partial void OnTotalHoursChanged(); + partial void OnContractorEmployeesChanging(System.Nullable value); + partial void OnContractorEmployeesChanged(); + partial void OnContractorHoursChanging(System.Nullable value); + partial void OnContractorHoursChanged(); + partial void OnMonthHoursChanging(System.Nullable value); + partial void OnMonthHoursChanged(); + partial void OnMonthHoursAvgChanging(System.Nullable value); + partial void OnMonthHoursAvgChanged(); + partial void OnYearHoursChanging(System.Nullable value); + partial void OnYearHoursChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + partial void OnBranchTrainingChanging(System.Nullable value); + partial void OnBranchTrainingChanged(); + partial void OnProjectTrainingChanging(System.Nullable value); + partial void OnProjectTrainingChanged(); + partial void OnTeamGroupTrainingChanging(System.Nullable value); + partial void OnTeamGroupTrainingChanged(); + partial void OnSelfTrainingChanging(System.Nullable value); + partial void OnSelfTrainingChanged(); + partial void OnContractorOrganizeTrainingChanging(System.Nullable value); + partial void OnContractorOrganizeTrainingChanged(); + partial void OnContractorTrainingChanging(System.Nullable value); + partial void OnContractorTrainingChanged(); + partial void OnCompileManChanging(string value); + partial void OnCompileManChanged(); + partial void OnCompileDateChanging(System.Nullable value); + partial void OnCompileDateChanged(); + #endregion + + public Report_HSEMonthReport() + { + this._Base_Unit = default(EntityRef); + this._Sys_User = default(EntityRef); + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReportId", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string ReportId + { + get + { + return this._ReportId; + } + set + { + if ((this._ReportId != value)) + { + this.OnReportIdChanging(value); + this.SendPropertyChanging(); + this._ReportId = value; + this.SendPropertyChanged("ReportId"); + this.OnReportIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50) NOT NULL", CanBeNull=false)] + public string UnitId + { + get + { + return this._UnitId; + } + set + { + if ((this._UnitId != value)) + { + if (this._Base_Unit.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } + this.OnUnitIdChanging(value); + this.SendPropertyChanging(); + this._UnitId = value; + this.SendPropertyChanged("UnitId"); + this.OnUnitIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ReportDate", DbType="DateTime NOT NULL")] + public System.DateTime ReportDate + { + get + { + return this._ReportDate; + } + set + { + if ((this._ReportDate != value)) + { + this.OnReportDateChanging(value); + this.SendPropertyChanging(); + this._ReportDate = value; + this.SendPropertyChanged("ReportDate"); + this.OnReportDateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalEmployees", DbType="Int")] + public System.Nullable TotalEmployees + { + get + { + return this._TotalEmployees; + } + set + { + if ((this._TotalEmployees != value)) + { + this.OnTotalEmployeesChanging(value); + this.SendPropertyChanging(); + this._TotalEmployees = value; + this.SendPropertyChanged("TotalEmployees"); + this.OnTotalEmployeesChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TotalHours", DbType="Decimal(18,2)")] + public System.Nullable TotalHours + { + get + { + return this._TotalHours; + } + set + { + if ((this._TotalHours != value)) + { + this.OnTotalHoursChanging(value); + this.SendPropertyChanging(); + this._TotalHours = value; + this.SendPropertyChanged("TotalHours"); + this.OnTotalHoursChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractorEmployees", DbType="Int")] + public System.Nullable ContractorEmployees + { + get + { + return this._ContractorEmployees; + } + set + { + if ((this._ContractorEmployees != value)) + { + this.OnContractorEmployeesChanging(value); + this.SendPropertyChanging(); + this._ContractorEmployees = value; + this.SendPropertyChanged("ContractorEmployees"); + this.OnContractorEmployeesChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractorHours", DbType="Decimal(18,2)")] + public System.Nullable ContractorHours + { + get + { + return this._ContractorHours; + } + set + { + if ((this._ContractorHours != value)) + { + this.OnContractorHoursChanging(value); + this.SendPropertyChanging(); + this._ContractorHours = value; + this.SendPropertyChanged("ContractorHours"); + this.OnContractorHoursChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MonthHours", DbType="Decimal(18,2)")] + public System.Nullable MonthHours + { + get + { + return this._MonthHours; + } + set + { + if ((this._MonthHours != value)) + { + this.OnMonthHoursChanging(value); + this.SendPropertyChanging(); + this._MonthHours = value; + this.SendPropertyChanged("MonthHours"); + this.OnMonthHoursChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MonthHoursAvg", DbType="Decimal(18,2)")] + public System.Nullable MonthHoursAvg + { + get + { + return this._MonthHoursAvg; + } + set + { + if ((this._MonthHoursAvg != value)) + { + this.OnMonthHoursAvgChanging(value); + this.SendPropertyChanging(); + this._MonthHoursAvg = value; + this.SendPropertyChanged("MonthHoursAvg"); + this.OnMonthHoursAvgChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_YearHours", DbType="Decimal(18,2)")] + public System.Nullable YearHours + { + get + { + return this._YearHours; + } + set + { + if ((this._YearHours != value)) + { + this.OnYearHoursChanging(value); + this.SendPropertyChanging(); + this._YearHours = value; + this.SendPropertyChanged("YearHours"); + this.OnYearHoursChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(500)")] + 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.ColumnAttribute(Storage="_BranchTraining", DbType="Int")] + public System.Nullable BranchTraining + { + get + { + return this._BranchTraining; + } + set + { + if ((this._BranchTraining != value)) + { + this.OnBranchTrainingChanging(value); + this.SendPropertyChanging(); + this._BranchTraining = value; + this.SendPropertyChanged("BranchTraining"); + this.OnBranchTrainingChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectTraining", DbType="Int")] + public System.Nullable ProjectTraining + { + get + { + return this._ProjectTraining; + } + set + { + if ((this._ProjectTraining != value)) + { + this.OnProjectTrainingChanging(value); + this.SendPropertyChanging(); + this._ProjectTraining = value; + this.SendPropertyChanged("ProjectTraining"); + this.OnProjectTrainingChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TeamGroupTraining", DbType="Int")] + public System.Nullable TeamGroupTraining + { + get + { + return this._TeamGroupTraining; + } + set + { + if ((this._TeamGroupTraining != value)) + { + this.OnTeamGroupTrainingChanging(value); + this.SendPropertyChanging(); + this._TeamGroupTraining = value; + this.SendPropertyChanged("TeamGroupTraining"); + this.OnTeamGroupTrainingChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SelfTraining", DbType="Int")] + public System.Nullable SelfTraining + { + get + { + return this._SelfTraining; + } + set + { + if ((this._SelfTraining != value)) + { + this.OnSelfTrainingChanging(value); + this.SendPropertyChanging(); + this._SelfTraining = value; + this.SendPropertyChanged("SelfTraining"); + this.OnSelfTrainingChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractorOrganizeTraining", DbType="Int")] + public System.Nullable ContractorOrganizeTraining + { + get + { + return this._ContractorOrganizeTraining; + } + set + { + if ((this._ContractorOrganizeTraining != value)) + { + this.OnContractorOrganizeTrainingChanging(value); + this.SendPropertyChanging(); + this._ContractorOrganizeTraining = value; + this.SendPropertyChanged("ContractorOrganizeTraining"); + this.OnContractorOrganizeTrainingChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ContractorTraining", DbType="Int")] + public System.Nullable ContractorTraining + { + get + { + return this._ContractorTraining; + } + set + { + if ((this._ContractorTraining != value)) + { + this.OnContractorTrainingChanging(value); + this.SendPropertyChanging(); + this._ContractorTraining = value; + this.SendPropertyChanged("ContractorTraining"); + this.OnContractorTrainingChanged(); + } + } + } + + [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 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.AssociationAttribute(Name="FK_Report_HSEMonthReport_Base_Unit", Storage="_Base_Unit", ThisKey="UnitId", OtherKey="UnitId", IsForeignKey=true)] + public Base_Unit Base_Unit + { + get + { + return this._Base_Unit.Entity; + } + set + { + Base_Unit previousValue = this._Base_Unit.Entity; + if (((previousValue != value) + || (this._Base_Unit.HasLoadedOrAssignedValue == false))) + { + this.SendPropertyChanging(); + if ((previousValue != null)) + { + this._Base_Unit.Entity = null; + previousValue.Report_HSEMonthReport.Remove(this); + } + this._Base_Unit.Entity = value; + if ((value != null)) + { + value.Report_HSEMonthReport.Add(this); + this._UnitId = value.UnitId; + } + else + { + this._UnitId = default(string); + } + this.SendPropertyChanged("Base_Unit"); + } + } + } + + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Report_HSEMonthReport_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.Report_HSEMonthReport.Remove(this); + } + this._Sys_User.Entity = value; + if ((value != null)) + { + value.Report_HSEMonthReport.Add(this); + this._CompileMan = value.UserId; + } + else + { + this._CompileMan = default(string); + } + this.SendPropertyChanged("Sys_User"); + } + } + } + + 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.Report_NextQualityControl")] public partial class Report_NextQualityControl : INotifyPropertyChanging, INotifyPropertyChanged { @@ -375743,6 +376358,8 @@ namespace Model private EntitySet _QualityAudit_SubUnitQualityAuditDetail; + private EntitySet _Report_HSEMonthReport; + private EntitySet _SafetyData_SafetyDataItem; private EntitySet _SafetyManagementData; @@ -376258,6 +376875,7 @@ namespace Model this._QualityAudit_SafePersonQuality = new EntitySet(new Action(this.attach_QualityAudit_SafePersonQuality), new Action(this.detach_QualityAudit_SafePersonQuality)); this._QualityAudit_SafePersonQuality_Sys_User_AuditorId = new EntitySet(new Action(this.attach_QualityAudit_SafePersonQuality_Sys_User_AuditorId), new Action(this.detach_QualityAudit_SafePersonQuality_Sys_User_AuditorId)); this._QualityAudit_SubUnitQualityAuditDetail = new EntitySet(new Action(this.attach_QualityAudit_SubUnitQualityAuditDetail), new Action(this.detach_QualityAudit_SubUnitQualityAuditDetail)); + this._Report_HSEMonthReport = new EntitySet(new Action(this.attach_Report_HSEMonthReport), new Action(this.detach_Report_HSEMonthReport)); this._SafetyData_SafetyDataItem = new EntitySet(new Action(this.attach_SafetyData_SafetyDataItem), new Action(this.detach_SafetyData_SafetyDataItem)); this._SafetyManagementData = new EntitySet(new Action(this.attach_SafetyManagementData), new Action(this.detach_SafetyManagementData)); this._SitePerson_DayReport_Bak = new EntitySet(new Action(this.attach_SitePerson_DayReport_Bak), new Action(this.detach_SitePerson_DayReport_Bak)); @@ -381245,6 +381863,19 @@ namespace Model } } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_Report_HSEMonthReport_Sys_User", Storage="_Report_HSEMonthReport", ThisKey="UserId", OtherKey="CompileMan", DeleteRule="NO ACTION")] + public EntitySet Report_HSEMonthReport + { + get + { + return this._Report_HSEMonthReport; + } + set + { + this._Report_HSEMonthReport.Assign(value); + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_SafetyData_SafetyDataItem_Sys_User", Storage="_SafetyData_SafetyDataItem", ThisKey="UserId", OtherKey="CompileMan", DeleteRule="NO ACTION")] public EntitySet SafetyData_SafetyDataItem { @@ -385480,6 +386111,18 @@ namespace Model entity.Sys_User = null; } + private void attach_Report_HSEMonthReport(Report_HSEMonthReport entity) + { + this.SendPropertyChanging(); + entity.Sys_User = this; + } + + private void detach_Report_HSEMonthReport(Report_HSEMonthReport entity) + { + this.SendPropertyChanging(); + entity.Sys_User = null; + } + private void attach_SafetyData_SafetyDataItem(SafetyData_SafetyDataItem entity) { this.SendPropertyChanging(); @@ -456606,6 +457249,8 @@ namespace Model private string _PersonName; + private System.Nullable _Score; + private string _Sex; private string _SexName; @@ -456820,6 +457465,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Score", DbType="Int")] + public System.Nullable Score + { + get + { + return this._Score; + } + set + { + if ((this._Score != value)) + { + this._Score = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sex", DbType="Char(1)")] public string Sex { @@ -458137,6 +458798,8 @@ namespace Model private string _PersonName; + private System.Nullable _Score; + private string _UnitId; private string _UnitName; @@ -458299,6 +458962,22 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Score", DbType="Int")] + public System.Nullable Score + { + get + { + return this._Score; + } + set + { + if ((this._Score != value)) + { + this._Score = value; + } + } + } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_UnitId", DbType="NVarChar(50)")] public string UnitId {