From 4925a6c4b0aaa0018b4304d013081c7eaf36e373 Mon Sep 17 00:00:00 2001 From: Zones <765289303@qq.com> Date: Sat, 15 Aug 2026 11:27:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E6=8A=80=E6=9C=AF=E4=BA=A4?= =?UTF-8?q?=E5=BA=95=E6=8E=A5=E5=85=A5=E7=9C=9F=E5=AE=9E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=B9=B6=E5=85=B3=E8=81=94=E5=BD=93=E5=89=8D=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=EF=BC=88=E9=99=84=E4=BB=B6=E5=8F=82=E8=80=83=E4=B8=93?= =?UTF-8?q?=E9=A1=B9=E6=96=BD=E5=B7=A5=E6=96=B9=E6=A1=88=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../版本日志/SGGLDB_V2026-08-15-001-zones.sql | 78 ++++++++ SGGL/BLL/BLL.csproj | 30 +-- .../HSSE/Hazard/SafetyDisclosureService.cs | 93 ++++++++++ .../HSSE/HazardousMG/SafetyDisclosure.aspx | 116 ++++++++++++ .../HSSE/HazardousMG/SafetyDisclosure.aspx.cs | 172 ++++++++++++++++++ .../SafetyDisclosure.aspx.designer.cs | 170 +++++++++++++++++ .../HazardousMG/SafetyDisclosureEdit.aspx | 78 ++++++++ .../HazardousMG/SafetyDisclosureEdit.aspx.cs | 110 +++++++++++ .../SafetyDisclosureEdit.aspx.designer.cs | 161 ++++++++++++++++ 9 files changed, 981 insertions(+), 27 deletions(-) create mode 100644 DataBase/版本日志/SGGLDB_V2026-08-15-001-zones.sql create mode 100644 SGGL/BLL/HSSE/Hazard/SafetyDisclosureService.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx create mode 100644 SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx.designer.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx create mode 100644 SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx.cs create mode 100644 SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx.designer.cs diff --git a/DataBase/版本日志/SGGLDB_V2026-08-15-001-zones.sql b/DataBase/版本日志/SGGLDB_V2026-08-15-001-zones.sql new file mode 100644 index 0000000..524e21c --- /dev/null +++ b/DataBase/版本日志/SGGLDB_V2026-08-15-001-zones.sql @@ -0,0 +1,78 @@ +-- 安全技术交底表 +CREATE TABLE [dbo].[HSSE_SafetyDisclosure] ( + [DisclosureId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL, + [ProjectId] nvarchar(50) COLLATE Chinese_PRC_CI_AS NOT NULL, + [HazardProjectName] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL, + [DisclosureName] nvarchar(200) COLLATE Chinese_PRC_CI_AS NULL, + [DisclosureMan] nvarchar(50) COLLATE Chinese_PRC_CI_AS NULL, + [DisclosureDate] datetime NULL, + [UploadFile] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL, + [Remark] nvarchar(500) COLLATE Chinese_PRC_CI_AS NULL, + CONSTRAINT [PK_HSSE_SafetyDisclosure] PRIMARY KEY CLUSTERED ([DisclosureId]) +) ON [PRIMARY] +GO + +ALTER TABLE [dbo].[HSSE_SafetyDisclosure] SET (LOCK_ESCALATION = TABLE) +GO + +EXEC sp_addextendedproperty +'MS_Description', N'安全技术交底', +'SCHEMA', N'dbo', +'TABLE', N'HSSE_SafetyDisclosure' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'主键', +'SCHEMA', N'dbo', +'TABLE', N'HSSE_SafetyDisclosure', +'COLUMN', N'DisclosureId' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'项目', +'SCHEMA', N'dbo', +'TABLE', N'HSSE_SafetyDisclosure', +'COLUMN', N'ProjectId' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'工程名称', +'SCHEMA', N'dbo', +'TABLE', N'HSSE_SafetyDisclosure', +'COLUMN', N'HazardProjectName' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'交底名称', +'SCHEMA', N'dbo', +'TABLE', N'HSSE_SafetyDisclosure', +'COLUMN', N'DisclosureName' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'交底人', +'SCHEMA', N'dbo', +'TABLE', N'HSSE_SafetyDisclosure', +'COLUMN', N'DisclosureMan' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'交底日期', +'SCHEMA', N'dbo', +'TABLE', N'HSSE_SafetyDisclosure', +'COLUMN', N'DisclosureDate' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'附件', +'SCHEMA', N'dbo', +'TABLE', N'HSSE_SafetyDisclosure', +'COLUMN', N'UploadFile' +GO + +EXEC sp_addextendedproperty +'MS_Description', N'备注', +'SCHEMA', N'dbo', +'TABLE', N'HSSE_SafetyDisclosure', +'COLUMN', N'Remark' +GO diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index e134970..f08afe5 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -77,33 +77,6 @@ ..\packages\Microsoft.Office.Interop.Word.15.0.4797.1004\lib\net20\Microsoft.Office.Interop.Word.dll False - - ..\packages\SQLServer.SMO.2016.13.0.0.2\lib\net462\Microsoft.SqlServer.ConnectionInfo.dll - - - ..\packages\SQLServer.SMO.2016.13.0.0.2\lib\net462\Microsoft.SqlServer.Diagnostics.STrace.dll - - - ..\packages\SQLServer.SMO.2016.13.0.0.2\lib\net462\Microsoft.SqlServer.IntegrationServices.Common.ObjectModel.dll - - - ..\packages\SQLServer.SMO.2016.13.0.0.2\lib\net462\Microsoft.SqlServer.ManagedDTS.dll - - - ..\packages\SQLServer.SMO.2016.13.0.0.2\lib\net462\Microsoft.SqlServer.Management.IntegrationServices.dll - - - ..\packages\SQLServer.SMO.2016.13.0.0.2\lib\net462\Microsoft.SqlServer.Management.IntegrationServicesEnum.dll - - - ..\packages\SQLServer.SMO.2016.13.0.0.2\lib\net462\Microsoft.SqlServer.Management.Sdk.Sfc.dll - - - ..\packages\SQLServer.SMO.2016.13.0.0.2\lib\net462\Microsoft.SqlServer.Smo.dll - - - ..\packages\SQLServer.SMO.2016.13.0.0.2\lib\net462\Microsoft.SqlServer.SqlClrProvider.dll - ..\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll @@ -595,6 +568,9 @@ + + + diff --git a/SGGL/BLL/HSSE/Hazard/SafetyDisclosureService.cs b/SGGL/BLL/HSSE/Hazard/SafetyDisclosureService.cs new file mode 100644 index 0000000..47c209c --- /dev/null +++ b/SGGL/BLL/HSSE/Hazard/SafetyDisclosureService.cs @@ -0,0 +1,93 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace BLL +{ + /// + /// 安全技术交底服务 + /// + public static class SafetyDisclosureService + { + /// + /// 获取安全技术交底列表 + /// + /// 项目主键 + /// + public static List GetList(string projectId) + { + return Funs.DB.HSSE_SafetyDisclosure.Where(x => x.ProjectId == projectId).ToList(); + } + + /// + /// 根据主键获取安全技术交底 + /// + /// 主键 + /// + public static Model.HSSE_SafetyDisclosure GetById(string disclosureId) + { + return Funs.DB.HSSE_SafetyDisclosure.FirstOrDefault(x => x.DisclosureId == disclosureId); + } + + /// + /// 新增安全技术交底 + /// + /// 实体 + public static void Add(Model.HSSE_SafetyDisclosure item) + { + Model.SGGLDB db = Funs.DB; + Model.HSSE_SafetyDisclosure newItem = new Model.HSSE_SafetyDisclosure + { + DisclosureId = item.DisclosureId, + ProjectId = item.ProjectId, + HazardProjectName = item.HazardProjectName, + DisclosureName = item.DisclosureName, + DisclosureMan = item.DisclosureMan, + DisclosureDate = item.DisclosureDate, + UploadFile = item.UploadFile, + Remark = item.Remark + }; + db.HSSE_SafetyDisclosure.InsertOnSubmit(newItem); + db.SubmitChanges(); + } + + /// + /// 更新安全技术交底 + /// + /// 实体 + public static void Update(Model.HSSE_SafetyDisclosure item) + { + Model.SGGLDB db = Funs.DB; + Model.HSSE_SafetyDisclosure newItem = db.HSSE_SafetyDisclosure.FirstOrDefault(x => x.DisclosureId == item.DisclosureId); + if (newItem != null) + { + newItem.HazardProjectName = item.HazardProjectName; + newItem.DisclosureName = item.DisclosureName; + newItem.DisclosureMan = item.DisclosureMan; + newItem.DisclosureDate = item.DisclosureDate; + newItem.UploadFile = item.UploadFile; + newItem.Remark = item.Remark; + db.SubmitChanges(); + } + else + { + Add(item); + } + } + + /// + /// 删除安全技术交底 + /// + /// 主键 + public static void Delete(string disclosureId) + { + Model.SGGLDB db = Funs.DB; + Model.HSSE_SafetyDisclosure item = db.HSSE_SafetyDisclosure.FirstOrDefault(x => x.DisclosureId == disclosureId); + if (item != null) + { + db.HSSE_SafetyDisclosure.DeleteOnSubmit(item); + db.SubmitChanges(); + } + } + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx new file mode 100644 index 0000000..4e347f3 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx @@ -0,0 +1,116 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyDisclosure.aspx.cs" Inherits="FineUIPro.Web.HSSE.HazardousMG.SafetyDisclosure" %> + + + + + + + 安全技术交底 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx.cs b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx.cs new file mode 100644 index 0000000..aa0c9fe --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx.cs @@ -0,0 +1,172 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace FineUIPro.Web.HSSE.HazardousMG +{ + /// + /// 安全技术交底页面 + /// + public partial class SafetyDisclosure : PageBase + { + #region 加载 + /// + /// 加载页面 + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString(); + this.BindGrid(); + } + } + + /// + /// 新增按钮事件 + /// + protected void btnNew_Click(object sender, EventArgs e) + { + if (this.CurrUser == null || string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + Alert.ShowInTop("请先选择项目!", MessageBoxIcon.Warning); + return; + } + PageContext.RegisterStartupScript(Window1.GetShowReference("SafetyDisclosureEdit.aspx")); + } + #endregion + + #region 数据绑定 + /// + /// 绑定数据 + /// + private void BindGrid() + { + if (this.CurrUser == null || string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + Alert.ShowInTop("请先登录或选择项目!", MessageBoxIcon.Warning); + return; + } + List list = BLL.SafetyDisclosureService.GetList(this.CurrUser.LoginProjectId); + ////查询条件过滤 + string projectName = this.txtProjectName.Text.Trim(); + if (!string.IsNullOrEmpty(projectName)) + { + list = list.Where(x => x.HazardProjectName.Contains(projectName)).ToList(); + } + Grid1.RecordCount = list.Count; + var table = this.GetPagedDataTable(Grid1, list); + Grid1.DataSource = table; + Grid1.DataBind(); + } + + /// + /// 分页事件 + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + this.BindGrid(); + } + + /// + /// 每页记录数改变事件 + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue); + this.BindGrid(); + } + + /// + /// 排序事件 + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 查询 + /// + /// 查询 + /// + protected void TextBox_TextChanged(object sender, EventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 编辑 + /// + /// 双击行编辑事件 + /// + protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + { + this.EditData(); + } + + /// + /// 右键菜单编辑事件 + /// + protected void btnMenuEdit_Click(object sender, EventArgs e) + { + this.EditData(); + } + + /// + /// 编辑数据方法 + /// + private void EditData() + { + if (Grid1.SelectedRowIndexArray.Length == 0) + { + Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning); + return; + } + string id = Grid1.SelectedRowID; + PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("SafetyDisclosureEdit.aspx?DisclosureId={0}", id))); + } + #endregion + + #region 删除 + /// + /// 右键菜单删除事件 + /// + protected void btnMenuDelete_Click(object sender, EventArgs e) + { + if (Grid1.SelectedRowIndexArray.Length > 0) + { + foreach (int rowIndex in Grid1.SelectedRowIndexArray) + { + string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + BLL.SafetyDisclosureService.Delete(rowID); + } + this.BindGrid(); + ShowNotify("删除数据成功!", MessageBoxIcon.Success); + } + } + + /// + /// 编辑窗口关闭事件 + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + this.BindGrid(); + } + #endregion + + #region 附件查看 + /// + /// 附件查看(参考专项施工方案,弹出附件列表窗口) + /// + protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + { + if (e.CommandName == "attchUrl") + { + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type={0}&toKeyId={1}&path=FileUpload/SafetyDisclosure&menuId={2}", + -1, e.RowID, BLL.Const.ProjectHSETechnicalMenuId))); + } + } + #endregion + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx.designer.cs new file mode 100644 index 0000000..9590982 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosure.aspx.designer.cs @@ -0,0 +1,170 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.HazardousMG +{ + + + public partial class SafetyDisclosure + { + + /// + /// 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; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// txtProjectName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtProjectName; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnNew 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnNew; + + /// + /// lblNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.WebControls.Label lblNumber; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + + /// + /// Menu1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Menu Menu1; + + /// + /// btnMenuEdit 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuEdit; + + /// + /// btnMenuDelete 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.MenuButton btnMenuDelete; + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx new file mode 100644 index 0000000..f922fe7 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx @@ -0,0 +1,78 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SafetyDisclosureEdit.aspx.cs" Inherits="FineUIPro.Web.HSSE.HazardousMG.SafetyDisclosureEdit" %> + + + + + + + 编辑安全技术交底 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx.cs b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx.cs new file mode 100644 index 0000000..ecd1ab4 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx.cs @@ -0,0 +1,110 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +namespace FineUIPro.Web.HSSE.HazardousMG +{ + /// + /// 编辑安全技术交底页面 + /// + public partial class SafetyDisclosureEdit : PageBase + { + #region 定义项 + /// + /// 主键 + /// + private string DisclosureId + { + get + { + return (string)ViewState["DisclosureId"]; + } + set + { + ViewState["DisclosureId"] = value; + } + } + #endregion + + #region 加载 + /// + /// 加载页面 + /// + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); + this.DisclosureId = Request.Params["DisclosureId"]; + if (!string.IsNullOrEmpty(this.DisclosureId)) + { + ////编辑:回填数据 + Model.HSSE_SafetyDisclosure info = BLL.SafetyDisclosureService.GetById(this.DisclosureId); + if (info != null) + { + this.txtHazardProjectName.Text = info.HazardProjectName; + this.txtDisclosureName.Text = info.DisclosureName; + this.txtDisclosureMan.Text = info.DisclosureMan; + if (info.DisclosureDate.HasValue) + { + this.dpDisclosureDate.SelectedDate = info.DisclosureDate.Value; + } + this.txtRemark.Text = info.Remark; + } + } + } + } + #endregion + + #region 保存 + /// + /// 保存按钮事件 + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (this.CurrUser == null || string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + { + Alert.ShowInTop("请先选择项目!", MessageBoxIcon.Warning); + return; + } + ////新增时先生成主键,保证附件能挂到同一记录 + if (string.IsNullOrEmpty(this.DisclosureId)) + { + this.DisclosureId = Guid.NewGuid().ToString(); + } + ////校验附件是否已上传 + Model.AttachFile attach = BLL.Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == this.DisclosureId); + if (attach == null || string.IsNullOrEmpty(attach.AttachUrl)) + { + Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning); + return; + } + Model.HSSE_SafetyDisclosure info = new Model.HSSE_SafetyDisclosure + { + DisclosureId = this.DisclosureId, + ProjectId = this.CurrUser.LoginProjectId, + HazardProjectName = this.txtHazardProjectName.Text.Trim(), + DisclosureName = this.txtDisclosureName.Text.Trim(), + DisclosureMan = this.txtDisclosureMan.Text.Trim(), + DisclosureDate = this.dpDisclosureDate.SelectedDate, + Remark = this.txtRemark.Text.Trim() + }; + ////存在则更新,不存在则新增(服务层已处理) + BLL.SafetyDisclosureService.Update(info); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + + /// + /// 上传附件(参考专项施工方案) + /// + protected void btnAttach_Click(object sender, EventArgs e) + { + if (string.IsNullOrEmpty(this.DisclosureId)) + { + this.DisclosureId = Guid.NewGuid().ToString(); + } + PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/SafetyDisclosure&menuId={1}", this.DisclosureId, BLL.Const.ProjectHSETechnicalMenuId))); + } + #endregion + } +} diff --git a/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx.designer.cs new file mode 100644 index 0000000..7e51430 --- /dev/null +++ b/SGGL/FineUIPro.Web/HSSE/HazardousMG/SafetyDisclosureEdit.aspx.designer.cs @@ -0,0 +1,161 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.HSSE.HazardousMG +{ + + + public partial class SafetyDisclosureEdit + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtHazardProjectName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtHazardProjectName; + + /// + /// txtDisclosureName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDisclosureName; + + /// + /// txtDisclosureMan 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDisclosureMan; + + /// + /// dpDisclosureDate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DatePicker dpDisclosureDate; + + /// + /// Panel2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel2; + + /// + /// Label1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label Label1; + + /// + /// btnAttach 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnAttach; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtRemark; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// btnClose 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnClose; + + /// + /// WindowAtt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window WindowAtt; + } +}