升级
This commit is contained in:
@@ -1,105 +1,148 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PhysicalExamination.aspx.cs" Inherits="FineUIPro.Web.HSSE.OccupationHealth.PhysicalExamination" %>
|
||||
|
||||
<%@ Register Src="~/Controls/UnitProjectTControl.ascx" TagName="UnitProjectTControl" TagPrefix="uc1" %>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head id="Head1" runat="server">
|
||||
<title>体检管理</title>
|
||||
<link href="~/res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<title>职业健康体检</title>
|
||||
<link href="~/res/css/common.css" rel="stylesheet" type="text/css"/>
|
||||
</head>
|
||||
<body>
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
|
||||
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<form id="form1" runat="server">
|
||||
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel2" runat="server"/>
|
||||
<f:Panel ID="Panel2" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="体检管理" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="FileId" DataIDField="FileId" AllowSorting="true"
|
||||
SortField="ProjectCode,FileCode" SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true"
|
||||
IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" ForceFit="true"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="编号" ID="txtFileCode" EmptyText="输入查询条件"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
|
||||
LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="名称" ID="txtFileName" EmptyText="输入查询条件"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
|
||||
LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpProject" runat="server" Label="所属项目" EnableEdit="true" Hidden="true" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged">
|
||||
</f:DropDownList>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
<f:Button ID="btnNew" ToolTip="新增" Icon="Add" EnablePostBack="false" Hidden="true" Text="新增"
|
||||
runat="server">
|
||||
</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 Width="100px" ColumnID="FileCode" DataField="FileCode"
|
||||
SortField="FileCode" FieldType="String" HeaderText="编号" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="380px" ColumnID="ProjectName" DataField="ProjectName"
|
||||
SortField="ProjectName" FieldType="String" HeaderText="项目" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="FileName" DataField="FileName"
|
||||
SortField="FileName" FieldType="String" HeaderText="名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="CompileManName" DataField="CompileManName"
|
||||
SortField="CompileManName" FieldType="String" HeaderText="整理人" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="100px" ColumnID="CompileDate" DataField="CompileDate"
|
||||
SortField="CompileDate" 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>
|
||||
<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 ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
|
||||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch" AutoScroll="true">
|
||||
<Items>
|
||||
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="职业健康体检" EnableCollapse="true"
|
||||
runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="PersonId"
|
||||
AllowCellEditing="true" ClicksToEdit="2" AllowSorting="true"
|
||||
SortField="UnitCode,WorkPostCode,PersonName" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true"
|
||||
IsDatabasePaging="true" OnPageIndexChange="Grid1_PageIndexChange"
|
||||
EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick" EnableTextSelection="True">
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:TextBox runat="server" Label="编号" ID="txtCardNo" EmptyText="输入查询条件"
|
||||
AutoPostBack="true" OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px"
|
||||
LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpUnitId" runat="server" Label="单位" AutoPostBack="true" OnSelectedIndexChanged="TextBox_TextChanged" LabelWidth="70px" Width="250px">
|
||||
</f:DropDownList>
|
||||
<f:TextBox runat="server" Label="人员姓名" ID="txtPersonName" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px" LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:TextBox runat="server" Label="岗位" ID="txtWorkPostName" EmptyText="输入查询条件" AutoPostBack="true"
|
||||
OnTextChanged="TextBox_TextChanged" Width="250px" LabelWidth="80px" LabelAlign="right">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpIsUsedName" runat="server" Label="是否在岗" EnableEdit="true" OnSelectedIndexChanged="TextBox_TextChanged"
|
||||
AutoPostBack="true" Width="200px" LabelWidth="100px" LabelAlign="right" ForceSelection="false">
|
||||
<f:ListItem Value="是" Text="是"/>
|
||||
<f:ListItem Value="否" Text="否"/>
|
||||
</f:DropDownList>
|
||||
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||
</f:ToolbarFill>
|
||||
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" ToolTip="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
<Columns>
|
||||
<f:RenderField HeaderText="序号" ColumnID="Index" DataField="Index" SortField="Index"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="50px">
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField HeaderText="项目名称" ColumnID="ShortName" DataField="ShortName" SortField="ShortName" ExpandUnusedSpace="true"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="250px">
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField HeaderText="单位名称" ColumnID="UnitName" DataField="UnitName" SortField="UnitName" ExpandUnusedSpace="true"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="250px">
|
||||
</f:RenderField>
|
||||
|
||||
<f:RenderField Width="180px" ColumnID="PersonName" DataField="PersonName" SortField="PersonName"
|
||||
FieldType="String" HeaderText="姓名" HeaderTextAlign="Center"
|
||||
TextAlign="Center">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="班组" ColumnID="TeamGroupName" DataField="TeamGroupName" SortField="TeamGroupName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="150px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="岗位名称" ColumnID="WorkPostName" DataField="WorkPostName" SortField="WorkPostName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="150px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="性别" ColumnID="Sex" DataField="Sex" SortField="Sex"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="150px">
|
||||
</f:RenderField>
|
||||
<%--<f:RenderField HeaderText="学历" ColumnID="DictName" DataField="DictName" SortField="DictName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="150px">
|
||||
</f:RenderField>
|
||||
<f:RenderField HeaderText="所学专业" ColumnID="Major" DataField="Major" SortField="Major"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="150px">
|
||||
</f:RenderField>--%>
|
||||
|
||||
<f:RenderField HeaderText="在场" ColumnID="IsUsedName" DataField="IsUsedName" SortField="IsUsedName"
|
||||
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="100px">
|
||||
</f:RenderField>
|
||||
|
||||
<f:TemplateField ColumnID="attWindow" Width="250px" HeaderText="体检证明" HeaderTextAlign="Center" TextAlign="Left">
|
||||
<ItemTemplate>
|
||||
<asp:LinkButton ID="lbtnFileUrl" runat="server" CssClass="ItemLink"
|
||||
Text='<%# BLL.AttachFileService.GetBtnFileUrl(Eval("PersonId") + "#3") %>' ToolTip="附件查看">
|
||||
</asp:LinkButton>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu"/>
|
||||
<f:Listener Event="dataload" Handler="onGridDataLoad"/>
|
||||
</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>
|
||||
<f:Label runat="server" ID="lbAllPersonNum" CssClass="customlabel"/>
|
||||
</PageItems>
|
||||
</f:Grid>
|
||||
</Items>
|
||||
</f:Panel>
|
||||
|
||||
</Items>
|
||||
</f:Panel>
|
||||
<f:Window ID="Window1" Title="编辑体检管理" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="1024px" Height="600px">
|
||||
<f:Window ID="Window1" Title="职业健康体检" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="true" runat="server" IsModal="true" Width="1100px" OnClose="Window1_Close"
|
||||
Height="700px">
|
||||
</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">
|
||||
Target="Parent" EnableResize="true" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" Icon="Pencil" EnablePostBack="true"
|
||||
Hidden="true" runat="server" Text="编辑">
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" Icon="TableEdit" EnablePostBack="true"
|
||||
Hidden="true" runat="server" Text="编辑">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
Hidden="true" Icon="Delete" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除">
|
||||
Hidden="true" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Icon="Delete" Text="删除">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
// 返回false,来阻止浏览器右键菜单
|
||||
function onRowContextMenu(event, rowId) {
|
||||
@@ -110,6 +153,14 @@
|
||||
function reloadGrid() {
|
||||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
function onGridDataLoad(event) {
|
||||
this.mergeColumns(['Index', 'ShortName','PersonName', 'UnitName', 'WorkPostName', 'Sex'
|
||||
, 'DictName'
|
||||
, 'Major'
|
||||
, 'IsUsedName', 'attWindow'], {
|
||||
dependsFirst: true
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
@@ -11,7 +11,24 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
{
|
||||
public partial class PhysicalExamination : PageBase
|
||||
{
|
||||
#region 项目主键
|
||||
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get { return (string)ViewState["ProjectId"]; }
|
||||
set { ViewState["ProjectId"] = value; }
|
||||
}
|
||||
|
||||
public string MenuId = Const.CompanySafePersonMenuId;
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 加载
|
||||
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
@@ -21,73 +38,145 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
this.btnNew.OnClientClick = Window1.GetShowReference("PhysicalExaminationEdit.aspx") + "return false;";
|
||||
if (this.CurrUser != null && this.CurrUser.PageSize.HasValue)
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]) &&
|
||||
Request.Params["projectId"] != this.CurrUser.LoginProjectId)
|
||||
{
|
||||
Grid1.PageSize = this.CurrUser.PageSize.Value;
|
||||
this.ProjectId = Request.Params["projectId"];
|
||||
}
|
||||
this.ddlPageSize.SelectedValue = Grid1.PageSize.ToString();
|
||||
|
||||
this.ucTree.UnitId = this.CurrUser.UnitId;
|
||||
this.ucTree.ProjectId = this.ProjectId;
|
||||
BLL.UnitService.InitUnitDropDownList(this.drpUnitId, this.ProjectId, true);
|
||||
if (BLL.ProjectUnitService.GetProjectUnitTypeByProjectIdUnitId(this.ProjectId, this.CurrUser.UnitId))
|
||||
{
|
||||
this.drpUnitId.SelectedValue = this.CurrUser.UnitId;
|
||||
this.drpUnitId.Enabled = false;
|
||||
}
|
||||
|
||||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
this.BindGrid();
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId) &&
|
||||
CommonService.GetThisUnitId() != Const.CncecFccId)
|
||||
{
|
||||
MenuId = Const.SafePersonQualityMenuId;
|
||||
this.panelLeftRegion.Hidden = true;
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
btnMenuEdit.Hidden = true;
|
||||
btnMenuDelete.Hidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region GV绑定数据
|
||||
protected void changeTree(object sender, EventArgs e)
|
||||
{
|
||||
this.ProjectId = this.ucTree.ProjectId;
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 绑定数据
|
||||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT PhysicalExamination.FileId,PhysicalExamination.FileCode,PhysicalExamination.FileName,CompileManUser.UserName AS CompileManName,PhysicalExamination.CompileDate,Project.ProjectName,Project.ProjectCode"
|
||||
+ @" ,(CASE WHEN PhysicalExamination.States = " + BLL.Const.State_0 + " OR PhysicalExamination.States IS NULL THEN '待['+OperateUser.UserName+']提交' WHEN PhysicalExamination.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperateUser.UserName+']办理' END) AS FlowOperateName"
|
||||
+ @" FROM OccupationHealth_PhysicalExamination AS PhysicalExamination"
|
||||
+ @" LEFT JOIN Sys_FlowOperate AS FlowOperate ON PhysicalExamination.FileId=FlowOperate.DataId AND FlowOperate.IsClosed <> 1"
|
||||
+ @" LEFT JOIN Sys_User AS OperateUser ON FlowOperate.OperaterId=OperateUser.UserId "
|
||||
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON PhysicalExamination.FileId=CodeRecords.DataId "
|
||||
+ @" LEFT JOIN Base_Project AS Project ON PhysicalExamination.ProjectId=Project.ProjectId "
|
||||
+ @" LEFT JOIN Sys_User AS CompileManUser ON PhysicalExamination.CompileMan =CompileManUser.UserId WHERE 1=1 ";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
if (string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) ///总部查看
|
||||
{
|
||||
strSql += " AND PhysicalExamination.States = @States"; ///状态为已完成
|
||||
listStr.Add(new SqlParameter("@States", BLL.Const.State_2));
|
||||
if (this.drpProject.SelectedValue != null && this.drpProject.SelectedValue != BLL.Const._Null)
|
||||
var db = Funs.DB;
|
||||
var query = (
|
||||
from person in db.SitePerson_Person
|
||||
join post in db.Base_WorkPost on person.WorkPostId equals post.WorkPostId into posts
|
||||
from post in posts.DefaultIfEmpty()
|
||||
join unit in db.Base_Unit on person.UnitId equals unit.UnitId into units
|
||||
from unit in units.DefaultIfEmpty()
|
||||
join edu in db.RealName_BasicData on person.EduLevel equals edu.DictCode into edus
|
||||
from edu in edus.DefaultIfEmpty()
|
||||
join project in db.Base_Project on person.ProjectId equals project.ProjectId into projects
|
||||
from project in projects.DefaultIfEmpty()
|
||||
join att in db.AttachFile on (person.PersonId + "#3") equals att.ToKeyId into atts
|
||||
from att in atts.DefaultIfEmpty()
|
||||
join teamGroup in db.ProjectData_TeamGroup on person.TeamGroupId equals teamGroup.TeamGroupId into teamGroups
|
||||
from teamGroup in teamGroups.DefaultIfEmpty()
|
||||
where person.ProjectId == this.ProjectId
|
||||
&& att.AttachFileId != null
|
||||
select new
|
||||
{
|
||||
strSql += " AND PhysicalExamination.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue));
|
||||
person.ProjectId,
|
||||
person.UnitId,
|
||||
person.PersonId,
|
||||
person.PersonName,
|
||||
person.Birthday,
|
||||
Sex = person.Sex == "1" ? "男" : person.Sex == "2" ? "女" : "",
|
||||
edu.DictName,
|
||||
unit.UnitName,
|
||||
post.WorkPostName,
|
||||
person.Major,
|
||||
person.SafeWorkingYears,
|
||||
person.WorkingYears,
|
||||
person.InTime,
|
||||
person.IsUsed,
|
||||
IsUsedName = person.IsUsed == true ? "是" : "否",
|
||||
person.OutTime,
|
||||
ProjectUnitId = project.UnitId,
|
||||
project.ShortName,
|
||||
TeamGroupName = teamGroup.TeamGroupName,
|
||||
}
|
||||
).Distinct();
|
||||
|
||||
if (!string.IsNullOrEmpty(ProjectId) && ProjectId != Const._Null)
|
||||
{
|
||||
query = query.Where(e => e.ProjectId == ProjectId);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (this.ucTree.UnitId != CommonService.GetThisUnitId())
|
||||
{
|
||||
query = query.Where(e => e.ProjectUnitId == this.ucTree.UnitId).OrderBy(e => e.ShortName)
|
||||
.ThenBy(e => e.UnitId);
|
||||
}
|
||||
}
|
||||
else //现场查看
|
||||
{
|
||||
strSql += " AND PhysicalExamination.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtFileCode.Text.Trim()))
|
||||
{
|
||||
strSql += " AND FileCode LIKE @FileCode";
|
||||
listStr.Add(new SqlParameter("@FileCode", "%" + this.txtFileCode.Text.Trim() + "%"));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtFileName.Text.Trim()))
|
||||
{
|
||||
strSql += " AND PhysicalExamination.FileName LIKE @FileName";
|
||||
listStr.Add(new SqlParameter("@FileName", "%" + this.txtFileName.Text.Trim() + "%"));
|
||||
}
|
||||
|
||||
SqlParameter[] parameter = listStr.ToArray();
|
||||
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
|
||||
|
||||
Grid1.RecordCount = tb.Rows.Count;
|
||||
tb = GetFilteredTable(Grid1.FilteredData, tb);
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
Grid1.DataBind();
|
||||
// 添加计数的序号
|
||||
var groupedQuery = query.ToList().GroupBy(p => p.PersonId).SelectMany((group, index) =>
|
||||
group.Select((person, personIndex) => new
|
||||
{
|
||||
Index = index + 1,
|
||||
person.PersonId,
|
||||
person.PersonName,
|
||||
person.Birthday,
|
||||
person.Sex,
|
||||
person.DictName,
|
||||
person.UnitName,
|
||||
person.WorkPostName,
|
||||
person.Major,
|
||||
person.SafeWorkingYears,
|
||||
person.WorkingYears,
|
||||
person.InTime,
|
||||
person.IsUsed,
|
||||
person.IsUsedName,
|
||||
person.OutTime,
|
||||
person.ShortName,
|
||||
person.TeamGroupName
|
||||
})).ToList();
|
||||
|
||||
|
||||
this.Grid1.RecordCount = groupedQuery.Select(p => p.PersonId).Distinct().Count();
|
||||
this.lbAllPersonNum.Text = "合计:共" + groupedQuery
|
||||
.Select(g => g.Index)
|
||||
.DefaultIfEmpty(0) // 当集合为空时提供默认值0
|
||||
.Max()
|
||||
+ "人";
|
||||
var table = groupedQuery.OrderBy(p => p.Index).Skip(this.Grid1.PageIndex * this.Grid1.PageSize)
|
||||
.Take(this.Grid1.PageSize).ToList();
|
||||
this.Grid1.DataSource = table;
|
||||
this.Grid1.DataBind();
|
||||
}
|
||||
|
||||
#region 分页 排序
|
||||
/// <summary>
|
||||
/// 改变索引事件
|
||||
/// </summary>
|
||||
@@ -95,7 +184,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
/// <param name="e"></param>
|
||||
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -106,7 +195,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||
{
|
||||
this.Grid1.PageSize = Convert.ToInt32(this.ddlPageSize.SelectedValue);
|
||||
BindGrid();
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -118,10 +207,11 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
|
||||
#region 查询
|
||||
|
||||
/// <summary>
|
||||
/// 查询
|
||||
/// </summary>
|
||||
@@ -131,9 +221,21 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
{
|
||||
this.BindGrid();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 关闭导入弹出窗口
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
||||
{
|
||||
BindGrid();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 编辑
|
||||
|
||||
/// <summary>
|
||||
/// 双击事件
|
||||
/// </summary>
|
||||
@@ -164,50 +266,30 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
Alert.ShowInTop("请至少选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
string id = Grid1.SelectedRowID;
|
||||
var OccupationHealth = BLL.PhysicalExaminationService.GetPhysicalExaminationById(id);
|
||||
if (OccupationHealth != null)
|
||||
|
||||
string id = Grid1.SelectedRow.DataKeys[0].ToString();
|
||||
var person = BLL.PersonService.GetPersonById(id);
|
||||
if (person != null)
|
||||
{
|
||||
if (this.btnMenuEdit.Hidden) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面
|
||||
if (!string.IsNullOrEmpty(ProjectId))
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PhysicalExaminationView.aspx?FileId={0}", id, "查看 - ")));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format(
|
||||
"PhysicalExaminationEdit.aspx?ProjectId={0}&&Type={1}&&PersonId={2}&&UnitId={3}", this.ProjectId, "0",
|
||||
id, ucTree.UnitId, "编辑 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PhysicalExaminationEdit.aspx?FileId={0}", id, "编辑 - ")));
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format(
|
||||
"PhysicalExaminationEdit.aspx?ProjectId={0}&&Type={1}&&PersonId={2}&&UnitId={3}&&CompanyEdit={4}",
|
||||
this.ProjectId, "0", id, ucTree.UnitId, 1, "编辑 - ")));
|
||||
}
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 删除
|
||||
/// <summary>
|
||||
/// 右键删除事件
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnMenuDelete_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length > 0)
|
||||
{
|
||||
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
|
||||
{
|
||||
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
|
||||
var getD = BLL.PhysicalExaminationService.GetPhysicalExaminationById(rowID);
|
||||
if (getD != null)
|
||||
{
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, getD.FileCode, getD.FileId, BLL.Const.ServerPhysicalExaminationMenuId, BLL.Const.BtnDelete);
|
||||
BLL.PhysicalExaminationService.DeletePhysicalExaminationById(rowID);
|
||||
}
|
||||
}
|
||||
|
||||
this.BindGrid();
|
||||
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region 获取按钮权限
|
||||
|
||||
/// <summary>
|
||||
/// 获取按钮权限
|
||||
/// </summary>
|
||||
@@ -215,22 +297,10 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
/// <returns></returns>
|
||||
private void GetButtonPower()
|
||||
{
|
||||
if (Request.Params["value"] == "0")
|
||||
{
|
||||
return;
|
||||
}
|
||||
string menuId = BLL.Const.ServerPhysicalExaminationMenuId;
|
||||
if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId))
|
||||
{
|
||||
menuId = BLL.Const.PhysicalExaminationMenuId;
|
||||
}
|
||||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, menuId);
|
||||
var buttonList =
|
||||
BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, MenuId);
|
||||
if (buttonList.Count() > 0)
|
||||
{
|
||||
if (buttonList.Contains(BLL.Const.BtnAdd))
|
||||
{
|
||||
this.btnNew.Hidden = false;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnModify))
|
||||
{
|
||||
this.btnMenuEdit.Hidden = false;
|
||||
@@ -240,12 +310,8 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
this.drpProject.Hidden = false;
|
||||
BLL.ProjectService.InitAllProjectDropDownList(this.drpProject, true);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 导出按钮
|
||||
@@ -257,7 +323,9 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
{
|
||||
Response.ClearContent();
|
||||
string filename = Funs.GetNewFileName();
|
||||
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode("体检管理" + filename, System.Text.Encoding.UTF8) + ".xls");
|
||||
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;
|
||||
@@ -266,14 +334,12 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
Response.End();
|
||||
}
|
||||
|
||||
#pragma warning disable CS0108 // “PhysicalExamination.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
|
||||
/// <summary>
|
||||
/// 导出方法
|
||||
/// </summary>
|
||||
/// <param name="grid"></param>
|
||||
/// <returns></returns>
|
||||
private string GetGridTableHtml(Grid grid)
|
||||
#pragma warning restore CS0108 // “PhysicalExamination.GetGridTableHtml(Grid)”隐藏继承的成员“PageBase.GetGridTableHtml(Grid)”。如果是有意隐藏,请使用关键字 new。
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
|
||||
@@ -281,8 +347,12 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
sb.Append("<tr>");
|
||||
foreach (GridColumn column in grid.Columns)
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
if (column.ColumnID != "attWindow")
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
|
||||
}
|
||||
}
|
||||
|
||||
sb.Append("</tr>");
|
||||
foreach (GridRow row in grid.Rows)
|
||||
{
|
||||
@@ -294,7 +364,11 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
{
|
||||
html = (row.FindControl("lblNumber") as AspNet.Label).Text;
|
||||
}
|
||||
sb.AppendFormat("<td>{0}</td>", html);
|
||||
|
||||
if (column.ColumnID != "attWindow")
|
||||
{
|
||||
sb.AppendFormat("<td>{0}</td>", html);
|
||||
}
|
||||
}
|
||||
|
||||
sb.Append("</tr>");
|
||||
@@ -304,6 +378,88 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
#endregion
|
||||
|
||||
#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, MenuId,
|
||||
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;
|
||||
//var q = from x in Funs.DB.QualityAudit_PersonQuality where x.PersonId == rowID select x;
|
||||
//if (q.Count() > 0)
|
||||
//{
|
||||
// content += "人员资质中已存在该人员,无法删除!";
|
||||
//}
|
||||
if (string.IsNullOrEmpty(content))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isShow)
|
||||
{
|
||||
Alert.ShowInTop(content);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
+97
-41
@@ -7,11 +7,13 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
|
||||
|
||||
public partial class PhysicalExamination {
|
||||
|
||||
namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
{
|
||||
|
||||
|
||||
public partial class PhysicalExamination
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Head1 控件。
|
||||
/// </summary>
|
||||
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlHead Head1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
@@ -38,7 +40,43 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Panel2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel2;
|
||||
|
||||
/// <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>
|
||||
/// Panel1 控件。
|
||||
/// </summary>
|
||||
@@ -47,7 +85,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Panel Panel1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Grid1 控件。
|
||||
/// </summary>
|
||||
@@ -56,7 +94,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Grid Grid1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
@@ -65,34 +103,52 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtFileCode 控件。
|
||||
/// txtCardNo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtFileCode;
|
||||
|
||||
protected global::FineUIPro.TextBox txtCardNo;
|
||||
|
||||
/// <summary>
|
||||
/// txtFileName 控件。
|
||||
/// drpUnitId 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtFileName;
|
||||
|
||||
protected global::FineUIPro.DropDownList drpUnitId;
|
||||
|
||||
/// <summary>
|
||||
/// drpProject 控件。
|
||||
/// txtPersonName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpProject;
|
||||
|
||||
protected global::FineUIPro.TextBox txtPersonName;
|
||||
|
||||
/// <summary>
|
||||
/// txtWorkPostName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtWorkPostName;
|
||||
|
||||
/// <summary>
|
||||
/// drpIsUsedName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpIsUsedName;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarFill1 控件。
|
||||
/// </summary>
|
||||
@@ -101,16 +157,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
@@ -119,16 +166,16 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnOut;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// lblNumber 控件。
|
||||
/// lbtnFileUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumber;
|
||||
|
||||
protected global::System.Web.UI.WebControls.LinkButton lbtnFileUrl;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
@@ -137,7 +184,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarText1 控件。
|
||||
/// </summary>
|
||||
@@ -146,7 +193,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarText ToolbarText1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ddlPageSize 控件。
|
||||
/// </summary>
|
||||
@@ -155,7 +202,16 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// lbAllPersonNum 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Label lbAllPersonNum;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
@@ -164,7 +220,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
@@ -173,7 +229,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window WindowAtt;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Menu1 控件。
|
||||
/// </summary>
|
||||
@@ -182,7 +238,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Menu Menu1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
@@ -191,7 +247,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
|
||||
@@ -1,66 +1,180 @@
|
||||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PhysicalExaminationEdit.aspx.cs"
|
||||
Inherits="FineUIPro.Web.HSSE.OccupationHealth.PhysicalExaminationEdit" ValidateRequest="false" %>
|
||||
Inherits="FineUIPro.Web.HSSE.OccupationHealth.PhysicalExaminationEdit" ValidateRequest="false" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||
<title>编辑体检管理</title>
|
||||
<link href="~/res/css/common.css" rel="stylesheet" type="text/css" />
|
||||
<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" AutoSizePanelID="SimpleForm1"/>
|
||||
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" Title="体检管理" AutoScroll="true"
|
||||
<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">
|
||||
<Rows>
|
||||
<f:FormRow>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnAttachUrl3" Text="体检证明" ToolTip="查看" Icon="TableCell" runat="server"
|
||||
OnClick="btnAttachUrl3_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:TextBox ID="txtFileCode" runat="server" Label="编号" LabelAlign="Right" Readonly="true" Required="true" ShowRedStar="true" FocusOnPageLoad="true"
|
||||
MaxLength="50">
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtFileName" runat="server" Label="名称" Required="true" ShowRedStar="true"
|
||||
LabelAlign="Right" MaxLength="200" >
|
||||
</f:TextBox>
|
||||
<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:TextBox ID="txtRemark" runat="server" Label="人资岗位" LabelAlign="Right" MaxLength="50" Enabled="False">
|
||||
</f:TextBox>
|
||||
<f:DropDownList ID="drpUnitId" runat="server" Label="所属单位" LabelWidth="110px" LabelAlign="Right" Required="True" ShowRedStar="True" EnableEdit="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="drpTitle" runat="server" Label="职称" LabelAlign="Right" EnableEdit="true" AutoSelectFirstItem="False" EmptyText="-请选择-">
|
||||
</f:DropDownList>
|
||||
|
||||
<f:DropDownList ID="drpEduLevel" runat="server" Label="文化程度" EnableEdit="true" LabelAlign="Right" AutoSelectFirstItem="False" EmptyText="-请选择-">
|
||||
</f:DropDownList>
|
||||
|
||||
|
||||
</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:TextBox ID="txtMajor" runat="server" Label="所学专业" LabelAlign="Right" MaxLength="20">
|
||||
</f:TextBox>
|
||||
</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:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:HtmlEditor runat="server" Label="内容" ID="txtFileContent" ShowLabel="false"
|
||||
Editor="UMEditor" BasePath="~/res/umeditor/" ToolbarSet="Basic" Height="250px" LabelAlign="Right">
|
||||
</f:HtmlEditor>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:DropDownList ID="drpCompileMan" runat="server" Label="整理人" EnableEdit="true" LabelAlign="Right">
|
||||
</f:DropDownList>
|
||||
<f:DatePicker ID="txtCompileDate" runat="server" Label="整理时间" LabelAlign="Right"
|
||||
EnableEdit="true">
|
||||
</f:DatePicker>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
|
||||
<Items>
|
||||
<f:Button ID="btnAttachUrl" Text="附件" ToolTip="附件上传及查看" Icon="TableCell" runat="server"
|
||||
OnClick="btnAttachUrl_Click" ValidateForms="SimpleForm1" MarginLeft="5px">
|
||||
</f:Button>
|
||||
<f:ToolbarFill runat="server"> </f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" ToolTip="保存" ValidateForms="SimpleForm1" Text="保存"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" ToolTip="关闭" runat="server" Icon="SystemClose" Text="关闭">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
</Toolbars>
|
||||
</f:Form>
|
||||
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
|
||||
Target="Parent" EnableResize="false" runat="server" IsModal="true" Width="700px"
|
||||
Height="500px">
|
||||
</f:Window>
|
||||
</form>
|
||||
</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>
|
||||
</html>
|
||||
@@ -1,44 +1,67 @@
|
||||
using BLL;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Web;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
{
|
||||
public partial class PhysicalExaminationEdit : PageBase
|
||||
{
|
||||
#region 定义项
|
||||
|
||||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string FileId
|
||||
public string PersonId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["FileId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["FileId"] = value;
|
||||
}
|
||||
get { return (string)ViewState["PersonId"]; }
|
||||
set { ViewState["PersonId"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// 二维码路径id
|
||||
/// </summary>
|
||||
public string QRCodeAttachUrl
|
||||
{
|
||||
get { return (string)ViewState["QRCodeAttachUrl"]; }
|
||||
set { ViewState["QRCodeAttachUrl"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目ID
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
}
|
||||
get { return (string)ViewState["ProjectId"]; }
|
||||
set { ViewState["ProjectId"] = value; }
|
||||
}
|
||||
|
||||
public string UnitId
|
||||
{
|
||||
get { return (string)ViewState["UnitId"]; }
|
||||
set { ViewState["UnitId"] = value; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 公司级编辑
|
||||
/// </summary>
|
||||
public string CompanyEdit
|
||||
{
|
||||
get { return (string)ViewState["CompanyEdit"]; }
|
||||
set { ViewState["CompanyEdit"] = value; }
|
||||
}
|
||||
|
||||
public string Type
|
||||
{
|
||||
get { return (string)ViewState["Type"]; }
|
||||
set { ViewState["Type"] = value; }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 加载
|
||||
#region 加载页面
|
||||
|
||||
/// <summary>
|
||||
/// 加载页面
|
||||
/// </summary>
|
||||
@@ -47,40 +70,174 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
if (!IsPostBack)
|
||||
{
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
BLL.UserService.InitUserDropDownList(this.drpCompileMan, this.CurrUser.LoginProjectId, true);
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
this.FileId = Request.Params["FileId"];
|
||||
if (!string.IsNullOrEmpty(this.FileId))
|
||||
{
|
||||
btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
////权限按钮方法
|
||||
if (Request.Params["type"] != "-1")
|
||||
{
|
||||
Model.OccupationHealth_PhysicalExamination PhysicalExamination = BLL.PhysicalExaminationService.GetPhysicalExaminationById(this.FileId);
|
||||
if (PhysicalExamination != null)
|
||||
this.GetButtonPower();
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Request.Params["Company"]))
|
||||
{
|
||||
this.btnSave.Hidden = true;
|
||||
}
|
||||
|
||||
this.ProjectId = Request.Params["ProjectId"];
|
||||
this.UnitId = Request.Params["UnitId"];
|
||||
this.PersonId = Request.Params["PersonId"];
|
||||
this.Type = Request.Params["Type"];
|
||||
CompanyEdit = Request.Params["CompanyEdit"];
|
||||
this.InitDropDownList();
|
||||
this.drpIdcardType.SelectedValue = "SHENFEN_ZHENGJIAN";
|
||||
if (!string.IsNullOrEmpty(this.PersonId))
|
||||
{
|
||||
var person = BLL.PersonService.GetPersonById(this.PersonId);
|
||||
if (person != null)
|
||||
{
|
||||
this.ProjectId = PhysicalExamination.ProjectId;
|
||||
this.txtFileCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.FileId);
|
||||
this.txtFileName.Text = PhysicalExamination.FileName;
|
||||
if (!string.IsNullOrEmpty(PhysicalExamination.CompileMan))
|
||||
this.ProjectId = person.ProjectId;
|
||||
if (!string.IsNullOrEmpty(person.Sex))
|
||||
{
|
||||
this.drpCompileMan.SelectedValue = PhysicalExamination.CompileMan;
|
||||
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);
|
||||
this.UnitId = person.UnitId;
|
||||
}
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.WorkAreaId))
|
||||
{
|
||||
txtWorkArea.Values = person.WorkAreaId.Split(',');
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.WorkPostId))
|
||||
{
|
||||
this.drpPost.SelectedValue = person.WorkPostId;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.PostTitleId))
|
||||
{
|
||||
this.drpTitle.SelectedValue = person.PostTitleId;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.TeamGroupId))
|
||||
{
|
||||
this.drpTeamGroup.SelectedValue = person.TeamGroupId;
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(person.EduLevel))
|
||||
{
|
||||
this.drpEduLevel.SelectedValue = person.EduLevel;
|
||||
}
|
||||
|
||||
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;
|
||||
this.txtMajor.Text = person.Major;
|
||||
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.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", PhysicalExamination.CompileDate);
|
||||
this.txtFileContent.Text = HttpUtility.HtmlDecode(PhysicalExamination.FileContent);
|
||||
}
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
////自动生成编码
|
||||
this.txtFileCode.Text = BLL.CodeRecordsService.ReturnCodeByMenuIdProjectId(BLL.Const.PhysicalExaminationMenuId, this.ProjectId, this.CurrUser.UnitId);
|
||||
this.drpCompileMan.SelectedValue = this.CurrUser.UserId;
|
||||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
this.txtFileName.Text = this.SimpleForm1.Title;
|
||||
var unit = BLL.UnitService.GetUnitByUnitId(this.UnitId);
|
||||
if (unit != null)
|
||||
{
|
||||
this.drpUnitId.SelectedValue = unit.UnitId;
|
||||
this.txtCardNo.Text = string.Empty;
|
||||
}
|
||||
|
||||
this.txtInTime.Text = string.Format("{0:yyyy-MM-dd}", System.DateTime.Now);
|
||||
this.rblIsUsed.SelectedValue = "True";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 初始化下拉框
|
||||
/// </summary>
|
||||
private void InitDropDownList()
|
||||
{
|
||||
if (!string.IsNullOrEmpty(CompanyEdit))
|
||||
{
|
||||
txtWorkArea.ShowRedStar = false;
|
||||
txtWorkArea.Required = false;
|
||||
gvWorkArea.DataSource = BLL.UnitWorkService.GetUnitWorkLists(this.ProjectId);
|
||||
gvWorkArea.DataBind(); //单位工程
|
||||
UnitService.InitBranchUnitDropDownList(this.drpUnitId, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
gvWorkArea.DataSource = BLL.UnitWorkService.GetUnitWorkLists(this.ProjectId);
|
||||
gvWorkArea.DataBind(); //单位工程
|
||||
UnitService.InitProjectUnitDropDownList(this.drpUnitId, this.ProjectId, false);
|
||||
}
|
||||
|
||||
if (Type == "0") //专职安全人员
|
||||
{
|
||||
drpPost.DataValueField = "WorkPostId";
|
||||
drpPost.DataTextField = "WorkPostName";
|
||||
drpPost.DataSource = BLL.WorkPostService.GetWorkPostList().Where(x => x.IsHsse == true);
|
||||
drpPost.DataBind();
|
||||
}
|
||||
else if (Type == "1") //特种作业管理人员
|
||||
{
|
||||
drpPost.DataValueField = "WorkPostId";
|
||||
drpPost.DataTextField = "WorkPostName";
|
||||
drpPost.DataSource = BLL.WorkPostService.GetWorkPostList()
|
||||
.Where(x => x.PostType == "2" || x.PostType == "4");
|
||||
drpPost.DataBind();
|
||||
}
|
||||
else if (Type == "3") //其他人员
|
||||
{
|
||||
drpPost.DataValueField = "WorkPostId";
|
||||
drpPost.DataTextField = "WorkPostName";
|
||||
drpPost.DataSource = BLL.WorkPostService.GetWorkPostList()
|
||||
.Where(x => x.IsHsse != true && x.PostType != "2" || x.PostType != "4");
|
||||
drpPost.DataBind();
|
||||
}
|
||||
|
||||
PostTitleService.InitPostTitleDropDownList(this.drpTitle, false);
|
||||
BasicDataService.InitBasicDataProjectUnitDropDownList(this.drpEduLevel, "EDU_LEVEL", false);
|
||||
BasicDataService.InitBasicDataProjectUnitDropDownList(this.drpIdcardType, "ZHENGJIAN_TYPE", true);
|
||||
}
|
||||
|
||||
#region 保存
|
||||
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
@@ -88,61 +245,415 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.SaveData(BLL.Const.BtnSave);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
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();
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
private void SaveData(string type)
|
||||
protected void SaveData()
|
||||
{
|
||||
Model.OccupationHealth_PhysicalExamination PhysicalExamination = new Model.OccupationHealth_PhysicalExamination
|
||||
Model.SitePerson_Person person = new Model.SitePerson_Person
|
||||
{
|
||||
FileCode = this.txtFileCode.Text.Trim(),
|
||||
FileName = this.txtFileName.Text.Trim()
|
||||
Sex = this.rblSex.SelectedValue,
|
||||
ProjectId = this.ProjectId
|
||||
};
|
||||
if (this.drpCompileMan.SelectedValue != BLL.Const._Null)
|
||||
//如果是公司级编辑
|
||||
if (!string.IsNullOrEmpty(CompanyEdit))
|
||||
{
|
||||
PhysicalExamination.CompileMan = this.drpCompileMan.SelectedValue;
|
||||
person.ProjectId = null;
|
||||
}
|
||||
PhysicalExamination.CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim());
|
||||
PhysicalExamination.FileContent = HttpUtility.HtmlEncode(this.txtFileContent.Text);
|
||||
////单据状态
|
||||
PhysicalExamination.States = BLL.Const.State_2;
|
||||
if (!string.IsNullOrEmpty(this.FileId))
|
||||
|
||||
if (!string.IsNullOrEmpty(this.drpUnitId.SelectedValue))
|
||||
{
|
||||
PhysicalExamination.FileId = this.FileId;
|
||||
BLL.PhysicalExaminationService.UpdatePhysicalExamination(PhysicalExamination);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, PhysicalExamination.FileCode, PhysicalExamination.FileId, BLL.Const.PhysicalExaminationMenuId, BLL.Const.BtnModify);
|
||||
person.UnitId = this.drpUnitId.SelectedValue;
|
||||
}
|
||||
|
||||
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 (this.drpTitle.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
person.PostTitleId = this.drpTitle.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();
|
||||
}
|
||||
|
||||
|
||||
if (this.drpEduLevel.SelectedValue != Const._Null)
|
||||
{
|
||||
person.EduLevel = this.drpEduLevel.SelectedValue;
|
||||
}
|
||||
|
||||
person.Telephone = this.txtTelephone.Text.Trim();
|
||||
person.Major = this.txtMajor.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 (!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
|
||||
{
|
||||
this.FileId = SQLHelper.GetNewID(typeof(Model.OccupationHealth_PhysicalExamination));
|
||||
PhysicalExamination.FileId = this.FileId;
|
||||
PhysicalExamination.ProjectId = this.ProjectId;
|
||||
BLL.PhysicalExaminationService.AddPhysicalExamination(PhysicalExamination);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, PhysicalExamination.FileCode, PhysicalExamination.FileId, BLL.Const.PhysicalExaminationMenuId, BLL.Const.BtnAdd);
|
||||
}
|
||||
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)
|
||||
{
|
||||
ShowNotify("此身份证号已存在,不能重复!", MessageBoxIcon.Warning);
|
||||
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)
|
||||
{
|
||||
ShowNotify("输入的身份证号码已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#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 btnAttachUrl_Click(object sender, EventArgs e)
|
||||
protected void btnAttachUrl3_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.FileId))
|
||||
if (string.IsNullOrEmpty(this.PersonId))
|
||||
{
|
||||
SaveData(BLL.Const.BtnSave);
|
||||
SaveData();
|
||||
}
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/PhysicalExaminationAttachUrl&menuId={1}", FileId, BLL.Const.PhysicalExaminationMenuId)));
|
||||
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format(
|
||||
"~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/PersonBaseInfo&menuId={1}&strParam=3&type=0",
|
||||
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;
|
||||
ShowNotify("输入的身份证号码已存在!", MessageBoxIcon.Warning);
|
||||
}
|
||||
|
||||
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";
|
||||
txtRemark.Text = model.Remark;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+288
-61
@@ -7,11 +7,13 @@
|
||||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
|
||||
|
||||
public partial class PhysicalExaminationEdit {
|
||||
|
||||
namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
{
|
||||
|
||||
|
||||
public partial class PhysicalExaminationEdit
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
/// </summary>
|
||||
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// PageManager1 控件。
|
||||
/// </summary>
|
||||
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.PageManager PageManager1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// SimpleForm1 控件。
|
||||
/// </summary>
|
||||
@@ -38,70 +40,25 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// txtFileCode 控件。
|
||||
/// Toolbar2 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtFileCode;
|
||||
|
||||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtFileName 控件。
|
||||
/// btnAttachUrl3 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtFileName;
|
||||
|
||||
/// <summary>
|
||||
/// txtFileContent 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HtmlEditor txtFileContent;
|
||||
|
||||
/// <summary>
|
||||
/// drpCompileMan 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCompileMan;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtCompileDate;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Toolbar Toolbar1;
|
||||
|
||||
/// <summary>
|
||||
/// btnAttachUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAttachUrl;
|
||||
|
||||
protected global::FineUIPro.Button btnAttachUrl3;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
@@ -110,7 +67,16 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// btnQR 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnQR;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
@@ -119,7 +85,268 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </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>
|
||||
/// txtRemark 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtRemark;
|
||||
|
||||
/// <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>
|
||||
/// drpTitle 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpTitle;
|
||||
|
||||
/// <summary>
|
||||
/// drpEduLevel 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpEduLevel;
|
||||
|
||||
/// <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>
|
||||
/// txtMajor 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtMajor;
|
||||
|
||||
/// <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>
|
||||
|
||||
Reference in New Issue
Block a user