20230530集团看板数据来源页面添加
This commit is contained in:
@@ -5,6 +5,18 @@
|
||||
<head runat="server">
|
||||
<title>特岗证书</title>
|
||||
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<style type="text/css">
|
||||
.f-grid-row .f-grid-cell-inner
|
||||
{
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.f-grid-colheader-text {
|
||||
white-space: normal;
|
||||
word-break: break-all;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
@@ -24,6 +36,13 @@
|
||||
<f:RenderField Width="250px" ColumnID="CertificateName" DataField="CertificateName"
|
||||
FieldType="String" HeaderText="证书名称" HeaderTextAlign="Center" TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="CertificateType" DataField="CertificateType" FieldType="String"
|
||||
HeaderText="证件类别" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="IsRegisterHSSE" DataField="IsRegisterHSSE" FieldType="Boolean"
|
||||
RendererFunction="renderIsHsse" HeaderText="注安师" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="250px" ColumnID="Remark" DataField="Remark" FieldType="String"
|
||||
HeaderText="备注" HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
@@ -45,32 +64,41 @@
|
||||
<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:TextBox ID="txtCertificateCode" Label="编号" ShowRedStar="true" Required="true"
|
||||
runat="server" LabelAlign="right" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtCertificateName" Label="名称" ShowRedStar="true" Required="true"
|
||||
runat="server" LabelAlign="right" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpCertificateType" runat="server" Label="证件类别" LabelAlign="Right"
|
||||
LabelWidth="80px">
|
||||
<f:ListItem Value="A" Text="A类" />
|
||||
<f:ListItem Value="B" Text="B类" />
|
||||
<f:ListItem Value="C" Text="C类" />
|
||||
</f:DropDownList>
|
||||
<f:CheckBox ID="ckbIsRegisterHSSE" runat="server" Label="注安师" LabelAlign="Right" LabelWidth="80px">
|
||||
</f:CheckBox>
|
||||
<f:TextArea ID="txtRemark" runat="server" Label="备注" LabelAlign="right">
|
||||
</f:TextArea>
|
||||
</Items>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnNew" Icon="Add" Text="新增" EnablePostBack="false" runat="server">
|
||||
<f:Button ID="btnNew" Icon="Add" ToolTip="新增" EnablePostBack="false" runat="server" Text="新增">
|
||||
<Listeners>
|
||||
<f:Listener Event="click" Handler="onNewButtonClick" />
|
||||
</Listeners>
|
||||
</f:Button>
|
||||
<f:Button ID="btnDelete" Enabled="false" Text="删除" Icon="Delete" ConfirmText="确定删除当前数据?"
|
||||
<f:Button ID="btnDelete" Enabled="false" ToolTip="删除" Icon="Delete" ConfirmText="确定删除当前数据?" Text="删除"
|
||||
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"
|
||||
OnClick="btnSave_Click" Text="保存">
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="SimpleForm1" Text="保存"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
@@ -88,6 +116,9 @@
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
function renderIsHsse(value) {
|
||||
return value == true ? '是' : '否';
|
||||
}
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
@@ -108,6 +139,8 @@
|
||||
var hfFormIDClientID = '<%= hfFormID.ClientID %>';
|
||||
var txtCodeClientID = '<%= txtCertificateCode.ClientID %>';
|
||||
var txtNameClientID = '<%= txtCertificateName.ClientID %>';
|
||||
var drpCertificateTypeClientID = '<%= drpCertificateType.ClientID %>';
|
||||
var ckbIsRegisterHSSEClientID = '<%= ckbIsRegisterHSSE.ClientID %>';
|
||||
var txtRemarkClientID = '<%=txtRemark.ClientID %>';
|
||||
|
||||
function onGridRowSelect(event, rowId) {
|
||||
@@ -123,6 +156,8 @@
|
||||
F(hfFormIDClientID).setValue(rowId);
|
||||
F(txtCodeClientID).setValue(rowValue['CertificateCode']);
|
||||
F(txtNameClientID).setValue(rowValue['CertificateName']);
|
||||
F(drpCertificateTypeClientID).setValue(rowValue['CertificateType']);
|
||||
F(ckbIsRegisterHSSEClientID).setValue(rowValue['IsRegisterHSSE']);
|
||||
F(txtRemarkClientID).setValue(rowValue['Remark']);
|
||||
|
||||
// 更新保存按钮文本
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.UI;
|
||||
using System.Web.UI.WebControls;
|
||||
using BLL;
|
||||
|
||||
namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
@@ -21,6 +23,7 @@ namespace FineUIPro.Web.BaseInfo
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
Funs.FineUIPleaseSelect(this.drpCertificateType);
|
||||
ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
// 绑定表格
|
||||
BindGrid();
|
||||
@@ -149,7 +152,7 @@ namespace FineUIPro.Web.BaseInfo
|
||||
BindGrid();
|
||||
PageContext.RegisterStartupScript("onNewButtonClick();");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 编辑
|
||||
@@ -179,6 +182,14 @@ namespace FineUIPro.Web.BaseInfo
|
||||
{
|
||||
this.txtCertificateCode.Text = certificate.CertificateCode;
|
||||
this.txtCertificateName.Text = certificate.CertificateName;
|
||||
if (!string.IsNullOrEmpty(certificate.CertificateType))
|
||||
{
|
||||
this.drpCertificateType.SelectedValue = certificate.CertificateType;
|
||||
}
|
||||
if (certificate.IsRegisterHSSE == true)
|
||||
{
|
||||
this.ckbIsRegisterHSSE.Checked = true;
|
||||
}
|
||||
this.txtRemark.Text = certificate.Remark;
|
||||
hfFormID.Text = Id;
|
||||
this.btnDelete.Enabled = true;
|
||||
@@ -194,30 +205,38 @@ namespace FineUIPro.Web.BaseInfo
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
string strRowID = hfFormID.Text;
|
||||
Model.Base_Certificate certificate = new Model.Base_Certificate
|
||||
if (VTextBox())
|
||||
{
|
||||
CertificateCode = this.txtCertificateCode.Text.Trim(),
|
||||
CertificateName = this.txtCertificateName.Text.Trim(),
|
||||
Remark = txtRemark.Text.Trim()
|
||||
};
|
||||
if (string.IsNullOrEmpty(strRowID))
|
||||
{
|
||||
certificate.CertificateId = SQLHelper.GetNewID(typeof(Model.Base_Certificate));
|
||||
BLL.CertificateService.AddCertificate(certificate);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, certificate.CertificateCode, certificate.CertificateId, BLL.Const.CertificateMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
certificate.CertificateId = strRowID;
|
||||
BLL.CertificateService.UpdateCertificate(certificate);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, certificate.CertificateCode, certificate.CertificateId, BLL.Const.CertificateMenuId, BLL.Const.BtnModify);
|
||||
}
|
||||
string strRowID = hfFormID.Text;
|
||||
Model.Base_Certificate certificate = new Model.Base_Certificate
|
||||
{
|
||||
CertificateCode = this.txtCertificateCode.Text.Trim(),
|
||||
CertificateName = this.txtCertificateName.Text.Trim(),
|
||||
Remark = txtRemark.Text.Trim(),
|
||||
IsRegisterHSSE = Convert.ToBoolean(this.ckbIsRegisterHSSE.Checked),
|
||||
};
|
||||
if (this.drpCertificateType.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
certificate.CertificateType = this.drpCertificateType.SelectedValue;
|
||||
}
|
||||
if (string.IsNullOrEmpty(strRowID))
|
||||
{
|
||||
certificate.CertificateId = SQLHelper.GetNewID(typeof(Model.Base_Certificate));
|
||||
BLL.CertificateService.AddCertificate(certificate);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, certificate.CertificateCode, certificate.CertificateId, BLL.Const.CertificateMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
certificate.CertificateId = strRowID;
|
||||
BLL.CertificateService.UpdateCertificate(certificate);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, certificate.CertificateCode, certificate.CertificateId, BLL.Const.CertificateMenuId, BLL.Const.BtnModify);
|
||||
}
|
||||
|
||||
this.SimpleForm1.Reset();
|
||||
// 重新绑定表格,并点击当前编辑或者新增的行
|
||||
BindGrid();
|
||||
PageContext.RegisterStartupScript(String.Format("F('{0}').selectRow('{1}');", Grid1.ClientID, certificate.CertificateId));
|
||||
this.SimpleForm1.Reset();
|
||||
// 重新绑定表格,并点击当前编辑或者新增的行
|
||||
BindGrid();
|
||||
PageContext.RegisterStartupScript(String.Format("F('{0}').selectRow('{1}');", Grid1.ClientID, certificate.CertificateId));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
@@ -229,17 +248,26 @@ namespace FineUIPro.Web.BaseInfo
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
VTextBox();
|
||||
}
|
||||
|
||||
private bool VTextBox()
|
||||
{
|
||||
bool isok = true;
|
||||
var q = Funs.DB.Base_Certificate.FirstOrDefault(x => x.CertificateCode == this.txtCertificateCode.Text.Trim() && (x.CertificateId != hfFormID.Text || (hfFormID.Text == null && x.CertificateId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
isok = false;
|
||||
ShowNotify("输入的证书编号已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
|
||||
var q2 = Funs.DB.Base_Certificate.FirstOrDefault(x => x.CertificateName == this.txtCertificateName.Text.Trim() && (x.CertificateId != hfFormID.Text || (hfFormID.Text == null && x.CertificateId != null)));
|
||||
if (q2 != null)
|
||||
{
|
||||
isok = false;
|
||||
ShowNotify("输入的证书名称已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
return isok;
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
+19
-1
@@ -91,7 +91,7 @@ namespace FineUIPro.Web.BaseInfo {
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HiddenField hfFormID;
|
||||
protected global::FineUIPro.TextBox hfFormID;
|
||||
|
||||
/// <summary>
|
||||
/// txtCertificateCode 控件。
|
||||
@@ -111,6 +111,24 @@ namespace FineUIPro.Web.BaseInfo {
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCertificateName;
|
||||
|
||||
/// <summary>
|
||||
/// drpCertificateType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCertificateType;
|
||||
|
||||
/// <summary>
|
||||
/// ckbIsRegisterHSSE 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.CheckBox ckbIsRegisterHSSE;
|
||||
|
||||
/// <summary>
|
||||
/// txtRemark 控件。
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user