升级
This commit is contained in:
@@ -0,0 +1,178 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CqmsPerson.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.CqmsPerson" %>
|
||||
|
||||
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
|
||||
|
||||
<!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"/>
|
||||
<style type="text/css">
|
||||
.f-grid-row.Red {
|
||||
background-color: red;
|
||||
}
|
||||
.LabelColor {
|
||||
color: Red;
|
||||
font-size: small;
|
||||
}
|
||||
</style>
|
||||
</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" Title="人员信息"
|
||||
TitleToolTip="人员信息" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="人员信息" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" DataKeyNames="PersonId" DataIDField="PersonId" AllowSorting="true"
|
||||
OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="10" EnableColumnLines="true" ForceFit="true"
|
||||
OnPageIndexChange="Grid1_PageIndexChange" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar3" Position="Top" ToolbarAlign="Left" runat="server">
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="姓名" ID="txtPersonName" EmptyText="输入查询条件"
|
||||
Width="200px" LabelWidth="70px" LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="身份证" ID="txtIdentityCard" EmptyText="输入查询条件"
|
||||
Width="200px" LabelWidth="70px"
|
||||
LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpPost" runat="server" Label="岗位" EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"
|
||||
Width="200px" LabelWidth="50px" LabelAlign="right" ForceSelection="false" >
|
||||
</f:DropDownList>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Top" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:DropDownList ID="drpIsUsedName" runat="server" Label="是否在岗" EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged"
|
||||
Width="200px" LabelWidth="100px" LabelAlign="right" ForceSelection="false">
|
||||
<f:ListItem Value="是" Text="是"/>
|
||||
<f:ListItem Value="否" Text="否"/>
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpUnitId" runat="server" LabelAlign="right" Label="单位" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged" LabelWidth="70px" Width="280px">
|
||||
</f:DropDownList>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btSearch" ToolTip="查询" Icon="SystemSearch" runat="server" OnClick="TextBox_TextChanged" Text="查询"></f:Button>
|
||||
<f:Button ID="btnNew" ToolTip="增加" Icon="Add" runat="server" Hidden="true" OnClick="btnNew_Click" Text="增加">
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" ToolTip="导入" Icon="ApplicationGet" Hidden="true" runat="server" Text="导入"
|
||||
OnClick="btnImport_Click">
|
||||
</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:TemplateField ColumnID="tfNumber" Width="55px" HeaderText="序号" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblNumber" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField HeaderText="单位名称" ColumnID="UnitName" DataField="UnitName" SortField="UnitName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="200px">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="PersonName" DataField="PersonName" SortField="PersonName"
|
||||
FieldType="String" HeaderText="姓名" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:TemplateField ColumnID="tfAge" Width="80px" HeaderText="年龄" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lblAge" runat="server" Text='<%# ConvertAge(Eval("Birthday")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField ColumnID="MainCNProfessionalName" DataField="MainCNProfessionalName" FieldType="String" HeaderText="专业" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="80px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="岗位名称" ColumnID="WorkPostName" DataField="WorkPostName" SortField="WorkPostName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="120px">
|
||||
</f:RenderField>
|
||||
<f:TemplateField ColumnID="tfI" HeaderText="身份证号" Width="170px" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbI" runat="server" Text=' <%# Bind("IdentityCard") %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
<f:RenderField HeaderText="班组" ColumnID="TeamGroupName" DataField="TeamGroupName" SortField="TeamGroupName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="单位工程" ColumnID="WorkAreaName" DataField="WorkAreaName" SortField="WorkAreaName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="110px">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="InTime" DataField="InTime" SortField="InTime"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="入场时间"
|
||||
HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField HeaderText="在场" ColumnID="IsUsedName" DataField="IsUsedName" SortField="IsUsedName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="60px">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="OutTime" DataField="OutTime" SortField="OutTime"
|
||||
FieldType="Date" Renderer="Date" RendererArgument="yyyy-MM-dd" HeaderText="出场时间"
|
||||
HeaderTextAlign="Center" TextAlign="Center">
|
||||
</f:RenderField>
|
||||
</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="1200px" Height="690px">
|
||||
</f:Window>
|
||||
<f:Window ID="Window2" Title="导入人员信息" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" OnClose="Window2_Close" IsModal="true"
|
||||
CloseAction="HidePostBack" Width="1200px" Height="600px">
|
||||
</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"
|
||||
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Icon="Delete" 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,529 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
public partial class CqmsPerson : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
|
||||
/// <summary>
|
||||
/// 人员主键
|
||||
/// </summary>
|
||||
public string PersonId
|
||||
{
|
||||
get { return (string)ViewState["PersonId"]; }
|
||||
set { ViewState["PersonId"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目id
|
||||
/// </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)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
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();
|
||||
}
|
||||
|
||||
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
|
||||
this.btnMenuDelete.OnClientClick = Grid1.GetNoSelectionAlertReference("请至少选择一项!");
|
||||
this.btnMenuDelete.ConfirmText = String.Format("你确定要删除选中的 <b><script>{0}</script></b> 行数据吗?",
|
||||
Grid1.GetSelectedCountReference());
|
||||
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
||||
|
||||
var postList = Funs.DB.Base_WorkPost.Where(x => x.IsCQMSCheck == true).OrderBy(x => x.WorkPostCode).ToList();
|
||||
drpPost.DataValueField = "WorkPostId";
|
||||
drpPost.DataTextField = "WorkPostName";
|
||||
drpPost.DataSource = postList;
|
||||
drpPost.DataBind();
|
||||
Funs.FineUIPleaseSelect(drpPost);
|
||||
|
||||
this.BindGrid();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公司级树加载
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
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;
|
||||
btnImport.Hidden = true;
|
||||
btnMenuEdit.Hidden = true;
|
||||
btnMenuDelete.Hidden = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.ProjectId))
|
||||
{
|
||||
return;
|
||||
}
|
||||
string strSql = "select * from View_SitePerson_Person as Person" +
|
||||
" LEFT JOIN Base_WorkPost AS Post ON Post.WorkPostId = Person.WorkPostId" +
|
||||
" Where Post.IsCQMSCheck = '1' and Person.ProjectId=@ProjectId ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>
|
||||
{
|
||||
new SqlParameter("@ProjectId", this.ProjectId)
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.drpUnitId.SelectedValue) && this.drpUnitId.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND Person.UnitId = @UnitId";
|
||||
listStr.Add(new SqlParameter("@UnitId", this.drpUnitId.SelectedValue));
|
||||
}
|
||||
|
||||
if (drpIsUsedName.SelectedValue == "是")
|
||||
{
|
||||
strSql += " AND Person.IsUsed = @IsUsed";
|
||||
listStr.Add(new SqlParameter("@IsUsed", "1"));
|
||||
}
|
||||
else
|
||||
{
|
||||
strSql += " AND Person.IsUsed = @IsUsed";
|
||||
listStr.Add(new SqlParameter("@IsUsed", "0"));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtPersonName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Person.PersonName LIKE @PersonName";
|
||||
listStr.Add(new SqlParameter("@PersonName", "%" + this.txtPersonName.Text.Trim() + "%"));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text.Trim()))
|
||||
{
|
||||
strSql += " AND Person.IdentityCard LIKE @IdentityCard";
|
||||
listStr.Add(new SqlParameter("@IdentityCard", "%" + this.txtIdentityCard.Text.Trim() + "%"));
|
||||
}
|
||||
|
||||
if (this.drpPost.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND Person.WorkPostId = @WorkPostId";
|
||||
listStr.Add(new SqlParameter("@WorkPostId", this.drpPost.SelectedValue));
|
||||
}
|
||||
|
||||
strSql += " ORDER BY Person.InTime desc";
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 排序
|
||||
|
||||
/// <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 ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||
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("CqmsPersonEdit.aspx?ProjectId={0}", this.ProjectId, "编辑 - ")));
|
||||
}
|
||||
|
||||
#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 id = Grid1.SelectedRowID;
|
||||
this.PersonId = id;
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format(
|
||||
"CqmsPersonEdit.aspx?PersonId={0}&&ProjectId={1}", this.PersonId, this.ProjectId,
|
||||
"编辑 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Grid双击事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
||||
{
|
||||
this.EditData();
|
||||
}
|
||||
|
||||
#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)
|
||||
{
|
||||
bool isShow = false;
|
||||
if (Grid1.SelectedRowIndexArray.Length == 1)
|
||||
{
|
||||
isShow = true;
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
if (this.judgementDelete(rowID, isShow))
|
||||
{
|
||||
i++;
|
||||
var getV = BLL.PersonService.GetPersonById(rowID);
|
||||
if (getV != null)
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, getV.PersonName, getV.PersonId,
|
||||
BLL.Const.PersonListMenuId, BLL.Const.BtnDelete);
|
||||
BLL.PersonService.DeletePerson(rowID);
|
||||
}
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
if (i > 0)
|
||||
{
|
||||
ShowNotify("删除数据成功!(表格数据已重新绑定)", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 判断是否可删除
|
||||
/// </summary>
|
||||
/// <param name="rowID"></param>
|
||||
/// <param name="isShow"></param>
|
||||
/// <returns></returns>
|
||||
private bool judgementDelete(string rowID, bool isShow)
|
||||
{
|
||||
string content = string.Empty;
|
||||
if (string.IsNullOrEmpty(content))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isShow)
|
||||
{
|
||||
Alert.ShowInTop(content);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#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>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
if (Request.Params["value"] == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var buttonList =
|
||||
BLL.CommonService.GetAllButtonList(this.ProjectId, this.CurrUser.UserId, BLL.Const.PersonListMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
this.btnImport.Hidden = false;
|
||||
}
|
||||
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnMenuEdit.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 btnImport_Click(object sender, EventArgs e)
|
||||
{
|
||||
PageContext.RegisterStartupScript(
|
||||
Window2.GetShowReference(String.Format("../../HSSE/SitePerson/PersonIn.aspx?ProjectId={0}", this.ProjectId, "导入 - ")));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭导入弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window2_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 导出方法
|
||||
/// </summary>
|
||||
/// <param name="grid"></param>
|
||||
/// <returns></returns>
|
||||
private string GetGridTableHtml(Grid grid)
|
||||
{
|
||||
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("lblNumber") as AspNet.Label).Text;
|
||||
}
|
||||
if (column.ColumnID == "tfAge")
|
||||
{
|
||||
html = (row.FindControl("lblAge") as AspNet.Label).Text;
|
||||
}
|
||||
if (column.ColumnID == "tfI")
|
||||
{
|
||||
html = (row.FindControl("lbI") as AspNet.Label).Text;
|
||||
}
|
||||
// 对长数字添加前缀空格或格式,防止 Excel 精度丢失
|
||||
if (column.ColumnID == "tfI" && html.Length > 15)
|
||||
{
|
||||
sb.AppendFormat("<td style=\"mso-number-format:'\\@';\">{0}</td>", html);
|
||||
}
|
||||
else
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", html);
|
||||
}
|
||||
}
|
||||
|
||||
sb.Append("</tr>");
|
||||
}
|
||||
|
||||
sb.Append("</table>");
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 年龄
|
||||
/// </summary>
|
||||
/// <param name="compileMan"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertAge(object rirthday)
|
||||
{
|
||||
string age = string.Empty;
|
||||
if (rirthday != null)
|
||||
{
|
||||
DateTime? bDate = Funs.GetNewDateTime(rirthday.ToString());
|
||||
if (bDate.HasValue)
|
||||
{
|
||||
age = CommonService.CalculateAgeCorrect(bDate.Value).ToString();
|
||||
}
|
||||
}
|
||||
|
||||
return age;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,296 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
|
||||
|
||||
public partial class CqmsPerson
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// Toolbar3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar3;
|
||||
|
||||
/// <summary>
|
||||
/// txtPersonName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtPersonName;
|
||||
|
||||
/// <summary>
|
||||
/// txtIdentityCard 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtIdentityCard;
|
||||
|
||||
/// <summary>
|
||||
/// drpPost 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpPost;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// drpIsUsedName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpIsUsedName;
|
||||
|
||||
/// <summary>
|
||||
/// drpUnitId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnitId;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btSearch 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btSearch;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
/// <summary>
|
||||
/// lblNumber 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumber;
|
||||
|
||||
/// <summary>
|
||||
/// lblAge 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblAge;
|
||||
|
||||
/// <summary>
|
||||
/// lbI 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbI;
|
||||
|
||||
/// <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>
|
||||
/// 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,175 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CqmsPersonEdit.aspx.cs" Inherits="FineUIPro.Web.CQMS.Comprehensive.CqmsPersonEdit" %>
|
||||
|
||||
<!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"/>
|
||||
|
||||
<style type="text/css">
|
||||
.userphoto .f-field-label {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.userphoto img {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.uploadbutton .f-btn {
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" runat="server"/>
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
|
||||
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnAttachUrl4" Text="相关附件" ToolTip="查看" Icon="TableCell" runat="server"
|
||||
OnClick="btnAttachUrl4_Click" ValidateForms="Panel3" MarginLeft="5px">
|
||||
</f:Button>
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ValidateForms="Panel3" Text="保存"
|
||||
OnClick="btnSave_Click" Hidden="true">
|
||||
</f:Button>
|
||||
<f:Button runat="server" ID="btnQR" OnClick="btnQR_Click" Icon="Shading" Text="二维码查看"
|
||||
ToolTip="二维码查看">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose" Text="关闭">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:Panel ID="Panel3" runat="server" ShowHeader="false" ShowBorder="false" ColumnWidth="100%" MarginRight="5px">
|
||||
<Items>
|
||||
<f:TabStrip ID="TabStrip1" CssClass="f-tabstrip-theme-simple" Height="500px" ShowBorder="True"
|
||||
TabPosition="Top" MarginBottom="5px" EnableTabCloseMenu="false" runat="server"
|
||||
ActiveTabIndex="0">
|
||||
<Tabs>
|
||||
<f:Tab ID="Tab1" Title="基本信息" BodyPadding="5px" Layout="VBox" IconFont="Bookmark" runat="server">
|
||||
<Items>
|
||||
<f:Panel ID="Panel2" runat="server" ShowBorder="false" ShowHeader="false" Layout="HBox" AutoScroll="True"
|
||||
BoxConfigAlign="StretchMax">
|
||||
<Items>
|
||||
<f:Panel ID="Panel1" Title="面板1" BoxFlex="3" MarginRight="5px" runat="server" ShowBorder="false"
|
||||
ShowHeader="false">
|
||||
<Items>
|
||||
<f:TextBox ID="txtPersonName" runat="server" Label="人员姓名" MaxLength="50" LabelAlign="Right"
|
||||
Required="True" ShowRedStar="True" FocusOnPageLoad="true" LabelWidth="110px" OnBlur="txtPersonName_TextChanged" EnableBlurEvent="true">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpIdcardType" runat="server" Label="证件类型" LabelWidth="110px" LabelAlign="Right" Required="True" ShowRedStar="True" EnableEdit="true">
|
||||
</f:DropDownList>
|
||||
|
||||
<f:DatePicker ID="txtBirthday" runat="server" Label="出生日期" LabelAlign="Right" LabelWidth="110px">
|
||||
</f:DatePicker>
|
||||
|
||||
<f:DropDownList ID="drpUnitId" runat="server" Label="所属单位" LabelWidth="110px" LabelAlign="Right" Required="True" ShowRedStar="True" EnableEdit="true" AutoPostBack="true" OnSelectedIndexChanged="drpUnitId_OnSelectedIndexChanged" AutoSelectFirstItem="False" EmptyText="-请选择-">
|
||||
</f:DropDownList>
|
||||
<f:DropDownBox runat="server" Label="单位工程" LabelAlign="Right" LabelWidth="110px"
|
||||
ID="txtWorkArea" EmptyText="--请选择--" EnableMultiSelect="true" MatchFieldWidth="true">
|
||||
<PopPanel>
|
||||
<f:Grid ID="gvWorkArea" DataIDField="UnitWorkId"
|
||||
EnableMultiSelect="true" KeepCurrentSelection="true" Height="300px" Hidden="true" SortField="UnitWorkId" DataTextField="UnitWorkName"
|
||||
ShowBorder="true" ShowHeader="false" ForceFit="true"
|
||||
runat="server" EnableCheckBoxSelect="true">
|
||||
<Columns>
|
||||
<f:BoundField DataField="UnitWorkId" SortField="UnitWorkId" DataFormatString="{0}" Hidden="true"/>
|
||||
<f:BoundField DataField="UnitWorkName" SortField="UnitWorkName" DataFormatString="{0}" HeaderText="单位工程名称"/>
|
||||
</Columns>
|
||||
</f:Grid>
|
||||
</PopPanel>
|
||||
</f:DropDownBox>
|
||||
<f:DatePicker ID="txtInTime" runat="server" Label="入场时间" LabelAlign="Right" LabelWidth="110px" ShowRedStar="true" Required="true">
|
||||
</f:DatePicker>
|
||||
|
||||
<f:DropDownList ID="drpMainCNProfessional" runat="server" Label="专业" EnableEdit="true" LabelAlign="Right" LabelWidth="110px">
|
||||
</f:DropDownList>
|
||||
<f:RadioButtonList runat="server" ID="rblIsTrain" Label="培训" ShowRedStar="true" LabelWidth="110px" LabelAlign="Right">
|
||||
<f:RadioItem Text="是" Value="true" Selected="true"/>
|
||||
<f:RadioItem Text="否" Value="false"/>
|
||||
</f:RadioButtonList>
|
||||
<f:TextBox ID="txtCertificateCode" runat="server" Label="证书编号" LabelAlign="Right" MaxLength="20">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel ID="Panel4" runat="server" BoxFlex="3" ShowBorder="false" ShowHeader="false"
|
||||
MarginRight="5px" Layout="VBox">
|
||||
<Items>
|
||||
<f:TextBox ID="txtCardNo" runat="server" Label="卡号" MaxLength="50"
|
||||
LabelAlign="Right" AutoPostBack="true" OnTextChanged="TextBox_TextChanged">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtIdentityCard" runat="server" Label="证件号码" MaxLength="50" LabelAlign="Right" LabelWidth="110px"
|
||||
Required="true" ShowRedStar="true" OnBlur="txtIdentityCard_TextChanged" EnableBlurEvent="true">
|
||||
</f:TextBox>
|
||||
<f:RadioButtonList ID="rblSex" runat="server" Label="性别" LabelAlign="Right" Required="True" ShowRedStar="True">
|
||||
<f:RadioItem Value="1" Text="男" Selected="true"/>
|
||||
<f:RadioItem Value="2" Text="女"/>
|
||||
</f:RadioButtonList>
|
||||
<f:TextBox ID="txtTelephone" runat="server" Label="电话" LabelAlign="Right" MaxLength="50">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpPost" runat="server" Label="所属岗位" LabelAlign="Right" Required="True" ShowRedStar="True" EnableEdit="true" AutoSelectFirstItem="False" EmptyText="-请选择-">
|
||||
</f:DropDownList>
|
||||
<f:DropDownList ID="drpTeamGroup" runat="server" Label="所属班组" LabelAlign="Right">
|
||||
</f:DropDownList>
|
||||
<f:RadioButtonList ID="rblIsUsed" runat="server" Label="人员在场" LabelAlign="Right" Required="True" ShowRedStar="True">
|
||||
<f:RadioItem Value="True" Text="是"/>
|
||||
<f:RadioItem Value="False" Text="否"/>
|
||||
</f:RadioButtonList>
|
||||
<f:DatePicker ID="txtOutTime" runat="server" Label="出场时间" LabelAlign="Right">
|
||||
</f:DatePicker>
|
||||
<f:DatePicker ID="txtCertificateLimitTime" runat="server" Label="证书有效期" LabelAlign="Right">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Panel ID="Panel5" Title="面板1" BoxFlex="1" runat="server" ShowBorder="false" ShowHeader="false"
|
||||
Layout="VBox">
|
||||
<Items>
|
||||
<f:Image ID="imgPhoto" CssClass="userphoto" ImageUrl="~/res/images/blank_150.png"
|
||||
runat="server" BoxFlex="1">
|
||||
</f:Image>
|
||||
<f:FileUpload ID="filePhoto" CssClass="uploadbutton" runat="server" ButtonText="上传照片"
|
||||
ButtonOnly="true" AutoPostBack="true" OnFileSelected="filePhoto_FileSelected" Hidden="true">
|
||||
</f:FileUpload>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
</Items>
|
||||
|
||||
</f:Tab>
|
||||
</Tabs>
|
||||
</f:TabStrip>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
|
||||
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
</f:Form>
|
||||
|
||||
<f:Window ID="Window1" runat="server" Hidden="true" IsModal="false" Target="Parent"
|
||||
EnableMaximize="true" EnableResize="false" Title="弹出框" CloseAction="HidePostBack"
|
||||
EnableIFrame="true">
|
||||
</f:Window>
|
||||
<f:Window ID="WindowAtt" Title="附件" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
//F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,632 @@
|
||||
using BLL;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
public partial class CqmsPersonEdit : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string PersonId
|
||||
{
|
||||
get { return (string)ViewState["PersonId"]; }
|
||||
set { ViewState["PersonId"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </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)
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
////权限按钮方法
|
||||
if (Request.Params["type"] != "-1")
|
||||
{
|
||||
this.GetButtonPower();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Request.Params["Company"]))
|
||||
{
|
||||
this.btnSave.Hidden = true;
|
||||
}
|
||||
|
||||
this.ProjectId = Request.Params["ProjectId"];
|
||||
this.PersonId = Request.Params["PersonId"];
|
||||
this.InitDropDownList();
|
||||
this.drpIdcardType.SelectedValue = "SHENFEN_ZHENGJIAN";
|
||||
if (!string.IsNullOrEmpty(this.PersonId))
|
||||
{
|
||||
var person = BLL.PersonService.GetPersonById(this.PersonId);
|
||||
if (person != null)
|
||||
{
|
||||
this.ProjectId = person.ProjectId;
|
||||
if (!string.IsNullOrEmpty(person.Sex))
|
||||
{
|
||||
this.rblSex.SelectedValue = person.Sex;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.UnitId))
|
||||
{
|
||||
var unit = BLL.UnitService.GetUnitByUnitId(person.UnitId);
|
||||
if (unit != null)
|
||||
{
|
||||
this.drpUnitId.SelectedValue = unit.UnitId;
|
||||
drpUnitId_OnSelectedIndexChanged(null, null);
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.WorkAreaId))
|
||||
{
|
||||
txtWorkArea.Values = person.WorkAreaId.Split(',');
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.WorkPostId))
|
||||
{
|
||||
this.drpPost.SelectedValue = person.WorkPostId;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.TeamGroupId))
|
||||
{
|
||||
this.drpTeamGroup.SelectedValue = person.TeamGroupId;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.MainCNProfessionalId))
|
||||
{
|
||||
this.drpMainCNProfessional.SelectedValue = person.MainCNProfessionalId;
|
||||
}
|
||||
this.rblIsUsed.SelectedValue = person.IsUsed ? "True" : "False";
|
||||
this.txtCardNo.Text = person.CardNo;
|
||||
this.txtPersonName.Text = person.PersonName;
|
||||
this.txtIdentityCard.Text = person.IdentityCard;
|
||||
this.txtTelephone.Text = person.Telephone;
|
||||
if (person.InTime.HasValue)
|
||||
{
|
||||
this.txtInTime.Text = string.Format("{0:yyyy-MM-dd}", person.InTime);
|
||||
}
|
||||
|
||||
if (person.OutTime.HasValue)
|
||||
{
|
||||
this.txtOutTime.Text = string.Format("{0:yyyy-MM-dd}", person.OutTime);
|
||||
}
|
||||
|
||||
if (person.Birthday.HasValue)
|
||||
{
|
||||
this.txtBirthday.Text = string.Format("{0:yyyy-MM-dd}", person.Birthday);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.PhotoUrl))
|
||||
{
|
||||
imgPhoto.ImageUrl = ("~/" + person.PhotoUrl);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.IdcardType))
|
||||
{
|
||||
this.drpIdcardType.SelectedValue = person.IdcardType;
|
||||
}
|
||||
this.rblIsTrain.SelectedValue = person.IsTrain.HasValue && person.IsTrain == true ? "true" : "false";
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
this.txtInTime.Text = string.Format("{0:yyyy-MM-dd}", System.DateTime.Now);
|
||||
this.rblIsUsed.SelectedValue = "True";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 初始化下拉框
|
||||
/// </summary>
|
||||
private void InitDropDownList()
|
||||
{
|
||||
gvWorkArea.DataSource = BLL.UnitWorkService.GetUnitWorkLists(this.ProjectId);
|
||||
gvWorkArea.DataBind();//单位工程
|
||||
var postList = Funs.DB.Base_WorkPost.Where(x => x.IsCQMSCheck == true).OrderBy(x => x.WorkPostCode).ToList();
|
||||
drpPost.DataValueField = "WorkPostId";
|
||||
drpPost.DataTextField = "WorkPostName";
|
||||
drpPost.DataSource = postList;
|
||||
drpPost.DataBind();
|
||||
Funs.FineUIPleaseSelect(drpPost);
|
||||
CNProfessionalService.InitCNProfessionalDownList(this.drpMainCNProfessional, true);
|
||||
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
|
||||
BasicDataService.InitBasicDataProjectUnitDropDownList(this.drpIdcardType, "ZHENGJIAN_TYPE", true);
|
||||
}
|
||||
|
||||
#region 保存
|
||||
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.txtPersonName.Text))
|
||||
{
|
||||
ShowNotify("人员姓名不能为空!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.drpIdcardType.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择证件类型!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(this.txtIdentityCard.Text))
|
||||
{
|
||||
ShowNotify("证件号码不能为空!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (this.drpUnitId.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择所属单位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (this.drpPost.SelectedValue == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择所属岗位!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(this.txtInTime.Text))
|
||||
{
|
||||
ShowNotify("入场时间不能为空!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
SaveData();
|
||||
|
||||
var porject = BLL.ProjectService.GetProjectByProjectId(this.ProjectId);
|
||||
if (!string.IsNullOrWhiteSpace(porject.SubjectUnit) && !string.IsNullOrWhiteSpace(porject.SubjectProject))
|
||||
{
|
||||
//项目关联了总包单位项目,保存成功后自动推送至总包单位
|
||||
APIPersonSyncService.pushPersonLists(this.ProjectId, this.PersonId);
|
||||
}
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
|
||||
protected void SaveData()
|
||||
{
|
||||
Model.SitePerson_Person person = new Model.SitePerson_Person
|
||||
{
|
||||
Sex = this.rblSex.SelectedValue,
|
||||
ProjectId = this.ProjectId
|
||||
};
|
||||
if (!string.IsNullOrEmpty(this.drpUnitId.SelectedValue))
|
||||
{
|
||||
person.UnitId = this.drpUnitId.SelectedValue;
|
||||
}
|
||||
if (this.rblIsTrain.SelectedValue == "true")
|
||||
{
|
||||
person.IsTrain = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
person.IsTrain = false;
|
||||
}
|
||||
if (this.drpIdcardType.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
person.IdcardType = this.drpIdcardType.SelectedValue;
|
||||
}
|
||||
|
||||
if (this.drpTeamGroup.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
person.TeamGroupId = this.drpTeamGroup.SelectedValue;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(String.Join(",", this.txtWorkArea.Values)))
|
||||
{
|
||||
person.WorkAreaId = string.Join(",", txtWorkArea.Values);
|
||||
}
|
||||
|
||||
if (this.drpPost.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
person.WorkPostId = this.drpPost.SelectedValue;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.rblIsUsed.SelectedValue))
|
||||
{
|
||||
person.IsUsed = Convert.ToBoolean(this.rblIsUsed.SelectedValue);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtCardNo.Text.Trim()))
|
||||
{
|
||||
person.CardNo = this.txtCardNo.Text.Trim();
|
||||
}
|
||||
|
||||
person.PersonName = this.txtPersonName.Text.Trim();
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text))
|
||||
{
|
||||
person.IdentityCard = this.txtIdentityCard.Text.Trim();
|
||||
}
|
||||
|
||||
person.Telephone = this.txtTelephone.Text.Trim();
|
||||
if (!string.IsNullOrEmpty(this.txtInTime.Text.Trim()))
|
||||
{
|
||||
person.InTime = Convert.ToDateTime(this.txtInTime.Text.Trim());
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtOutTime.Text.Trim()))
|
||||
{
|
||||
person.OutTime = Convert.ToDateTime(this.txtOutTime.Text.Trim());
|
||||
}
|
||||
if (this.drpMainCNProfessional.SelectedValue != Const._Null)
|
||||
{
|
||||
person.MainCNProfessionalId = this.drpMainCNProfessional.SelectedValue;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtBirthday.Text.Trim()))
|
||||
{
|
||||
person.Birthday = Convert.ToDateTime(this.txtBirthday.Text.Trim());
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(imgPhoto.ImageUrl) && imgPhoto.ImageUrl != "~/res/images/blank_150.png")
|
||||
{
|
||||
person.PhotoUrl = imgPhoto.ImageUrl.Replace("~/", "");
|
||||
person.HeadImage = AttachFileService.SetImageToByteArray(Funs.RootPath + person.PhotoUrl);
|
||||
}
|
||||
else
|
||||
{
|
||||
person.PhotoUrl = null;
|
||||
person.HeadImage = null;
|
||||
}
|
||||
if (string.IsNullOrEmpty(PersonId))
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtCardNo.Text.Trim()))
|
||||
{
|
||||
int cardNoCount =
|
||||
BLL.PersonService.GetPersonCountByCardNo(this.ProjectId, this.txtCardNo.Text.Trim());
|
||||
|
||||
if (cardNoCount > 0)
|
||||
{
|
||||
ShowNotify("此卡号已存在,不能重复!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text))
|
||||
{
|
||||
person.IdentityCard = this.txtIdentityCard.Text.Trim();
|
||||
var identityCardCount = PersonService.GetPersonCountByIdentityCard(this.txtIdentityCard.Text.Trim(), this.CurrUser.LoginProjectId);
|
||||
if (identityCardCount != null)
|
||||
{
|
||||
var isUsed = string.Empty;
|
||||
if (person.IsUsed)
|
||||
{
|
||||
isUsed = "在岗";
|
||||
}
|
||||
else
|
||||
{
|
||||
isUsed = "离岗";
|
||||
}
|
||||
var unitName = UnitService.GetShortUnitNameByUnitId(identityCardCount.UnitId);
|
||||
Notify n = new Notify
|
||||
{
|
||||
Target = Target.Top,
|
||||
Message = "此身份证号已存在" + unitName + "单位下,不能重复,目前" + isUsed,
|
||||
MessageBoxIcon = MessageBoxIcon.Warning,
|
||||
PositionX = Position.Center,
|
||||
PositionY = Position.Top,
|
||||
DisplayMilliseconds = 10000,
|
||||
ShowHeader = false
|
||||
};
|
||||
n.Show();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.PersonId = SQLHelper.GetNewID(typeof(Model.SitePerson_Person));
|
||||
person.PersonId = this.PersonId;
|
||||
BLL.PersonService.AddPerson(person);
|
||||
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, person.PersonName, person.PersonId, BLL.Const.PersonListMenuId,
|
||||
BLL.Const.BtnAdd);
|
||||
}
|
||||
else
|
||||
{
|
||||
var getPerson = BLL.PersonService.GetPersonById(PersonId);
|
||||
if (getPerson != null)
|
||||
{
|
||||
person.FromPersonId = getPerson.FromPersonId;
|
||||
}
|
||||
|
||||
person.PersonId = PersonId;
|
||||
BLL.PersonService.UpdatePerson(person);
|
||||
//判断并更新项目用户的主副专业信息
|
||||
var projectUser =
|
||||
BLL.ProjectUserService.GetProjectUserByProjectIdAndIdentityCard(this.ProjectId,
|
||||
person.IdentityCard);
|
||||
if (projectUser != null)
|
||||
{
|
||||
projectUser.MainCNProfessionalId = person.MainCNProfessionalId;
|
||||
projectUser.ViceCNProfessionalId = person.ViceCNProfessionalId;
|
||||
BLL.ProjectUserService.UpdateProjectUser(projectUser);
|
||||
}
|
||||
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, person.PersonName, person.PersonId, BLL.Const.PersonListMenuId,
|
||||
BLL.Const.BtnModify);
|
||||
}
|
||||
///上传人脸库
|
||||
var getProject = ProjectService.GetProjectByProjectId(person.ProjectId);
|
||||
if (!string.IsNullOrEmpty(person.PhotoUrl) && getProject != null && getProject.IsFace == true)
|
||||
{
|
||||
Alert.ShowInParent(APIPersonService.PersonFace(person), MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
#region 上传照片
|
||||
|
||||
/// <summary>
|
||||
/// 上传照片
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void filePhoto_FileSelected(object sender, EventArgs e)
|
||||
{
|
||||
if (filePhoto.HasFile)
|
||||
{
|
||||
string fileName = filePhoto.ShortFileName;
|
||||
if (!ValidateFileType(fileName))
|
||||
{
|
||||
ShowNotify("无效的文件类型!");
|
||||
return;
|
||||
}
|
||||
|
||||
fileName = fileName.Replace(":", "_").Replace(" ", "_").Replace("\\", "_").Replace("/", "_");
|
||||
fileName = DateTime.Now.Ticks.ToString() + "_" + fileName;
|
||||
string url = "~/FileUpload/PersonBaseInfo/" + DateTime.Now.Year + "-" + DateTime.Now.Month + "/";
|
||||
filePhoto.SaveAs(Server.MapPath(url + fileName));
|
||||
imgPhoto.ImageUrl = url + fileName;
|
||||
// 清空文件上传组件
|
||||
filePhoto.Reset();
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 验证身份证 卡号是否存在
|
||||
|
||||
/// <summary>
|
||||
/// 验证身份证 卡号是否存在
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(this.txtCardNo.Text))
|
||||
{
|
||||
var q = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.CardNo == this.txtCardNo.Text.Trim() && (x.PersonId != this.PersonId || (this.PersonId == null && x.PersonId != null)));
|
||||
if (q != null)
|
||||
{
|
||||
ShowNotify("输入的卡号已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text))
|
||||
{
|
||||
var q2 = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.IdentityCard == this.txtIdentityCard.Text.Trim() && (x.PersonId != this.PersonId || (this.PersonId == null && x.PersonId != null)));
|
||||
if (q2 != null)
|
||||
{
|
||||
var isUsed = string.Empty;
|
||||
if (q2.IsUsed)
|
||||
{
|
||||
isUsed = "在岗";
|
||||
}
|
||||
else
|
||||
{
|
||||
isUsed = "离岗";
|
||||
}
|
||||
var unitName = UnitService.GetShortUnitNameByUnitId(q2.UnitId);
|
||||
Notify n = new Notify
|
||||
{
|
||||
Target = Target.Top,
|
||||
Message = "此身份证号已存在" + unitName + "单位下,不能重复,目前" + isUsed,
|
||||
MessageBoxIcon = MessageBoxIcon.Warning,
|
||||
PositionX = Position.Center,
|
||||
PositionY = Position.Top,
|
||||
DisplayMilliseconds = 10000,
|
||||
ShowHeader = false
|
||||
};
|
||||
n.Show();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 判断按钮权限
|
||||
|
||||
/// <summary>
|
||||
/// 判断按钮权限
|
||||
/// </summary>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
if (Request.Params["value"] == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId,
|
||||
BLL.Const.PersonListMenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnSave))
|
||||
{
|
||||
this.btnSave.Hidden = false;
|
||||
this.filePhoto.Hidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnQR_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.txtIdentityCard.Text.Trim()))
|
||||
{
|
||||
Alert.ShowInTop("身份证号码不能为空!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(this.txtPersonName.Text))
|
||||
{
|
||||
ShowNotify("人员姓名不能为空!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(this.txtInTime.Text))
|
||||
{
|
||||
ShowNotify("入场时间不能为空!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(this.PersonId))
|
||||
{
|
||||
this.SaveData();
|
||||
}
|
||||
|
||||
string strCode = "person$" + this.txtIdentityCard.Text.Trim();
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(
|
||||
String.Format("~/Controls/SeeQRImage.aspx?PersonId={0}&strCode={1}", this.PersonId, strCode), "二维码查看",
|
||||
400, 400));
|
||||
}
|
||||
|
||||
#region 附件上传
|
||||
|
||||
/// <summary>
|
||||
/// 上传附件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnAttachUrl4_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.PersonId))
|
||||
{
|
||||
SaveData();
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/PersonBaseInfo&menuId={1}&strParam=4",
|
||||
this.PersonId, BLL.Const.PersonListMenuId)));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
protected void txtIdentityCard_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
bool isok = true;
|
||||
if (!string.IsNullOrEmpty(this.txtIdentityCard.Text))
|
||||
{
|
||||
string idCard = this.txtIdentityCard.Text.Trim();
|
||||
var q2 = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId && x.IdentityCard == idCard && (x.PersonId != this.PersonId || (this.PersonId == null && x.PersonId != null)));
|
||||
if (q2 != null)
|
||||
{
|
||||
isok = false;
|
||||
var isUsed = string.Empty;
|
||||
if (q2.IsUsed)
|
||||
{
|
||||
isUsed = "在岗";
|
||||
}
|
||||
else
|
||||
{
|
||||
isUsed = "离岗";
|
||||
}
|
||||
var unitName = UnitService.GetShortUnitNameByUnitId(q2.UnitId);
|
||||
Notify n = new Notify
|
||||
{
|
||||
Target = Target.Top,
|
||||
Message = "此身份证号已存在" + unitName + "单位下,不能重复,目前" + isUsed,
|
||||
MessageBoxIcon = MessageBoxIcon.Warning,
|
||||
PositionX = Position.Center,
|
||||
PositionY = Position.Top,
|
||||
DisplayMilliseconds = 10000,
|
||||
ShowHeader = false
|
||||
};
|
||||
n.Show();
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
if (this.drpIdcardType.SelectedValue == "SHENFEN_ZHENGJIAN")
|
||||
{
|
||||
if (!IDCardValid.CheckIDCard(idCard))
|
||||
{
|
||||
isok = false;
|
||||
ShowNotify("输入的身份证号码有误!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
if (isok)
|
||||
{
|
||||
string birthDateStr = "";
|
||||
if (idCard.Length == 18) //如果是新的二代身份证,直接取中间8位日期
|
||||
{
|
||||
birthDateStr = idCard.Substring(6, 8);
|
||||
}
|
||||
else if (idCard.Length == 15) //如果是老的一代身份证,取中间6位日期
|
||||
{
|
||||
birthDateStr = "19" + idCard.Substring(6, 6);
|
||||
}
|
||||
|
||||
var Birthday = DateTime.ParseExact(birthDateStr, "yyyyMMdd", null);
|
||||
this.txtBirthday.SelectedDate = Birthday;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void drpUnitId_OnSelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
TeamGroupService.InitTeamGroupProjectUnitDropDownList(this.drpTeamGroup, this.ProjectId,
|
||||
this.drpUnitId.SelectedValue, true);
|
||||
}
|
||||
|
||||
protected void txtPersonName_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
var model = (from x in Funs.DB.Sys_User where x.UserName == txtPersonName.Text.Trim() select x)
|
||||
.FirstOrDefault();
|
||||
if (model != null)
|
||||
{
|
||||
txtPersonName.Text = model.UserName;
|
||||
txtTelephone.Text = model.Telephone;
|
||||
txtIdentityCard.Text = model.IdentityCard;
|
||||
txtIdentityCard_TextChanged(null, null);
|
||||
rblSex.SelectedValue = model.Sex == "1" ? "1" : "2";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,359 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.CQMS.Comprehensive
|
||||
{
|
||||
|
||||
|
||||
public partial class CqmsPersonEdit
|
||||
{
|
||||
|
||||
/// <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>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// btnAttachUrl4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAttachUrl4;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnQR 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnQR;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnClose;
|
||||
|
||||
/// <summary>
|
||||
/// Panel3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel3;
|
||||
|
||||
/// <summary>
|
||||
/// TabStrip1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TabStrip TabStrip1;
|
||||
|
||||
/// <summary>
|
||||
/// Tab1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Tab Tab1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel2;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// txtPersonName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtPersonName;
|
||||
|
||||
/// <summary>
|
||||
/// drpIdcardType 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpIdcardType;
|
||||
|
||||
/// <summary>
|
||||
/// txtBirthday 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtBirthday;
|
||||
|
||||
/// <summary>
|
||||
/// drpUnitId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpUnitId;
|
||||
|
||||
/// <summary>
|
||||
/// txtWorkArea 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownBox txtWorkArea;
|
||||
|
||||
/// <summary>
|
||||
/// gvWorkArea 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid gvWorkArea;
|
||||
|
||||
/// <summary>
|
||||
/// txtInTime 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtInTime;
|
||||
|
||||
/// <summary>
|
||||
/// drpMainCNProfessional 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpMainCNProfessional;
|
||||
|
||||
/// <summary>
|
||||
/// rblIsTrain 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rblIsTrain;
|
||||
|
||||
/// <summary>
|
||||
/// txtCertificateCode 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCertificateCode;
|
||||
|
||||
/// <summary>
|
||||
/// Panel4 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel4;
|
||||
|
||||
/// <summary>
|
||||
/// txtCardNo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtCardNo;
|
||||
|
||||
/// <summary>
|
||||
/// txtIdentityCard 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtIdentityCard;
|
||||
|
||||
/// <summary>
|
||||
/// rblSex 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rblSex;
|
||||
|
||||
/// <summary>
|
||||
/// txtTelephone 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtTelephone;
|
||||
|
||||
/// <summary>
|
||||
/// drpPost 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpPost;
|
||||
|
||||
/// <summary>
|
||||
/// drpTeamGroup 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpTeamGroup;
|
||||
|
||||
/// <summary>
|
||||
/// rblIsUsed 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rblIsUsed;
|
||||
|
||||
/// <summary>
|
||||
/// txtOutTime 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtOutTime;
|
||||
|
||||
/// <summary>
|
||||
/// txtCertificateLimitTime 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtCertificateLimitTime;
|
||||
|
||||
/// <summary>
|
||||
/// Panel5 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel5;
|
||||
|
||||
/// <summary>
|
||||
/// imgPhoto 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Image imgPhoto;
|
||||
|
||||
/// <summary>
|
||||
/// filePhoto 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.FileUpload filePhoto;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,7 @@
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="机具报验" EnableCollapse="true" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
runat="server" BoxFlex="1" DataKeyNames="InspectionMachineId" AllowCellEditing="true" ClicksToEdit="2" DataIDField="InspectionMachineId" AllowSorting="true" SortField="InspectionMachineCode"
|
||||
SortDirection="DESC" EnableColumnLines="true" ForceFit="true" AllowPaging="true" IsDatabasePaging="true" PageSize="10"
|
||||
SortDirection="DESC" EnableColumnLines="true" ForceFit="true" AllowPaging="true" IsDatabasePaging="true" PageSize="10" EnableCheckBoxSelect="true"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
@@ -43,11 +43,24 @@
|
||||
<f:ListItem Value="施工" Text="施工"></f:ListItem>
|
||||
<f:ListItem Value="计量" Text="计量"></f:ListItem>
|
||||
</f:DropDownList>
|
||||
<f:RadioButtonList runat="server" ID="ckIsOnSite" AutoPostBack="true" Label="在场状态" LabelWidth="90px" LabelAlign="Right"
|
||||
OnSelectedIndexChanged="TextBox_TextChanged" Width="300px">
|
||||
<f:RadioItem Text="全部" Value=""/>
|
||||
<f:RadioItem Text="在场" Value="1" Selected="true"/>
|
||||
<f:RadioItem Text="已退场" Value="0"/>
|
||||
</f:RadioButtonList>
|
||||
<f:RadioButtonList runat="server" ID="rbSource" Width="220px" Label="来源" LabelWidth="50px"
|
||||
AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged" AutoColumnWidth="true">
|
||||
<f:RadioItem Text="全部" Value="0" Selected="true"/>
|
||||
<f:RadioItem Text="系统内单位" Value="1"/>
|
||||
</f:RadioButtonList>
|
||||
|
||||
<f:ToolbarFill runat="server"></f:ToolbarFill>
|
||||
<f:Button ID="btnSearch" Icon="SystemSearch"
|
||||
EnablePostBack="true" runat="server" OnClick="btnSearch_Click" ToolTip="查询" Text="查询">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOutSite" ToolTip="批量退场" Icon="CogDelete" runat="server" Hidden="true" Text="批量退场" OnClick="btnOutSite_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnNew" Icon="Add" EnablePostBack="true" runat="server" OnClick="btnNew_Click" ToolTip="新增" Hidden="true" Text="新增">
|
||||
</f:Button>
|
||||
<f:Button ID="btnImport" ToolTip="导入" Icon="PackageIn" runat="server" OnClick="btnImport_Click" Hidden="true" Text="导入">
|
||||
@@ -67,6 +80,9 @@
|
||||
<f:RenderField ColumnID="InspectionMachineCode" DataField="InspectionMachineCode" FieldType="String" HeaderText="报验编号" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="120px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="SourceDes" DataField="SourceDes" FieldType="String" HeaderText="来源说明" HeaderTextAlign="Center"
|
||||
TextAlign="Left" Width="120px">
|
||||
</f:RenderField>
|
||||
<f:RenderField ColumnID="InspectionMachineName" DataField="InspectionMachineName" FieldType="String" HeaderText="名称" TextAlign="Center"
|
||||
HeaderTextAlign="Center" Width="120px">
|
||||
</f:RenderField>
|
||||
|
||||
@@ -83,7 +83,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||
{
|
||||
return;
|
||||
}
|
||||
string strSql = @"select InspectionMachineId, InspectionMachineCode, U.UnitName,CN.ProfessionalName ,Status,
|
||||
string strSql = @"select InspectionMachineId, InspectionMachineCode, U.UnitName,CN.ProfessionalName ,Status,C.SourceDes,
|
||||
InspectionMachineName, SpecificationModel, NextTestDate, TestCycle, C.InspectionDate,
|
||||
InspectionDate CompileDate, (CASE WHEN IsVerification=1 THEN '是' WHEN IsVerification=0 THEN '否' ELSE '' END) AS IsVerification,(CASE WHEN IsCheckOK=1 THEN '是' WHEN IsCheckOK=0 THEN '否' ELSE '' END) AS IsCheckOK, InspectionType, LeaveDate, UnitsCount
|
||||
from Comprehensive_InspectionMachine C
|
||||
@@ -107,6 +107,18 @@ namespace FineUIPro.Web.Comprehensive
|
||||
strSql += " AND C.InspectionType=@InspectionType";
|
||||
listStr.Add(new SqlParameter("@InspectionType", sdrpType.SelectedValue));
|
||||
}
|
||||
string isOnSite = this.ckIsOnSite.SelectedValue;
|
||||
if (!string.IsNullOrWhiteSpace(isOnSite))
|
||||
{
|
||||
strSql += " AND C.IsOnSite = @IsOnSite ";
|
||||
listStr.Add(new SqlParameter("@IsOnSite", this.ckIsOnSite.SelectedValue));
|
||||
}
|
||||
if (this.rbSource.SelectedValue == "1")
|
||||
{
|
||||
strSql += " AND C.SourceDes LIKE @SourceDes ";
|
||||
listStr.Add(new SqlParameter("@SourceDes", "%#%"));
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
@@ -162,7 +174,54 @@ namespace FineUIPro.Web.Comprehensive
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 退场
|
||||
|
||||
/// <summary>
|
||||
/// 批量退场按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnOutSite_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
int succ = 0;
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var rows = BLL.InspectionMachineService.GetInspectionMachineById(rowID);
|
||||
if (rows != null && rows.IsOnSite != false)
|
||||
{
|
||||
rows.IsOnSite = false;
|
||||
rows.LeaveDate = rows.LeaveDate != null ? rows.LeaveDate : DateTime.Now;
|
||||
BLL.InspectionMachineService.UpdateInspectionMachine(rows);
|
||||
succ++;
|
||||
}
|
||||
}
|
||||
BindGrid();
|
||||
ShowNotify("操作完成,已退场" + succ + "条", MessageBoxIcon.Success);
|
||||
}
|
||||
else
|
||||
{
|
||||
ShowNotify("请选择需要退场的机具设备", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 关闭弹出窗口
|
||||
/// <summary>
|
||||
@@ -271,6 +330,7 @@ namespace FineUIPro.Web.Comprehensive
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
this.btnOutSite.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
|
||||
+107
-80
@@ -1,10 +1,10 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <自动生成>
|
||||
// 此代码由工具生成。
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// 对此文件的更改可能导致不正确的行为,如果
|
||||
// 重新生成代码,则所做更改将丢失。
|
||||
// </自动生成>
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.Comprehensive
|
||||
@@ -15,227 +15,254 @@ namespace FineUIPro.Web.Comprehensive
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// form1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// PageManager1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
/// <summary>
|
||||
/// Panel1 控件。
|
||||
/// Panel1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
/// <summary>
|
||||
/// panelLeftRegion 控件。
|
||||
/// panelLeftRegion control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelLeftRegion;
|
||||
|
||||
/// <summary>
|
||||
/// ContentPanel1 控件。
|
||||
/// ContentPanel1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ContentPanel ContentPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// ucTree 控件。
|
||||
/// ucTree control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Web.Controls.UnitProjectTControl ucTree;
|
||||
|
||||
/// <summary>
|
||||
/// panelCenterRegion 控件。
|
||||
/// panelCenterRegion control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel panelCenterRegion;
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// Grid1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
/// <summary>
|
||||
/// ToolSearch 控件。
|
||||
/// ToolSearch control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar ToolSearch;
|
||||
|
||||
/// <summary>
|
||||
/// sdrpUnitId 控件。
|
||||
/// sdrpUnitId control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList sdrpUnitId;
|
||||
|
||||
/// <summary>
|
||||
/// sdrpCNProfessional 控件。
|
||||
/// sdrpCNProfessional control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList sdrpCNProfessional;
|
||||
|
||||
/// <summary>
|
||||
/// sdrpType 控件。
|
||||
/// sdrpType control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList sdrpType;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch 控件。
|
||||
/// ckIsOnSite control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList ckIsOnSite;
|
||||
|
||||
/// <summary>
|
||||
/// rbSource control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.RadioButtonList rbSource;
|
||||
|
||||
/// <summary>
|
||||
/// btnSearch control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSearch;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// btnOutSite control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOutSite;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnImport 控件。
|
||||
/// btnImport control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnImport;
|
||||
|
||||
/// <summary>
|
||||
/// lblPageIndex 控件。
|
||||
/// lblPageIndex control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblPageIndex;
|
||||
|
||||
/// <summary>
|
||||
/// lbtnFileUrl 控件。
|
||||
/// lbtnFileUrl control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtnFileUrl;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// ToolbarText1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// ddlPageSize control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// Window1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// Window2 控件。
|
||||
/// Window2 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window2;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// WindowAtt control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// Menu1 control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuModify 控件。
|
||||
/// btnMenuModify control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuModify;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDel 控件。
|
||||
/// btnMenuDel control.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// Auto-generated field.
|
||||
/// To modify move field declaration from designer file to code-behind file.
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDel;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user