提交定制会内容
This commit is contained in:
@@ -0,0 +1,150 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Rectify.aspx.cs" Inherits="FineUIPro.Web.CQMS.Technique.Rectify" %>
|
||||
|
||||
<!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="250" Title="质量隐患" TitleToolTip="质量隐患" ShowBorder="true"
|
||||
ShowHeader="false" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft">
|
||||
<Items>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
|
||||
<Items>
|
||||
<f:Button ID="btnNew" Icon="Add" runat="server" Hidden="true" OnClick="btnNew_Click" Text="新增">
|
||||
</f:Button>
|
||||
<f:Button ID="btnEdit" Icon="Pencil" runat="server" Hidden="true" OnClick="btnEdit_Click" Text="编辑">
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" Icon="Delete" Hidden="true" ConfirmText="确定删除当前数据?" OnClick="btnDelete_Click" Text="删除"
|
||||
runat="server">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
<f:Tree ID="trRectify" Width="200px" EnableCollapse="true" ShowHeader="true" Title="作业类别"
|
||||
OnNodeCommand="trRectify_NodeCommand" AutoLeafIdentification="true" runat="server"
|
||||
EnableTextSelection="True">
|
||||
</f:Tree>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
|
||||
ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="质量隐患明细" TitleToolTip="质量隐患明细"
|
||||
Layout="VBox">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" Width="870px" ShowBorder="true" ShowHeader="false" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="RectifyItemId" AllowCellEditing="true" EnableColumnLines="true"
|
||||
ClicksToEdit="2" DataIDField="RectifyItemId" AllowSorting="true" SortField="RectifyName"
|
||||
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
|
||||
PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true"
|
||||
OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar3" Position="Top" runat="server">
|
||||
<Items>
|
||||
<f:TextBox ID="RectifyName" runat="server" Label="作业类别" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
Width="250px" LabelWidth="90px">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="HazardSourcePoint" runat="server" Label="隐患源点" EmptyText="输入查询条件"
|
||||
Width="250px" LabelWidth="90px">
|
||||
</f:TextBox>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnQuery" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true" Text="查询"
|
||||
OnClick="TextBox_TextChanged" runat="server" >
|
||||
</f:Button>
|
||||
<f:Button ID="btnNewDetail" ToolTip="新增" Hidden="true" Icon="Add" runat="server" OnClick="btnNewDetail_Click" Text="新增">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSelectColumns" runat="server" Hidden="true" ToolTip="导出" Icon="FolderUp" EnablePostBack="false" Text="导出">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RowNumberField EnablePagingNumber="true" HeaderText="序号" Width="45px" HeaderTextAlign="Center" TextAlign="Center"/>
|
||||
<f:TemplateField Width="110px" HeaderText="作业类别" HeaderTextAlign="Center" TextAlign="Left"
|
||||
SortField="RectifyName">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblRectifyName" runat="server" Text='<%# Bind("RectifyName") %>' ToolTip='<%#Bind("RectifyName") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField Width="200px" HeaderText="隐患源点" HeaderTextAlign="Center" TextAlign="Left"
|
||||
SortField="HazardSourcePoint">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label5" runat="server" Text='<%# Bind("ShortHazardSourcePoint") %>' ToolTip='<%#Bind("HazardSourcePoint") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField Width="120px" HeaderText="风险分析" HeaderTextAlign="Center" TextAlign="Left"
|
||||
SortField="RiskAnalysis">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label4" runat="server" Text='<%# Bind("RiskAnalysis") %>' ToolTip='<%#Bind("RiskAnalysis") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField Width="230px" HeaderText="风险防范" HeaderTextAlign="Center" TextAlign="Left"
|
||||
SortField="RiskPrevention" ExpandUnusedSpace="true">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label2" runat="server" Text='<%# Bind("ShortRiskPrevention") %>' ToolTip='<%#Bind("RiskPrevention") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:TemplateField Width="110px" HeaderText="同类风险" HeaderTextAlign="Center" TextAlign="Left"
|
||||
SortField="SimilarRisk">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="Label3" runat="server" Text='<%# Bind("ShortSimilarRisk") %>' ToolTip='<%#Bind("SimilarRisk") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
</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" OnClose="Window1_Close" IsModal="true"
|
||||
Width="600px" Height="360px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="质量隐患" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window2_Close" IsModal="true"
|
||||
Width="700px" Height="450px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window5" Title="选择需要导出的列" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window5_Close" IsModal="true"
|
||||
Width="450px" Height="250px" EnableAjax="false">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
Hidden="true" runat="server" Text="编辑" Icon="Pencil">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true" Icon="Delete"
|
||||
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/jscript">
|
||||
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,561 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.UI;
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Technique
|
||||
{
|
||||
public partial class Rectify : PageBase
|
||||
{
|
||||
#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);
|
||||
btnSelectColumns.OnClientClick = Window5.GetShowReference("RectifySelectCloumn.aspx");
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
InitTreeMenu();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT RectifyItem.RectifyItemId,RectifyItem.RectifyId,RectifyItem.HazardSourcePoint,(CASE WHEN LEN(RectifyItem.HazardSourcePoint) > 30 THEN LEFT(RectifyItem.HazardSourcePoint,30) + '...' ELSE RectifyItem.HazardSourcePoint END) AS ShortHazardSourcePoint, "
|
||||
+ @" RectifyItem.RiskAnalysis,(CASE WHEN LEN(RectifyItem.RiskPrevention) > 30 THEN LEFT(RectifyItem.RiskPrevention,30) + '...' ELSE RectifyItem.RiskPrevention END) AS ShortRiskPrevention,RectifyItem.RiskPrevention, "
|
||||
+ @" RectifyItem.SimilarRisk,(CASE WHEN LEN(RectifyItem.SimilarRisk) > 30 THEN LEFT(RectifyItem.SimilarRisk,30) + '...' ELSE RectifyItem.SimilarRisk END) AS ShortSimilarRisk,R.RectifyName,R.RectifyCode,RectifyItem.CompileMan,RectifyItem.CompileDate,"
|
||||
+ @" RectifyItem.AuditMan,RectifyItem.AuditDate,RectifyItem.IsPass,U.UserName AS CompileManName,UR.UserName AS AuditManName"
|
||||
+ @" FROM dbo.Technique_RectifyItem AS RectifyItem"
|
||||
+ @" LEFT JOIN dbo.Technique_Rectify AS R ON R.RectifyId=RectifyItem.RectifyId"
|
||||
+ @" LEFT JOIN dbo.Sys_User AS U ON U.UserId=RectifyItem.CompileMan"
|
||||
+ @" LEFT JOIN dbo.Sys_User AS UR ON U.UserId=RectifyItem.AuditMan"
|
||||
+ @" WHERE RectifyItem.RectifyId=@RectifyId";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@RectifyId", this.trRectify.SelectedNode.NodeID)
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.RectifyName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND RectifyName LIKE @RectifyName";
|
||||
listStr.Add(new SqlParameter("@RectifyName", "%" + this.RectifyName.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.HazardSourcePoint.Text.Trim()))
|
||||
{
|
||||
strSql += " AND HazardSourcePoint LIKE @HazardSourcePoint";
|
||||
listStr.Add(new SqlParameter("@HazardSourcePoint", "%" + this.HazardSourcePoint.Text.Trim() + "%"));
|
||||
}
|
||||
|
||||
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>
|
||||
private void InitTreeMenu()
|
||||
{
|
||||
this.trRectify.Nodes.Clear();
|
||||
this.trRectify.ShowBorder = false;
|
||||
this.trRectify.ShowHeader = false;
|
||||
this.trRectify.EnableIcons = true;
|
||||
this.trRectify.AutoScroll = true;
|
||||
this.trRectify.EnableSingleClickExpand = true;
|
||||
TreeNode rootNode = new TreeNode
|
||||
{
|
||||
Text = "隐患类型",
|
||||
NodeID = "0",
|
||||
Expanded = true
|
||||
};
|
||||
this.trRectify.Nodes.Add(rootNode);
|
||||
BoundTree(rootNode.Nodes, "0");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 加载树
|
||||
/// </summary>
|
||||
/// <param name="nodes"></param>
|
||||
/// <param name="menuId"></param>
|
||||
private void BoundTree(TreeNodeCollection nodes, string menuId)
|
||||
{
|
||||
var dt = BLL.RectifyService.GetRectifyBySupRectifyId(menuId,"1");
|
||||
if (dt.Count() > 0)
|
||||
{
|
||||
TreeNode tn = null;
|
||||
foreach (var dr in dt)
|
||||
{
|
||||
tn = new TreeNode
|
||||
{
|
||||
Text = dr.RectifyName,
|
||||
ToolTip = dr.RectifyName,
|
||||
NodeID = dr.RectifyId,
|
||||
EnableClickEvent = true
|
||||
};
|
||||
nodes.Add(tn);
|
||||
BoundTree(tn.Nodes, dr.RectifyId);
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 添加按钮
|
||||
/// <summary>
|
||||
/// 添加安全隐患类型按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNew_Click(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
if (this.trRectify.SelectedNode != null)
|
||||
{
|
||||
Model.Technique_Rectify rectify = BLL.RectifyService.GetRectifyById(this.trRectify.SelectedNode.NodeID);
|
||||
if ((rectify != null && rectify.IsEndLever == false) || this.trRectify.SelectedNode.NodeID == "0") //根节点或者非末级节点,可以增加
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RectifyEdit.aspx?SupRectifyId={0}", this.trRectify.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("选择的项已是末级!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 修改
|
||||
/// <summary>
|
||||
/// 修改安全隐患类型
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnEdit_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trRectify.SelectedNode != null)
|
||||
{
|
||||
if (this.trRectify.SelectedNode.NodeID != "0") //非根节点可以编辑
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("RectifyEdit.aspx?RectifyId={0}", this.trRectify.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("根节点无法编辑!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除
|
||||
/// <summary>
|
||||
/// 删除安全试题类型
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trRectify.SelectedNode != null)
|
||||
{
|
||||
var q = BLL.RectifyService.GetRectifyById(this.trRectify.SelectedNode.NodeID);
|
||||
|
||||
if (q != null && BLL.RectifyService.IsDeleteRectify(this.trRectify.SelectedNode.NodeID))
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, q.RectifyName, q.RectifyId, BLL.Const.CQMSRectifyMenuId, Const.BtnDelete);
|
||||
BLL.RectifyItemService.DeleteRectifyItemByRectifyId(this.trRectify.SelectedNode.NodeID);
|
||||
BLL.RectifyService.DeleteRectify(this.trRectify.SelectedNode.NodeID);
|
||||
InitTreeMenu();
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("存在下级菜单或已增加资源数据或者为内置项,不允许删除!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择删除项!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Tree点击事件
|
||||
/// <summary>
|
||||
/// tree点击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void trRectify_NodeCommand(object sender, TreeCommandEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 文本框查询事件
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, string.Empty, string.Empty, BLL.Const.CQMSRectifyMenuId, Const.BtnQuery);
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 增加明细
|
||||
/// <summary>
|
||||
/// 增加安全隐患明细
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnNewDetail_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (this.trRectify.SelectedNode != null)
|
||||
{
|
||||
if (this.trRectify.SelectedNode.Nodes.Count == 0)
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("RectifyItemEdit.aspx?RectifyId={0}", this.trRectify.SelectedNode.NodeID, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择末级节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择树节点!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑明细
|
||||
/// <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()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
string rectifyItemId = Grid1.SelectedRowID;
|
||||
|
||||
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("RectifyItemEdit.aspx?RectifyItemId={0}", rectifyItemId, "编辑 - ")));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除明细
|
||||
/// <summary>
|
||||
/// 右键删除事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.DeleteData();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除方法
|
||||
/// </summary>
|
||||
private void DeleteData()
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
if (judgementDelete(rowID, true))
|
||||
{
|
||||
var rectifyItem = BLL.RectifyItemService.GetRectifyItemById(rowID);
|
||||
if (rectifyItem != null)
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, rectifyItem.HazardSourcePoint, rectifyItem.RectifyItemId, BLL.Const.CQMSRectifyMenuId, Const.BtnDelete);
|
||||
BLL.RectifyItemService.DeleteRectifyItem(rowID);
|
||||
BindGrid();
|
||||
ShowNotify("删除数据成功!");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 表头分页、排序
|
||||
/// <summary>
|
||||
/// Grid分页索引改变事件
|
||||
/// </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>
|
||||
/// Grid1排序
|
||||
/// </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 Grid行双击事件
|
||||
/// <summary>
|
||||
/// Grid1行双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 关闭弹出框
|
||||
/// <summary>
|
||||
/// 关闭弹出窗口1
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
InitTreeMenu();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭弹出窗口2
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导出
|
||||
/// <summary>
|
||||
/// 关闭导出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window5_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
Response.ClearContent();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=MyExcelFile.xls");
|
||||
Response.ContentType = "application/excel";
|
||||
Response.ContentEncoding = System.Text.Encoding.UTF8;
|
||||
Response.Write(GetGridTableHtml(Grid1, e.CloseArgument.Split('#')));
|
||||
Response.End();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出
|
||||
/// </summary>
|
||||
/// <param name="grid"></param>
|
||||
/// <param name="columns"></param>
|
||||
/// <returns></returns>
|
||||
private string GetGridTableHtml(Grid grid, string[] columns)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
|
||||
List<string> columnHeaderTexts = new List<string>(columns);
|
||||
List<int> columnIndexs = new List<int>();
|
||||
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
|
||||
sb.Append("<tr>");
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
if (columnHeaderTexts.Contains(column.HeaderText))
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
columnIndexs.Add(column.ColumnIndex);
|
||||
}
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
foreach (GridRow row in grid.Rows)
|
||||
{
|
||||
sb.Append("<tr>");
|
||||
int columnIndex = 0;
|
||||
foreach (object value in row.Values)
|
||||
{
|
||||
if (columnIndexs.Contains(columnIndex))
|
||||
{
|
||||
string html = value.ToString();
|
||||
if (html.StartsWith(Grid.TEMPLATE_PLACEHOLDER_PREFIX))
|
||||
{
|
||||
// 模板列
|
||||
string templateID = html.Substring(Grid.TEMPLATE_PLACEHOLDER_PREFIX.Length);
|
||||
Control templateCtrl = row.FindControl(templateID);
|
||||
html = GetRenderedHtmlSource(templateCtrl);
|
||||
}
|
||||
//else
|
||||
//{
|
||||
// // 处理CheckBox
|
||||
// if (html.Contains("f-grid-static-checkbox"))
|
||||
// {
|
||||
// if (!html.Contains("f-checked"))
|
||||
// {
|
||||
// html = "×";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// html = "√";
|
||||
// }
|
||||
// }
|
||||
// // 处理图片
|
||||
// if (html.Contains("<img"))
|
||||
// {
|
||||
// string prefix = Request.Url.AbsoluteUri.Replace(Request.Url.AbsolutePath, "");
|
||||
// html = html.Replace("src=\"", "src=\"" + prefix);
|
||||
// }
|
||||
//}
|
||||
sb.AppendFormat("<td>{0}</td>", html);
|
||||
}
|
||||
columnIndex++;
|
||||
}
|
||||
sb.Append("</tr>");
|
||||
}
|
||||
sb.Append("</table>");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取控件渲染后的HTML源代码
|
||||
/// </summary>
|
||||
/// <param name="ctrl"></param>
|
||||
/// <returns></returns>
|
||||
private string GetRenderedHtmlSource(Control ctrl)
|
||||
{
|
||||
if (ctrl != null)
|
||||
{
|
||||
using (StringWriter sw = new StringWriter())
|
||||
{
|
||||
using (HtmlTextWriter htw = new HtmlTextWriter(sw))
|
||||
{
|
||||
ctrl.RenderControl(htw);
|
||||
return sw.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
return String.Empty;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 判断是否可删除
|
||||
/// <summary>
|
||||
/// 判断是否可以删除
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
private bool judgementDelete(string id, bool isShow)
|
||||
{
|
||||
string content = string.Empty;
|
||||
//if (Funs.DB.Supervise_SuperviseCheckRectifyItem.FirstOrDefault(x => x.RectifyItemId == id) != null)
|
||||
//{
|
||||
// content = "该安全隐患已在【检查整改】中使用,不能删除!";
|
||||
//}
|
||||
if (string.IsNullOrEmpty(content))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isShow)
|
||||
{
|
||||
Alert.ShowInTop(content);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.CQMSRectifyMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
this.btnNewDetail.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnEdit.Hidden = false;
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnDelete.Hidden = false;
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnOut))
|
||||
{
|
||||
this.btnSelectColumns.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Technique
|
||||
{
|
||||
|
||||
|
||||
public partial class Rectify
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnDelete;
|
||||
|
||||
/// <summary>
|
||||
/// trRectify 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tree trRectify;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar3;
|
||||
|
||||
/// <summary>
|
||||
/// RectifyName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox RectifyName;
|
||||
|
||||
/// <summary>
|
||||
/// HazardSourcePoint 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox HazardSourcePoint;
|
||||
|
||||
/// <summary>
|
||||
/// btnQuery 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnQuery;
|
||||
|
||||
/// <summary>
|
||||
/// btnNewDetail 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNewDetail;
|
||||
|
||||
/// <summary>
|
||||
/// btnSelectColumns 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSelectColumns;
|
||||
|
||||
/// <summary>
|
||||
/// lblRectifyName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblRectifyName;
|
||||
|
||||
/// <summary>
|
||||
/// Label5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label5;
|
||||
|
||||
/// <summary>
|
||||
/// Label4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label4;
|
||||
|
||||
/// <summary>
|
||||
/// Label2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label2;
|
||||
|
||||
/// <summary>
|
||||
/// Label3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label Label3;
|
||||
|
||||
/// <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>
|
||||
/// Window2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
/// <summary>
|
||||
/// Window5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window5;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RectifyEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Technique.RectifyEdit" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>编辑安全隐患类型</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtRectifyCode" runat="server" Label="编号" Required="true" ShowRedStar="true"
|
||||
MaxLength="50" FocusOnPageLoad="true">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextBox ID="txtRectifyName" runat="server" Label="名称" Required="true" ShowRedStar="true"
|
||||
MaxLength="50">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpIsEndLever" Label="是否末级" AutoPostBack="false" EnableSimulateTree="true"
|
||||
runat="server">
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1" Text="保存"
|
||||
Hidden="true" 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>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,148 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Technique
|
||||
{
|
||||
public partial class RectifyEdit : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 安全隐患主键
|
||||
/// </summary>
|
||||
public string RectifyId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["RectifyId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["RectifyId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 上一节点id
|
||||
/// </summary>
|
||||
public string SupRectifyId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["SupRectifyId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["SupRectifyId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
this.drpIsEndLever.DataTextField = "TypeName";
|
||||
drpIsEndLever.DataValueField = "TypeId";
|
||||
drpIsEndLever.DataSource = BLL.TrainingService.GetIsEndLeverList();
|
||||
drpIsEndLever.DataBind();
|
||||
|
||||
this.RectifyId = Request.Params["RectifyId"];
|
||||
this.SupRectifyId = Request.Params["SupRectifyId"];
|
||||
if (!string.IsNullOrEmpty(this.RectifyId))
|
||||
{
|
||||
Model.Technique_Rectify rectify = BLL.RectifyService.GetRectifyById(this.RectifyId);
|
||||
if (rectify != null)
|
||||
{
|
||||
this.txtRectifyCode.Text = rectify.RectifyCode;
|
||||
this.txtRectifyName.Text = rectify.RectifyName;
|
||||
if (rectify.IsEndLever == true)
|
||||
{
|
||||
this.drpIsEndLever.SelectedValue = "true";
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drpIsEndLever.SelectedValue = "false";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
Model.Technique_Rectify rectify = new Model.Technique_Rectify
|
||||
{
|
||||
RectifyType = "1",//质量
|
||||
RectifyCode = this.txtRectifyCode.Text.Trim(),
|
||||
RectifyName = this.txtRectifyName.Text.Trim()
|
||||
};
|
||||
if (this.drpIsEndLever.SelectedValue == "true")
|
||||
{
|
||||
rectify.IsEndLever = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
rectify.IsEndLever = false;
|
||||
}
|
||||
if (string.IsNullOrEmpty(this.RectifyId))
|
||||
{
|
||||
rectify.SupRectifyId = this.SupRectifyId;
|
||||
rectify.RectifyId = SQLHelper.GetNewID(typeof(Model.Technique_Rectify));
|
||||
BLL.RectifyService.AddRectify(rectify);
|
||||
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, rectify.RectifyName, rectify.RectifyId, BLL.Const.CQMSRectifyMenuId, Const.BtnAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
Model.Technique_Rectify r = BLL.RectifyService.GetRectifyById(this.RectifyId);
|
||||
if (r != null)
|
||||
{
|
||||
rectify.SupRectifyId = r.SupRectifyId;
|
||||
}
|
||||
rectify.RectifyId = this.RectifyId;
|
||||
BLL.RectifyService.UpdateRectify(rectify);
|
||||
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, rectify.RectifyName, rectify.RectifyId, BLL.Const.CQMSRectifyMenuId, Const.BtnModify);
|
||||
}
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.CQMSRectifyMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Technique
|
||||
{
|
||||
|
||||
|
||||
public partial class RectifyEdit
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// txtRectifyCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRectifyCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtRectifyName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRectifyName;
|
||||
|
||||
/// <summary>
|
||||
/// drpIsEndLever 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpIsEndLever;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RectifyItemEdit.aspx.cs"
|
||||
Async="true" Inherits="FineUIPro.Web.CQMS.Technique.RectifyItemEdit" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>隐患详细</title>
|
||||
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Label ID="lblRectifyName" runat="server" Label="作业类别">
|
||||
</f:Label>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtHazardSourcePoint" runat="server" Label="隐患源点" Height="60px" MaxLength="150">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtRiskAnalysis" runat="server" Label="风险分析" Height="70px" MaxLength="500">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtRiskPrevention" runat="server" Label="风险防范" Height="70px" MaxLength="150">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:TextArea ID="txtSimilarRisk" runat="server" Label="同类风险" Height="80px" MaxLength="500">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1" Text="保存"
|
||||
Hidden="true" 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>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,164 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Technique
|
||||
{
|
||||
public partial class RectifyItemEdit : PageBase
|
||||
{
|
||||
#region 定义变量
|
||||
/// <summary>
|
||||
/// 质量隐患主键
|
||||
/// </summary>
|
||||
public string RectifyId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["RectifyId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["RectifyId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 质量隐患明细主键
|
||||
/// </summary>
|
||||
public string RectifyItemId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["RectifyItemId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["RectifyItemId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
this.RectifyId = Request.Params["RectifyId"];
|
||||
this.RectifyItemId = Request.Params["RectifyItemId"];
|
||||
if (!string.IsNullOrEmpty(this.RectifyItemId))
|
||||
{
|
||||
var rectifyItem = BLL.RectifyItemService.GetRectifyItemById(this.RectifyItemId);
|
||||
if (rectifyItem != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(rectifyItem.RectifyId))
|
||||
{
|
||||
var rectify = BLL.RectifyService.GetRectifyById(rectifyItem.RectifyId);
|
||||
if (rectify != null)
|
||||
{
|
||||
this.lblRectifyName.Text = rectify.RectifyName;
|
||||
}
|
||||
}
|
||||
this.txtHazardSourcePoint.Text = rectifyItem.HazardSourcePoint;
|
||||
this.txtRiskAnalysis.Text = rectifyItem.RiskAnalysis;
|
||||
this.txtRiskPrevention.Text = rectifyItem.RiskPrevention;
|
||||
this.txtSimilarRisk.Text = rectifyItem.SimilarRisk;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.RectifyId))
|
||||
{
|
||||
var rectify = BLL.RectifyService.GetRectifyById(this.RectifyId);
|
||||
if (rectify != null)
|
||||
{
|
||||
this.lblRectifyName.Text = rectify.RectifyName;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
private void SaveData()
|
||||
{
|
||||
Model.Technique_RectifyItem rectifyItem = new Model.Technique_RectifyItem
|
||||
{
|
||||
HazardSourcePoint = this.txtHazardSourcePoint.Text.Trim(),
|
||||
RiskAnalysis = this.txtRiskAnalysis.Text.Trim(),
|
||||
RiskPrevention = this.txtRiskPrevention.Text.Trim(),
|
||||
SimilarRisk = this.txtSimilarRisk.Text.Trim(),
|
||||
};
|
||||
if (string.IsNullOrEmpty(this.RectifyItemId))
|
||||
{
|
||||
rectifyItem.CompileMan = this.CurrUser.PersonName;
|
||||
rectifyItem.UnitId = String.IsNullOrEmpty(this.CurrUser.UnitId) ? CommonService.GetMainProjectUnitId(this.CurrUser.LoginProjectId) : this.CurrUser.UnitId;
|
||||
rectifyItem.CompileDate = DateTime.Now;
|
||||
rectifyItem.IsPass = true;
|
||||
rectifyItem.RectifyItemId = SQLHelper.GetNewID(typeof(Model.Technique_RectifyItem));
|
||||
RectifyItemId = rectifyItem.RectifyItemId;
|
||||
rectifyItem.RectifyId = this.RectifyId;
|
||||
BLL.RectifyItemService.AddRectifyItem(rectifyItem);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, rectifyItem.HazardSourcePoint, rectifyItem.RectifyItemId, BLL.Const.CQMSRectifyMenuId, Const.BtnAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
rectifyItem.RectifyItemId = this.RectifyItemId;
|
||||
Model.Technique_RectifyItem r = BLL.RectifyItemService.GetRectifyItemById(this.RectifyId);
|
||||
if (r != null)
|
||||
{
|
||||
rectifyItem.RectifyId = r.RectifyId;
|
||||
}
|
||||
BLL.RectifyItemService.UpdateRectifyItem(rectifyItem);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, rectifyItem.HazardSourcePoint, rectifyItem.RectifyItemId, BLL.Const.CQMSRectifyMenuId, Const.BtnModify);
|
||||
}
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
SaveData();
|
||||
}
|
||||
#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.PersonId, BLL.Const.CQMSRectifyMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Technique
|
||||
{
|
||||
|
||||
|
||||
public partial class RectifyItemEdit
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// lblRectifyName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lblRectifyName;
|
||||
|
||||
/// <summary>
|
||||
/// txtHazardSourcePoint 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtHazardSourcePoint;
|
||||
|
||||
/// <summary>
|
||||
/// txtRiskAnalysis 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtRiskAnalysis;
|
||||
|
||||
/// <summary>
|
||||
/// txtRiskPrevention 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtRiskPrevention;
|
||||
|
||||
/// <summary>
|
||||
/// txtSimilarRisk 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextArea txtSimilarRisk;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RectifySelectCloumn.aspx.cs" Inherits="FineUIPro.Web.CQMS.Technique.RectifySelectCloumn" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>质量隐患导出选择列</title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" ShowBorder="False" ShowHeader="false" Layout="Anchor"
|
||||
BodyPadding="5px">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" Text="取消" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" Text="导出" runat="server" Icon="SystemSave" OnClick="btnImport_Click" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Items>
|
||||
<f:CheckBoxList runat="server" ID="cblColumns" ColumnNumber="3">
|
||||
<f:CheckItem Text="作业类别" Value="作业类别" Selected="true" />
|
||||
<f:CheckItem Text="隐患源点" Value="隐患源点" Selected="true" />
|
||||
<f:CheckItem Text="风险分析" Value="风险分析" Selected="true" />
|
||||
<f:CheckItem Text="风险防范" Value="风险防范" Selected="true" />
|
||||
<f:CheckItem Text="同类风险" Value="同类风险" Selected="true" />
|
||||
</f:CheckBoxList>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Technique
|
||||
{
|
||||
public partial class RectifySelectCloumn : PageBase
|
||||
{
|
||||
#region 加载页面
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 导出
|
||||
/// <summary>
|
||||
/// 导出按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
// 1. 这里放置保存窗体中数据的逻辑
|
||||
// 2. 关闭本窗体,然后回发父窗体
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference(String.Join("#", cblColumns.SelectedValueArray)));
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 获取按钮权限
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
/// <param name="button"></param>
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.CQMSRectifyMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnOut))
|
||||
{
|
||||
this.btnImport.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Technique
|
||||
{
|
||||
|
||||
|
||||
public partial class RectifySelectCloumn
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
|
||||
/// <summary>
|
||||
/// cblColumns 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.CheckBoxList cblColumns;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user