This commit is contained in:
2025-04-07 17:43:30 +08:00
commit 8a2c192129
12175 changed files with 2742596 additions and 0 deletions
@@ -0,0 +1,16 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CheckSpecial.aspx.cs" Inherits="FineUIPro.Web.ThreeYearAction.HazardousChemicals.CheckSpecial" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>专项整治</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class CheckSpecial : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class CheckSpecial
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
}
}
@@ -0,0 +1,16 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ExpertPersonnelInfo.aspx.cs" Inherits="FineUIPro.Web.ThreeYearAction.HazardousChemicals.ExpertPersonnelInfo" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>专家库管理</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class ExpertPersonnelInfo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class ExpertPersonnelInfo
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
}
}
@@ -0,0 +1,16 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HazardInfo.aspx.cs" Inherits="FineUIPro.Web.ThreeYearAction.HazardousChemicals.HazardInfo" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>风险分级管控</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class HazardInfo : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class HazardInfo
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
}
}
@@ -0,0 +1,16 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="HiddenRectificationList.aspx.cs" Inherits="FineUIPro.Web.ThreeYearAction.HazardousChemicals.HiddenRectificationList" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>隐患排查治理</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class HiddenRectificationList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class HiddenRectificationList
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
}
}
@@ -0,0 +1,16 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="MajorHazardSources.aspx.cs" Inherits="FineUIPro.Web.ThreeYearAction.HazardousChemicals.MajorHazardSources" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>重大危险源管理</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class MajorHazardSources : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class MajorHazardSources
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
}
}
@@ -0,0 +1,272 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ManageRule.aspx.cs" Inherits="FineUIPro.Web.ThreeYearAction.HazardousChemicals.ManageRule" %>
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>危化品制度体系管理</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
EnableCollapse="true" Width="380" Title="公司-项目" TitleToolTip="公司-项目" ShowBorder="true"
ShowHeader="true" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Fit">
<Items>
<f:ContentPanel ID="ContentPanel1" runat="server" ShowHeader="false" EnableCollapse="true" AutoScroll="true"
BodyPadding="0px">
<uc1:UnitProjectTControl ID="ucTree" runat="server" Onchange="changeTree" />
</f:ContentPanel>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" AutoScroll="true">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="危化品制度体系管理" EnableCollapse="true"
runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="Id"
AllowCellEditing="true" ClicksToEdit="2" DataIDField="Id" AllowSorting="true"
SortField="Code" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
IsDatabasePaging="False" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:CheckBoxList runat="server" ID="cbIssue" ShowLabel="false" Width="150px" LabelAlign="Right">
<f:CheckItem Text="未发布" Value="0" Selected="true" />
<f:CheckItem Text="已发布" Value="1" />
</f:CheckBoxList>
<f:TextBox runat="server" Label="编号" ID="txtCode" EmptyText="输入查询条件"
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
LabelAlign="right">
</f:TextBox>
<f:TextBox runat="server" Label="名称" ID="txtName" EmptyText="输入查询条件"
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
LabelAlign="right">
</f:TextBox>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true" OnClick="TextBox_TextChanged" Text="查询" runat="server">
</f:Button>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" OnClick="btnNew_Click" Hidden="true" Text="新增"
runat="server">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="50px" HeaderTextAlign="Center"
TextAlign="Center" />
<f:RenderField Width="120px" ColumnID="Code" DataField="Code"
SortField="Code" FieldType="String" HeaderText="编号" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField MinWidth="400px" ColumnID="Name" DataField="Name"
SortField="Name" FieldType="String" HeaderText="名称" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="IssueDate" DataField="IssueDate" SortField="IssueDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="发布时间"
HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="CompileManName" DataField="CompileManName"
SortField="CompileManName" FieldType="String" HeaderText="填报人" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="CompileDate" DataField="CompileDate"
SortField="CompileDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd"
HeaderText="填报时间" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:WindowField TextAlign="Left" Width="120px" WindowID="WindowAtt" Text="附件" ToolTip="附件上传查看"
DataIFrameUrlFields="Id" DataIFrameUrlFormatString="../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/HazardousChemicalsManageRuleAttachUrl&menuId=7EABF246-3567-45FC-9C70-85395B6ADF11"
HeaderTextAlign="Center">
</f:WindowField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
<f:ListItem Text="所有行" Value="100000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="危化品制度体系管理" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="true" runat="server" IsModal="true" Width="1024px" Height="620px">
</f:Window>
<f:Window ID="WindowAtt" Title="附件页面" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="true" runat="server" IsModal="true" Width="700px" Height="500px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" Icon="TableEdit" EnablePostBack="true"
Hidden="true" runat="server" Text="编辑">
</f:MenuButton>
<f:MenuButton ID="btnMenuIssuance" Icon="BookNext" OnClick="btnMenuIssuance_Click"
EnablePostBack="true" Hidden="true" runat="server" Text="发布">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
Hidden="true" Icon="Delete" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false,来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
<%--<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
EnableCollapse="true" Width="380" Title="公司-项目" TitleToolTip="公司-项目" ShowBorder="true"
ShowHeader="true" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft" Layout="Fit">
<Items>
<f:ContentPanel ID="ContentPanel1" runat="server" ShowHeader="false" EnableCollapse="true" AutoScroll="true"
BodyPadding="0px">
<uc1:UnitProjectTControl ID="ucTree" runat="server" Onchange="changeTree" />
</f:ContentPanel>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" AutoScroll="true">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="公司安全管理制度发布" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="ManagerRuleId" DataIDField="ManagerRuleId" AllowSorting="true" SortField="IssueDate,CompileDate" SortDirection="DESC" EnableColumnLines="true"
OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="10" ForceFit="true"
OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:CheckBoxList runat="server" ID="cbIssue" ShowLabel="false" Width="150px" LabelAlign="Right">
<f:CheckItem Text="未发布" Value="0" Selected="true" />
<f:CheckItem Text="已发布" Value="1" />
</f:CheckBoxList>
<f:TextBox runat="server" Label="编号" ID="txtCode" EmptyText="输入查询条件"
Width="210px" LabelWidth="60px"
LabelAlign="right">
</f:TextBox>
<f:TextBox runat="server" Label="名称" ID="txtName" EmptyText="输入查询条件"
Width="210px" LabelWidth="60px"
LabelAlign="right">
</f:TextBox>
<f:ToolbarFill runat="server">
</f:ToolbarFill>
<f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true" OnClick="TextBox_TextChanged" Text="查询" runat="server">
</f:Button>
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" Hidden="true" runat="server" OnClick="btnCompile_Click" Text="新增">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp" Text="导出"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField MinWidth="100px" ColumnID="Code" DataField="Code"
SortField="Code" FieldType="String" HeaderText="文件编号" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField MinWidth="80px" ColumnID="Name" DataField="Name"
SortField="Name" FieldType="String" HeaderText="文件名称" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="IssueDate" DataField="IssueDate" SortField="IssueDate"
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="发布时间"
HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="CompileManName" DataField="CompileManName"
SortField="CompileManName" FieldType="String" HeaderText="填报人" HeaderTextAlign="Center"
TextAlign="Left">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="CompileDate" DataField="CompileDate"
SortField="CompileDate" FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd"
HeaderText="填报时间" HeaderTextAlign="Center" TextAlign="Center">
</f:RenderField>
<f:WindowField TextAlign="Left" Width="60px" WindowID="WindowAtt" Text="附件" ToolTip="附件上传查看"
DataIFrameUrlFields="Id" DataIFrameUrlFormatString="../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/HazardousChemicalsManageRuleAttachUrl&menuId=7EABF246-3567-45FC-9C70-85395B6ADF11"
HeaderTextAlign="Center">
</f:WindowField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="管理规定选择" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="1100px"
OnClose="Window1_Close" Height="500px">
</f:Window>
<f:Window ID="Window2" Title="管理规定编辑" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
Width="1024px" Height="550px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
runat="server" Text="编辑" Icon="Pencil" Hidden="true">
</f:MenuButton>
<f:MenuButton ID="btnMenuIssuance" Icon="BookNext" OnClick="btnMenuIssuance_Click"
EnablePostBack="true" Hidden="true" runat="server" Text="发布">
</f:MenuButton>
<f:MenuButton ID="btnMenuDelete" Icon="Delete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false,来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>--%>
</html>
@@ -0,0 +1,516 @@
using BLL;
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;
using System.Xml.Linq;
//using static System.Runtime.CompilerServices.RuntimeHelpers;
using AspNet = System.Web.UI.WebControls;
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class ManageRule : PageBase
{
#region 项目主键
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
/// <summary>
/// 页面
/// </summary>
public int? PageSize
{
get
{
return (int?)ViewState["PageSize"];
}
set
{
ViewState["PageSize"] = value;
}
}
#region 加载页面
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
Funs.DropDownPageSize(this.ddlPageSize);
if (this.CurrUser == null)
{
this.Session["CurrUser"] = UserService.GetUserByUserId(Const.hfnbdId);
}
this.ProjectId = this.CurrUser.LoginProjectId;
if (!string.IsNullOrEmpty(Request.Params["projectId"]) && Request.Params["projectId"] != this.CurrUser.LoginProjectId)
{
this.ProjectId = Request.Params["projectId"];
}
////权限按钮方法
this.ucTree.UnitId = this.CurrUser.UnitId;
this.ucTree.ProjectId = this.ProjectId;
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
this.panelLeftRegion.Hidden = true;
////权限按钮方法
this.GetButtonPower();
}
//this.btnCompile.OnClientClick = Window1.GetShowReference("ManageRuleEdit.aspx") + "return false;";
// 绑定表格
this.BindGrid();
//Funs.DropDownPageSize(this.ddlPageSize);
//this.GetButtonPower();
//this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!");
//this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的&nbsp;<b><script>{0}</script></b>&nbsp;行数据吗?", Grid1.GetSelectedCountReference());
//// 绑定表格
//BindGrid();
}
}
protected void changeTree(object sender, EventArgs e)
{
this.ProjectId = this.ucTree.ProjectId;
this.BindGrid();
this.GetButtonPower();
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
{
btnNew.Hidden = true;
}
}
/// <summary>
/// 加载数据
/// </summary>
private void BindGrid()
{
if (string.IsNullOrEmpty(this.ProjectId))
{
return;
}
var db = Funs.DB;
string strSql = @"SELECT ManagerRule.Id,ManagerRule.ProjectId,Code,
ManagerRule.Name,
ManagerRule.CompileMan,
ManagerRule.CompileDate,
ManagerRule.IsIssue,
ManagerRule.IssueDate,
Users.UserName as CompileManName
FROM HazardousChemicals_ManageRule AS ManagerRule
LEFT JOIN Sys_User AS Users ON Users.UserId = ManagerRule.CompileMan
WHERE 1 =1 ";
List<SqlParameter> listStr = new List<SqlParameter>();
strSql += " AND ManagerRule.ProjectId = @ProjectId";
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
if (!string.IsNullOrEmpty(this.txtCode.Text.Trim()))
{
strSql += " AND Code LIKE @Code";
listStr.Add(new SqlParameter("@Code", "%" + this.txtCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtName.Text.Trim()))
{
strSql += " AND Name LIKE @Name";
listStr.Add(new SqlParameter("@Name", "%" + this.txtName.Text.Trim() + "%"));
}
if (this.cbIssue.SelectedValueArray.Length == 1)
{
///是否发布
string selectValue = String.Join(", ", this.cbIssue.SelectedValueArray);
if (selectValue == "1")
{
strSql += " AND ManagerRule.IsIssue = 1 ";
}
else
{
strSql += " AND (ManagerRule.IsIssue = 0 OR ManagerRule.IsIssue IS NULL) ";
}
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
#region 排序、分页
/// <summary>
/// 分页
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
Grid1.PageIndex = e.NewPageIndex;
BindGrid();
}
/// <summary>
/// 分页显示条数下拉框
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
{
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
BindGrid();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
#endregion
#region 删除
/// <summary>
/// 右键删除事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDelete_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var getV = BLL.HazardousChemicalsManageRuleService.GetById(rowID);
if (getV != null)
{
BLL.LogService.AddSys_Log(this.CurrUser, getV.Code, rowID, BLL.Const.HazardousChemicalsManageRuleMenuId, BLL.Const.BtnDelete);
BLL.HazardousChemicalsManageRuleService.DeleteById(rowID);
}
}
this.BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
}
}
#endregion
#region 编辑
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.EditData();
}
/// <summary>
/// 右键编辑事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuEdit_Click(object sender, EventArgs e)
{
this.EditData();
}
/// <summary>
/// 编辑数据方法
/// </summary>
private void EditData()
{
this.PageSize = this.Grid1.PageIndex;
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
return;
}
string id = Grid1.SelectedRowID;
var model = BLL.HazardousChemicalsManageRuleService.GetById(id);
if (model != null)
{
if (this.btnMenuEdit.Hidden) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面
{
Alert.ShowInTop("没有权限编辑页面!", MessageBoxIcon.Warning);
}
else
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ManageRuleEdit.aspx?FileId={0}", id, "编辑 - ")));
}
}
//if (model != null)
//{
// if (this.btnMenuEdit.Hidden || model.State == BLL.Const.State_2) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面
// {
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("ManageRuleView.aspx?Id={0}", id, "查看 - ")));
// }
// else
// {
// PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("ManageRuleEdit.aspx?Id={0}", id, "编辑 - ")));
// }
//}
}
#endregion
#region 关闭弹出窗
/// <summary>
/// 关闭弹出窗
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#endregion
#region 新增编辑
/// <summary>
/// 新增编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ManageRuleEdit.aspx", "编辑 - ")));
}
#endregion
#region 发布
/// <summary>
/// 发布
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuIssuance_Click(object sender, EventArgs e)
{
string strShowNotify = string.Empty;
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string id = Grid1.DataKeys[rowIndex][0].ToString();
Model.HazardousChemicals_ManageRule model = BLL.HazardousChemicalsManageRuleService.GetById(id);
if (model != null)
{
model.IsIssue = true;
model.IssueDate = DateTime.Now;
BLL.HazardousChemicalsManageRuleService.Update(model);
//if (model.State == BLL.Const.State_2)
//{
// List<Model.HazardousChemicals_ManageRule> issuanceManagerRules = BLL.HazardousChemicalsManageRuleService.GetIsIssueManagerRulesByName(model.ManageRuleName);
// if (issuanceManagerRules.Count == 0) //无对应版本的管理规定
// {
// model.VersionNo = "V1.0";
// model.IsIssue = true;
// model.IssueDate = DateTime.Now;
// BLL.ActionPlan_ProjectManagerRuleService.UpdateManageRule(model);
// }
// else //存在对应版本的管理规定
// {
// string maxVersionNo = issuanceManagerRules[issuanceManagerRules.Count - 1].VersionNo;
// model.VersionNo = "V" + (Convert.ToInt32(maxVersionNo.Substring(1, maxVersionNo.LastIndexOf(".") - 1)) + 1) + ".0";
// model.IsIssue = true;
// model.IssueDate = DateTime.Now;
// BLL.ActionPlan_ProjectManagerRuleService.UpdateManageRule(model);
// }
//}
//else
//{
// strShowNotify += "危化品制度:" + model.ManageRuleName + ";";
//}
}
}
}
this.BindGrid();
if (!string.IsNullOrEmpty(strShowNotify))
{
Alert.ShowInTop(strShowNotify + "尚未审批完成,无法发布!", MessageBoxIcon.Warning);
}
else
{
ShowNotify("发布成功!", MessageBoxIcon.Success);
}
}
#endregion
#region 获取权限按钮
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.HazardousChemicalsManageRuleMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnAdd))
{
this.btnNew.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnModify))
{
this.btnMenuEdit.Hidden = false;
}
//if (buttonList.Contains(BLL.Const.BtnAuditing))
//{
// this.btnMenuAudit.Hidden = false;
//}
if (buttonList.Contains(BLL.Const.BtnIssuance))
{
this.btnMenuIssuance.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDelete.Hidden = false;
}
}
}
#endregion
#region 查询
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void TextBox_TextChanged(object sender, EventArgs e)
{
this.BindGrid();
if (this.PageSize.HasValue)
{
this.ddlPageSize.SelectedValue = this.PageSize.ToString();
}
BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, string.Empty, BLL.Const.HazardousChemicalsManageRuleMenuId, Const.BtnQuery);
}
#endregion
#region 导出按钮
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("危化品制度" + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
this.Grid1.PageSize = 500;
BindGrid();
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
#pragma warning disable CS0108 // “ManagerRule.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
/// <summary>
/// 导出方法
/// </summary>
/// <param name="grid"></param>
/// <returns></returns>
private string GetGridTableHtml(Grid grid)
#pragma warning restore CS0108 // “ManagerRule.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
{
StringBuilder sb = new StringBuilder();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
}
sb.Append("</tr>");
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
string html = row.Values[column.ColumnIndex].ToString();
if (column.ColumnID == "tfNumber")
{
html = (row.FindControl("labNumber") as AspNet.Label).Text;
}
if (column.ColumnID == "tfManageRuleCode")
{
html = (row.FindControl("lblManageRuleCode") as AspNet.Label).Text;
}
if (column.ColumnID == "tfOldManageRuleCode")
{
html = (row.FindControl("lblOldManageRuleCode") as AspNet.Label).Text;
}
if (column.ColumnID == "tfManageRuleName")
{
html = (row.FindControl("lblManageRuleName") as AspNet.Label).Text;
}
if (column.ColumnID == "tfManageRuleTypeName")
{
html = (row.FindControl("lblManageRuleTypeName") as AspNet.Label).Text;
}
if (column.ColumnID == "tfShortRemark")
{
html = (row.FindControl("lblRemark") as AspNet.Label).Text;
}
if (column.ColumnID == "tfState")
{
html = (row.FindControl("lblState") as AspNet.Label).Text;
}
sb.AppendFormat("<td x:str >{0}</td>", html);
}
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}
#endregion
}
}
@@ -0,0 +1,233 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class ManageRule
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelLeftRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// ContentPanel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ContentPanel ContentPanel1;
/// <summary>
/// ucTree 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// cbIssue 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBoxList cbIssue;
/// <summary>
/// txtCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCode;
/// <summary>
/// txtName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtName;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnQuery 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnQuery;
/// <summary>
/// btnNew 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuIssuance 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuIssuance;
/// <summary>
/// btnMenuDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDelete;
}
}
@@ -0,0 +1,66 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ManageRuleEdit.aspx.cs" Inherits="FineUIPro.Web.ThreeYearAction.HazardousChemicals.ManageRuleEdit" ValidateRequest="false" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>编辑危化品制度管理</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="SimpleForm1" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" Title="危化品制度管理" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:TextBox ID="txtCode" runat="server" Label="编号" LabelAlign="Right"
MaxLength="50" Readonly="true">
</f:TextBox>
<f:TextBox ID="txtName" runat="server" Label="名称" Required="true" ShowRedStar="true"
LabelAlign="Right" MaxLength="200" FocusOnPageLoad="true">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:HtmlEditor runat="server" Label="内容" ID="txtFileContent" ShowLabel="false"
Editor="UMEditor" BasePath="~/res/umeditor/" ToolbarSet="Full" Height="240px" LabelAlign="Right">
</f:HtmlEditor>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpCompileMan" runat="server" Label="填报人" Required="true" ShowRedStar="true" EnableEdit="true" LabelAlign="Right">
</f:DropDownList>
<f:DatePicker ID="txtCompileDate" runat="server" Label="填报时间" LabelAlign="Right"
EnableEdit="true">
</f:DatePicker>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Button ID="btnAttachUrl" Text="附件" ToolTip="附件上传及查看" Icon="TableCell" runat="server"
OnClick="btnAttachUrl_Click" ValidateForms="SimpleForm1" MarginLeft="5px">
</f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1" Text="保存"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose" Text="关闭">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="true" runat="server" IsModal="true" Width="700px"
Height="500px">
</f:Window>
</form>
</body>
</html>
@@ -0,0 +1,168 @@
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.ThreeYearAction.HazardousChemicals
{
public partial class ManageRuleEdit : PageBase
{
#region 定义项
/// <summary>
/// 主键
/// </summary>
public string Id
{
get
{
return (string)ViewState["Id"];
}
set
{
ViewState["Id"] = value;
}
}
/// <summary>
/// 项目主键
/// </summary>
public string ProjectId
{
get
{
return (string)ViewState["ProjectId"];
}
set
{
ViewState["ProjectId"] = value;
}
}
#endregion
#region 加载
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ProjectId = this.CurrUser.LoginProjectId;
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
this.InitDropDownList();
this.Id = Request.Params["FileId"];
if (!string.IsNullOrEmpty(this.Id))
{
Model.HazardousChemicals_ManageRule model = BLL.HazardousChemicalsManageRuleService.GetById(this.Id);
if (model != null)
{
this.ProjectId = model.ProjectId;
if (this.ProjectId != this.CurrUser.LoginProjectId)
{
this.InitDropDownList();
}
///读取编号
this.txtCode.Text = model.Code;
this.txtName.Text = model.Name;
if (!string.IsNullOrEmpty(model.CompileMan))
{
this.drpCompileMan.SelectedValue = model.CompileMan;
}
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", model.CompileDate);
this.txtFileContent.Text = HttpUtility.HtmlDecode(model.Content);
}
}
else
{
this.drpCompileMan.SelectedValue = this.CurrUser.UserId;
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
////自动生成编码
this.txtCode.Text = SQLHelper.RunProcNewId2("SpGetNewCode3ByProjectId", "dbo.HazardousChemicals_ManageRule", "Code", CurrUser.LoginProjectId);
this.txtName.Text = this.SimpleForm1.Title;
}
}
}
/// <summary>
/// 初始化下拉框
/// </summary>
private void InitDropDownList()
{
BLL.UserService.InitUserDropDownList(this.drpCompileMan, this.ProjectId, false);
}
#endregion
#region 保存
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
this.SaveData(BLL.Const.BtnSave);
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
}
/// <summary>
/// 保存数据
/// </summary>
/// <param name="type"></param>
private void SaveData(string type)
{
Model.HazardousChemicals_ManageRule model = new Model.HazardousChemicals_ManageRule
{
ProjectId = this.ProjectId,
Code = this.txtCode.Text.Trim(),
Name = this.txtName.Text.Trim(),
//IsIssue = false
};
if (this.drpCompileMan.SelectedValue != BLL.Const._Null)
{
model.CompileMan = this.drpCompileMan.SelectedValue;
}
model.CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim());
model.Content = HttpUtility.HtmlEncode(this.txtFileContent.Text);
////单据状态
if (!string.IsNullOrEmpty(this.Id))
{
model.Id = this.Id;
var oldModel = BLL.HazardousChemicalsManageRuleService.GetById(this.Id);
model.IsIssue = oldModel.IsIssue;
model.IssueDate = oldModel.IssueDate;
BLL.HazardousChemicalsManageRuleService.Update(model);
BLL.LogService.AddSys_Log(this.CurrUser, model.Code, model.Id, BLL.Const.HazardousChemicalsManageRuleMenuId, BLL.Const.BtnModify);
}
else
{
this.Id = SQLHelper.GetNewID(typeof(Model.HazardousChemicals_ManageRule));
model.Id = this.Id;
model.IsIssue = false;
BLL.HazardousChemicalsManageRuleService.Add(model);
BLL.LogService.AddSys_Log(this.CurrUser, model.Code, model.Id, BLL.Const.HazardousChemicalsManageRuleMenuId, BLL.Const.BtnAdd);
}
}
#endregion
#region 附件上传
/// <summary>
/// 上传附件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAttachUrl_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.Id))
{
SaveData(BLL.Const.BtnSave);
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/HazardousChemicalsManageRuleAttachUrl&menuId={1}", Id, BLL.Const.HazardousChemicalsManageRuleMenuId)));
}
#endregion
}
}
@@ -0,0 +1,134 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class ManageRuleEdit
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtCode;
/// <summary>
/// txtName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtName;
/// <summary>
/// txtFileContent 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HtmlEditor txtFileContent;
/// <summary>
/// drpCompileMan 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpCompileMan;
/// <summary>
/// txtCompileDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtCompileDate;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// btnAttachUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAttachUrl;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
/// <summary>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
}
}
@@ -0,0 +1,16 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrainRecord.aspx.cs" Inherits="FineUIPro.Web.ThreeYearAction.HazardousChemicals.TrainRecord" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>安全培训</title>
</head>
<body>
<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class TrainRecord : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
}
}
@@ -0,0 +1,26 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.ThreeYearAction.HazardousChemicals
{
public partial class TrainRecord
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
}
}