数据穿透

This commit is contained in:
2023-06-09 14:28:23 +08:00
parent 72f0109f93
commit 1c8c630c21
13 changed files with 362 additions and 106 deletions
+20 -9
View File
@@ -24,10 +24,10 @@
<f:TextBox runat="server" Label="名称" ID="txtKey" EmptyText="输入查询条件"
AutoPostBack="true" Width="200px" LabelWidth="50px"></f:TextBox>
<f:Button ID="btnQuery" OnClick="btnQuery_Click" ToolTip="查询" Icon="SystemSearch" EnablePostBack="true" runat="server" >
<f:Button ID="btnQuery" OnClick="btnQuery_Click" ToolTip="查询" Text="查询" Icon="SystemSearch" EnablePostBack="true" runat="server" >
</f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp" Text="导出"
EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
@@ -51,6 +51,10 @@
RendererFunction="renderIsHsse" HeaderText="安管人员" HeaderTextAlign="Center"
TextAlign="Center">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="IsCQMS" DataField="IsCQMS" FieldType="Boolean"
RendererFunction="renderIsHsse" HeaderText="质量管理" HeaderTextAlign="Center"
TextAlign="Center">
</f:RenderField>
<f:TemplateField Width="120px" HeaderText="对口专业" HeaderTextAlign="Center" TextAlign="Center" >
<ItemTemplate>
<asp:Label ID="Label4" runat="server" Text='<%# ConvertCNCodes(Eval("CNCodes")) %>'></asp:Label>
@@ -83,8 +87,9 @@
<f:SimpleForm ID="SimpleForm1" runat="server" ShowBorder="true" ShowHeader="false"
LabelWidth="80px" BodyPadding="5px" Width="350px">
<Items>
<f:HiddenField ID="hfFormID" runat="server">
</f:HiddenField>
<f:TextBox ID="hfFormID" Hidden="true"
runat="server" LabelAlign="right">
</f:TextBox>
<f:DropDownList ID="drpWorkPostCode" runat="server" Label="编号" LabelAlign="Right" Required="true"
ShowRedStar="true" LabelWidth="80px">
</f:DropDownList>
@@ -95,7 +100,9 @@
<f:DropDownList ID="drpPostType" runat="server" Label="类型" LabelAlign="Right" Required="true"
ShowRedStar="true" LabelWidth="80px">
</f:DropDownList>
<f:CheckBox ID="ckbIsHsse" runat="server" Label="安管" LabelAlign="Right" LabelWidth="80px">
<f:CheckBox ID="ckbIsHsse" runat="server" Label="安管人员" LabelAlign="Right" LabelWidth="80px">
</f:CheckBox>
<f:CheckBox ID="ckbIsCQMS" runat="server" Label="质量管理" LabelAlign="Right" LabelWidth="80px">
</f:CheckBox>
<f:DropDownBox runat="server" Label="对口专业" ID="txtCNCodes" EmptyText="--请选择--" EnableMultiSelect="true" MatchFieldWidth="true" LabelWidth="80px">
<PopPanel>
@@ -118,24 +125,26 @@
</f:Label>
<f:Label ID="Label2" runat="server" Text="1、若选中安管人员即为安全专职人员;">
</f:Label>
<f:Label ID="Label3" runat="server" Text="2、特种作业人员和一般作业岗位为单位作业人员">
<f:Label ID="Label5" runat="server" Text="2、若选中质量管理即为质量管理人员">
</f:Label>
<f:Label ID="Label3" runat="server" Text="3、特种作业人员和一般作业岗位为单位作业人员。">
</f:Label>
</Items>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" runat="server">
<Items>
<f:Button ID="btnNew" Icon="Add" ToolTip="新增" EnablePostBack="false" Hidden="true"
<f:Button ID="btnNew" Icon="Add" ToolTip="新增" EnablePostBack="false" Hidden="true" Text="新增"
runat="server">
<Listeners>
<f:Listener Event="click" Handler="onNewButtonClick" />
</Listeners>
</f:Button>
<f:Button ID="btnDelete" Enabled="false" ToolTip="删除" Icon="Delete" ConfirmText="确定删除当前数据?"
<f:Button ID="btnDelete" Enabled="false" ToolTip="删除" Icon="Delete" ConfirmText="确定删除当前数据?" Text="删除"
Hidden="true" OnClick="btnDelete_Click" runat="server">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1"
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1" Text="保存"
Hidden="true" OnClick="btnSave_Click">
</f:Button>
</Items>
@@ -177,6 +186,7 @@
var txtNameClientID = '<%= txtWorkPostName.ClientID %>';
var drpPostTypeClientID = '<%= drpPostType.ClientID %>';
var ckbIsHsseClientID = '<%= ckbIsHsse.ClientID %>';
var ckbIsCQMSClientID = '<%= ckbIsCQMS.ClientID %>';
var txtCNCodesClientID = '<%= txtCNCodes.ClientID %>';
var txtRemarkClientID = '<%=txtRemark.ClientID %>';
@@ -194,6 +204,7 @@
F(txtNameClientID).setValue(rowValue['WorkPostName']);
F(drpPostTypeClientID).setValue(rowValue['PostType']);
F(ckbIsHsseClientID).setValue(rowValue['IsHsse']);
F(ckbIsCQMSClientID).setValue(rowValue['IsCQMS']);
F(txtCNCodesClientID).setValue(rowValue['CNCodes']);
F(txtRemarkClientID).setValue(rowValue['Remark']);
+21 -3
View File
@@ -38,7 +38,7 @@ namespace FineUIPro.Web.BaseInfo
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT wp.WorkPostId,wp.WorkPostName, wp.WorkPostCode, wp.Remark,wp.PostType,wp.IsHsse,wp.CNCodes,
string strSql = @"SELECT wp.WorkPostId,wp.WorkPostName, wp.WorkPostCode, wp.Remark,wp.PostType,wp.IsHsse,wp.IsCQMS,wp.CNCodes,
case wp.IsHsse when 1 then '是' else '否' end as IsHsseStr,const.ConstText as PostTypeName
FROM dbo.Base_WorkPost AS wp
LEFT JOIN Sys_Const AS const ON const.ConstValue = wp.PostType and const.GroupId = '" + ConstValue.Group_PostType + "' ";
@@ -109,8 +109,15 @@ namespace FineUIPro.Web.BaseInfo
protected void btnDelete_Click(object sender, EventArgs e)
{
BLL.LogService.AddSys_Log(this.CurrUser, this.drpWorkPostCode.SelectedValue, hfFormID.Text, BLL.Const.WorkPostMenuId, BLL.Const.BtnDelete);
BLL.WorkPostService.DeleteWorkPostById(hfFormID.Text);
if (hfFormID.Text != BLL.Const.WorkPost_HSSEDirector && hfFormID.Text != BLL.Const.WorkPost_ProjectHSSEDirector)
{
BLL.WorkPostService.DeleteWorkPostById(hfFormID.Text);
}
else
{
Alert.ShowInTop("内置岗位,无法删除!", MessageBoxIcon.Warning);
return;
}
// 重新绑定表格,并模拟点击[新增按钮]
BindGrid();
PageContext.RegisterStartupScript("onNewButtonClick();");
@@ -180,6 +187,10 @@ namespace FineUIPro.Web.BaseInfo
{
this.ckbIsHsse.Checked = true;
}
if (workPost.IsCQMS == true)
{
this.ckbIsCQMS.Checked = true;
}
if (!string.IsNullOrEmpty(workPost.CNCodes))
{
txtCNCodes.Values = workPost.CNCodes.Split(',');
@@ -215,6 +226,12 @@ namespace FineUIPro.Web.BaseInfo
ShowNotify("请选择类型!", MessageBoxIcon.Warning);
return;
}
var q2 = Funs.DB.Base_WorkPost.FirstOrDefault(x => x.WorkPostName == this.txtWorkPostName.Text.Trim() && (x.WorkPostId != hfFormID.Text || (hfFormID.Text == null && x.WorkPostId != null)));
if (q2 != null)
{
ShowNotify("输入的岗位名称已存在!", MessageBoxIcon.Warning);
return;
}
string strRowID = hfFormID.Text;
Model.Base_WorkPost newWorkPost = new Model.Base_WorkPost
{
@@ -222,6 +239,7 @@ namespace FineUIPro.Web.BaseInfo
WorkPostName = this.txtWorkPostName.Text.Trim(),
PostType = this.drpPostType.SelectedValue,
IsHsse = Convert.ToBoolean(this.ckbIsHsse.Checked),
IsCQMS = Convert.ToBoolean(this.ckbIsCQMS.Checked),
CNCodes = string.Join(",", txtCNCodes.Values),
Remark = txtRemark.Text.Trim()
};
+56 -40
View File
@@ -7,13 +7,11 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.BaseInfo
{
public partial class WorkPost
{
namespace FineUIPro.Web.BaseInfo {
public partial class WorkPost {
/// <summary>
/// form1 控件。
/// </summary>
@@ -22,7 +20,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@@ -31,7 +29,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
@@ -40,7 +38,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -49,7 +47,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
@@ -58,7 +56,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// txtKey 控件。
/// </summary>
@@ -67,7 +65,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtKey;
/// <summary>
/// btnQuery 控件。
/// </summary>
@@ -76,7 +74,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnQuery;
/// <summary>
/// btnOut 控件。
/// </summary>
@@ -85,7 +83,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// Label1 控件。
/// </summary>
@@ -94,7 +92,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label1;
/// <summary>
/// Label4 控件。
/// </summary>
@@ -103,7 +101,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label Label4;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@@ -112,7 +110,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
@@ -121,7 +119,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
@@ -130,7 +128,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
@@ -139,7 +137,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.SimpleForm SimpleForm1;
/// <summary>
/// hfFormID 控件。
/// </summary>
@@ -147,8 +145,8 @@ namespace FineUIPro.Web.BaseInfo
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hfFormID;
protected global::FineUIPro.TextBox hfFormID;
/// <summary>
/// drpWorkPostCode 控件。
/// </summary>
@@ -157,7 +155,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpWorkPostCode;
/// <summary>
/// txtWorkPostName 控件。
/// </summary>
@@ -166,7 +164,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtWorkPostName;
/// <summary>
/// drpPostType 控件。
/// </summary>
@@ -175,7 +173,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpPostType;
/// <summary>
/// ckbIsHsse 控件。
/// </summary>
@@ -184,7 +182,16 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckbIsHsse;
/// <summary>
/// ckbIsCQMS 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckbIsCQMS;
/// <summary>
/// txtCNCodes 控件。
/// </summary>
@@ -193,7 +200,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownBox txtCNCodes;
/// <summary>
/// gvCNCodes 控件。
/// </summary>
@@ -202,7 +209,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid gvCNCodes;
/// <summary>
/// txtRemark 控件。
/// </summary>
@@ -211,7 +218,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextArea txtRemark;
/// <summary>
/// lb1 控件。
/// </summary>
@@ -220,7 +227,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lb1;
/// <summary>
/// Label2 控件。
/// </summary>
@@ -229,7 +236,16 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label2;
/// <summary>
/// Label5 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label5;
/// <summary>
/// Label3 控件。
/// </summary>
@@ -238,7 +254,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label3;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@@ -247,7 +263,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// btnNew 控件。
/// </summary>
@@ -256,7 +272,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnDelete 控件。
/// </summary>
@@ -265,7 +281,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@@ -274,7 +290,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave 控件。
/// </summary>
@@ -283,7 +299,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// Menu1 控件。
/// </summary>
@@ -292,7 +308,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuEdit 控件。
/// </summary>
@@ -301,7 +317,7 @@ namespace FineUIPro.Web.BaseInfo
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuEdit;
/// <summary>
/// btnMenuDelete 控件。
/// </summary>