20231115人员信息与体检关联关联
This commit is contained in:
parent
46752f3351
commit
11e8156f65
|
|
@ -1,4 +1,8 @@
|
|||
using System.Linq;
|
||||
using FineUIPro;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
namespace BLL
|
||||
{
|
||||
|
|
@ -9,6 +13,62 @@ namespace BLL
|
|||
{
|
||||
public static Model.SGGLDB db = Funs.DB;
|
||||
|
||||
#region 获取安全巡检列表信息
|
||||
/// <summary>
|
||||
/// 记录数
|
||||
/// </summary>
|
||||
public static int count
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 定义变量
|
||||
/// </summary>
|
||||
private static IQueryable<Model.SitePerson_Person> getDataLists = from x in db.SitePerson_Person
|
||||
select x;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
/// <param name="projectId"></param>
|
||||
/// <param name="personName"></param>
|
||||
/// <param name="Grid1"></param>
|
||||
/// <returns></returns>
|
||||
public static IEnumerable getListData(string projectId, string personName, Grid Grid1)
|
||||
{
|
||||
IQueryable<Model.SitePerson_Person> getDataList = getDataLists;
|
||||
if (!string.IsNullOrEmpty(projectId))
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.ProjectId == projectId);
|
||||
}
|
||||
if (!string.IsNullOrEmpty(personName))
|
||||
{
|
||||
getDataList = getDataList.Where(e => e.PersonName.Contains(personName));
|
||||
}
|
||||
|
||||
count = getDataList.Count();
|
||||
if (count == 0)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
getDataList = SortConditionHelper.SortingAndPaging(getDataList, Grid1.SortField, Grid1.SortDirection, Grid1.PageIndex, Grid1.PageSize);
|
||||
return from x in getDataList
|
||||
select new
|
||||
{
|
||||
x.ProjectId,
|
||||
ProjectName = db.Base_Project.First(p => p.ProjectId == x.ProjectId).ProjectName,
|
||||
x.UnitId,
|
||||
UnitName = db.Base_Unit.First(p => p.UnitId == x.UnitId).UnitName,
|
||||
x.SitePersonId,
|
||||
x.PersonId,
|
||||
x.CardNo,
|
||||
x.PersonName,
|
||||
};
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
/// 根据主键获取体检管理
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
namespace BLL
|
||||
{
|
||||
using Model;
|
||||
using NPOI.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
@ -361,17 +362,20 @@
|
|||
group x by x.ProjectId into g
|
||||
select new { g.First().ProjectId, count = g.Count() }).Distinct();
|
||||
|
||||
List<Model.Base_Project> getList = new List<Base_Project>();
|
||||
|
||||
if (getProjects.Count() > 0)
|
||||
{
|
||||
getList = (from x in getProjects
|
||||
var getList = (from x in getProjects
|
||||
join y in pcount on x.ProjectId equals y.ProjectId into PP
|
||||
from p in PP.DefaultIfEmpty()
|
||||
orderby p.count descending
|
||||
select x).ToList();
|
||||
select x);
|
||||
return getList.ToList();
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return getList;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -137,7 +137,6 @@
|
|||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
debugger
|
||||
var imgID = '<%=Grid1.ClientID %>';
|
||||
F.ready(function () {
|
||||
var $wrap = $("#" + imgID)
|
||||
|
|
|
|||
|
|
@ -13,30 +13,25 @@
|
|||
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
|
||||
<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"
|
||||
runat="server" BoxFlex="1" EnableColumnLines="true" DataKeyNames="SitePersonId"
|
||||
DataIDField="SitePersonId" AllowSorting="true"
|
||||
SortField="CardNo" SortDirection="ASC" 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="输入查询条件"
|
||||
<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="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 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" Text="新增" Icon="Add" EnablePostBack="false" Hidden="true"
|
||||
runat="server">
|
||||
</f:Button>
|
||||
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="导出" Icon="FolderUp"
|
||||
EnableAjax="false" DisableControlBeforePostBack="false">
|
||||
EnableAjax="false" DisableControlBeforePostBack="false" Hidden="true">
|
||||
</f:Button>
|
||||
</Items>
|
||||
</f:Toolbar>
|
||||
|
|
@ -48,30 +43,28 @@
|
|||
<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"
|
||||
<f:RenderField Width="150px" ColumnID="CardNo" DataField="CardNo"
|
||||
FieldType="String" HeaderText="卡号" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="380px" ColumnID="ProjectName" DataField="ProjectName"
|
||||
SortField="ProjectName" FieldType="String" HeaderText="项目" HeaderTextAlign="Center"
|
||||
<f:RenderField Width="250px" ColumnID="ProjectName" DataField="ProjectName" ExpandUnusedSpace="true"
|
||||
FieldType="String" HeaderText="项目" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="200px" ColumnID="FileName" DataField="FileName"
|
||||
SortField="FileName" FieldType="String" HeaderText="名称" HeaderTextAlign="Center"
|
||||
<f:RenderField Width="250px" ColumnID="UnitName" DataField="UnitName"
|
||||
FieldType="String" HeaderText="单位名称" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<f:RenderField Width="90px" ColumnID="CompileManName" DataField="CompileManName"
|
||||
SortField="CompileManName" FieldType="String" HeaderText="整理人" HeaderTextAlign="Center"
|
||||
<f:RenderField Width="150px" ColumnID="PersonName" DataField="PersonName"
|
||||
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>
|
||||
<f:RenderField Width="140px" ColumnID="FlowOperateName" DataField="FlowOperateName"
|
||||
SortField="FlowOperateName" FieldType="String" HeaderText="状态" HeaderTextAlign="Center"
|
||||
<f:TemplateField ColumnID="tfImageUrl1" Width="150px" HeaderText="体检" HeaderTextAlign="Center"
|
||||
TextAlign="Left">
|
||||
</f:RenderField>
|
||||
<ItemTemplate>
|
||||
<asp:Label ID="lbImageUrl" runat="server" Text='<%# ConvertImageUrlByImage(Eval("PersonId")) %>'></asp:Label>
|
||||
</ItemTemplate>
|
||||
</f:TemplateField>
|
||||
</Columns>
|
||||
<Listeners>
|
||||
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
|
||||
|
|
@ -88,9 +81,6 @@
|
|||
</f:Grid>
|
||||
</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>
|
||||
<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>
|
||||
|
|
@ -98,10 +88,11 @@
|
|||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" Icon="Pencil" 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="删除">
|
||||
</f:MenuButton>
|
||||
</f:Menu>
|
||||
|
||||
<div id="imgID1" style="position: absolute; left: 0; top: 0; width: 200px; height: 200px; z-index: 99999999;">
|
||||
<img src="" alt="Alternate Text" style="width: 100%; height: auto;" />
|
||||
</div>
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
var menuID = '<%= Menu1.ClientID %>';
|
||||
|
|
@ -115,5 +106,21 @@
|
|||
__doPostBack(null, 'reloadGrid');
|
||||
}
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
var imgID = '<%=Grid1.ClientID %>';
|
||||
F.ready(function () {
|
||||
var $wrap = $("#" + imgID)
|
||||
$wrap.find('img').hover(function (e) {
|
||||
console.log($(this).offset())
|
||||
var top = $(this).offset().top;
|
||||
var left = $(this).offset().left - 200;
|
||||
var src = $(this).attr('src')
|
||||
console.log('src', src, top, left)
|
||||
$('#imgID1').css("left", left).css("top", top).show().find('img').attr('src', src)
|
||||
}, function () {
|
||||
$('#imgID1').hide()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,10 +1,8 @@
|
|||
using BLL;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Data;
|
||||
using System.Data.SqlClient;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web;
|
||||
using AspNet = System.Web.UI.WebControls;
|
||||
|
||||
namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
|
|
@ -24,7 +22,6 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
|||
Funs.DropDownPageSize(this.ddlPageSize);
|
||||
////权限按钮方法
|
||||
this.GetButtonPower();
|
||||
this.btnNew.OnClientClick = Window1.GetShowReference("PhysicalExaminationEdit.aspx") + "return false;";
|
||||
|
||||
// 绑定表格
|
||||
this.BindGrid();
|
||||
|
|
@ -38,47 +35,9 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
|||
/// </summary>
|
||||
private void BindGrid()
|
||||
{
|
||||
string strSql = @"SELECT PhysicalExamination.FileId,PhysicalExamination.FileCode,PhysicalExamination.FileName,CompileManPerson.PersonName AS CompileManName,PhysicalExamination.CompileDate,Project.ProjectName,Project.ProjectCode"
|
||||
+ @" ,(CASE WHEN PhysicalExamination.States = " + BLL.Const.State_0 + " OR PhysicalExamination.States IS NULL THEN '待['+OperatePerson.PersonName+']提交' WHEN PhysicalExamination.States = " + BLL.Const.State_2 + " THEN '审核/审批完成' ELSE '待['+OperatePerson.PersonName+']办理' 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 Person_Persons AS OperatePerson ON FlowOperate.OperaterId=OperatePerson.PersonId "
|
||||
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON PhysicalExamination.FileId=CodeRecords.DataId "
|
||||
+ @" LEFT JOIN Base_Project AS Project ON PhysicalExamination.ProjectId=Project.ProjectId "
|
||||
+ @" LEFT JOIN Person_Persons AS CompileManPerson ON PhysicalExamination.CompileMan =CompileManPerson.PersonId 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)
|
||||
{
|
||||
strSql += " AND PhysicalExamination.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.drpProject.SelectedValue));
|
||||
}
|
||||
}
|
||||
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;
|
||||
var table = this.GetPagedDataTable(Grid1, tb);
|
||||
Grid1.DataSource = table;
|
||||
var getData = PhysicalExaminationService.getListData(this.CurrUser.LoginProjectId, this.txtPersonName.Text.Trim(), Grid1);
|
||||
Grid1.RecordCount = PhysicalExaminationService.count;
|
||||
Grid1.DataSource = getData;
|
||||
Grid1.DataBind();
|
||||
}
|
||||
|
||||
|
|
@ -160,44 +119,9 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
|||
return;
|
||||
}
|
||||
string id = Grid1.SelectedRowID;
|
||||
var OccupationHealth = BLL.PhysicalExaminationService.GetPhysicalExaminationById(id);
|
||||
if (OccupationHealth != null)
|
||||
if (!this.btnMenuEdit.Hidden) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面
|
||||
{
|
||||
if (this.btnMenuEdit.Hidden || OccupationHealth.States == BLL.Const.State_2) ////双击事件 编辑权限有:编辑页面,无:查看页面 或者状态是完成时查看页面
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PhysicalExaminationView.aspx?FileId={0}", id, "查看 - ")));
|
||||
}
|
||||
else
|
||||
{
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PhysicalExaminationEdit.aspx?FileId={0}", id, "编辑 - ")));
|
||||
}
|
||||
}
|
||||
}
|
||||
#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);
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("PhysicalExaminationEdit.aspx?SitePersonId={0}", id, "编辑 - ")));
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
|
@ -222,18 +146,10 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
|||
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, 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;
|
||||
}
|
||||
if (buttonList.Contains(BLL.Const.BtnDelete))
|
||||
{
|
||||
this.btnMenuDelete.Hidden = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -300,5 +216,25 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
|||
return sb.ToString();
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 获取整改前图片(放于Img中)
|
||||
/// </summary>
|
||||
/// <param name="registrationId"></param>
|
||||
/// <returns></returns>
|
||||
protected string ConvertImageUrlByImage(object personId)
|
||||
{
|
||||
string url = string.Empty;
|
||||
if (personId != null)
|
||||
{
|
||||
var attach = BLL.AttachFileService.GetAttachFile(personId.ToString() + "#3", BLL.Const.PersonListMenuId);
|
||||
if (attach != null)
|
||||
{
|
||||
url = HttpUtility.HtmlDecode(BLL.UploadAttachmentService.ShowImage("../../", attach.AttachUrl));
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -7,10 +7,12 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
{
|
||||
|
||||
|
||||
public partial class PhysicalExamination {
|
||||
public partial class PhysicalExamination
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// Head1 控件。
|
||||
|
|
@ -67,22 +69,13 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
|||
protected global::FineUIPro.Toolbar Toolbar2;
|
||||
|
||||
/// <summary>
|
||||
/// txtFileCode 控件。
|
||||
/// txtPersonName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtFileCode;
|
||||
|
||||
/// <summary>
|
||||
/// txtFileName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtFileName;
|
||||
protected global::FineUIPro.TextBox txtPersonName;
|
||||
|
||||
/// <summary>
|
||||
/// drpProject 控件。
|
||||
|
|
@ -102,15 +95,6 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||
|
||||
/// <summary>
|
||||
/// btnNew 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnNew;
|
||||
|
||||
/// <summary>
|
||||
/// btnOut 控件。
|
||||
/// </summary>
|
||||
|
|
@ -129,6 +113,15 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
|||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lblNumber;
|
||||
|
||||
/// <summary>
|
||||
/// lbImageUrl 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::System.Web.UI.WebControls.Label lbImageUrl;
|
||||
|
||||
/// <summary>
|
||||
/// ToolbarSeparator1 控件。
|
||||
/// </summary>
|
||||
|
|
@ -156,15 +149,6 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList ddlPageSize;
|
||||
|
||||
/// <summary>
|
||||
/// Window1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Window Window1;
|
||||
|
||||
/// <summary>
|
||||
/// WindowAtt 控件。
|
||||
/// </summary>
|
||||
|
|
@ -191,14 +175,5 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
|||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuEdit;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuDelete 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuDelete;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -16,36 +16,22 @@
|
|||
<Rows>
|
||||
<f:FormRow>
|
||||
<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 ID="txtProjectName" runat="server" Label="项目" LabelAlign="Right" Readonly="true" >
|
||||
</f:TextBox>
|
||||
</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>
|
||||
<f:TextBox ID="txtUnitName" runat="server" Label="单位名称" LabelAlign="Right" Readonly="true" >
|
||||
</f:TextBox>
|
||||
</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>
|
||||
<f:FormRow>
|
||||
<Items>
|
||||
<f:ContentPanel ID="ContentPanel1" runat="server" ShowHeader="false" EnableCollapse="true"
|
||||
BodyPadding="0px">
|
||||
<uc1:FlowOperateControl ID="ctlAuditFlow" runat="server" />
|
||||
</f:ContentPanel>
|
||||
<f:TextBox ID="txtCardNo" runat="server" Label="卡号" LabelAlign="Right" Readonly="true" >
|
||||
</f:TextBox>
|
||||
<f:TextBox ID="txtPersonName" runat="server" Label="姓名" LabelAlign="Right">
|
||||
</f:TextBox>
|
||||
</Items>
|
||||
</f:FormRow>
|
||||
</Rows>
|
||||
|
|
@ -56,12 +42,6 @@
|
|||
OnClick="btnAttachUrl_Click" ValidateForms="SimpleForm1" MarginLeft="5px">
|
||||
</f:Button>
|
||||
<f:ToolbarFill runat="server"> </f:ToolbarFill>
|
||||
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSave_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnSubmit" Icon="SystemSaveNew" runat="server" Text="提交" ValidateForms="SimpleForm1"
|
||||
OnClick="btnSubmit_Click">
|
||||
</f:Button>
|
||||
<f:Button ID="btnClose" EnablePostBack="false" Text="关闭" runat="server" Icon="SystemClose">
|
||||
</f:Button>
|
||||
</Items>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using BLL;
|
||||
using Microsoft.Office.Core;
|
||||
using System;
|
||||
using System.Web;
|
||||
|
||||
|
|
@ -10,30 +11,27 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
|||
/// <summary>
|
||||
/// 主键
|
||||
/// </summary>
|
||||
public string FileId
|
||||
public string PersonId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["FileId"];
|
||||
return (string)ViewState["PersonId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["FileId"] = value;
|
||||
ViewState["PersonId"] = value;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 项目主键
|
||||
/// </summary>
|
||||
public string ProjectId
|
||||
public string SitePersonId
|
||||
{
|
||||
get
|
||||
{
|
||||
return (string)ViewState["ProjectId"];
|
||||
return (string)ViewState["SitePersonId"];
|
||||
}
|
||||
set
|
||||
{
|
||||
ViewState["ProjectId"] = value;
|
||||
ViewState["SitePersonId"] = value;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
|
@ -49,112 +47,18 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
|||
if (!IsPostBack)
|
||||
{
|
||||
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
|
||||
BLL.Person_PersonsService.InitUserProjectIdUnitIdRoleIdDropDownList(this.drpCompileMan, this.CurrUser.LoginProjectId, null, null, true);
|
||||
this.ProjectId = this.CurrUser.LoginProjectId;
|
||||
this.FileId = Request.Params["FileId"];
|
||||
if (!string.IsNullOrEmpty(this.FileId))
|
||||
{
|
||||
Model.OccupationHealth_PhysicalExamination PhysicalExamination = BLL.PhysicalExaminationService.GetPhysicalExaminationById(this.FileId);
|
||||
if (PhysicalExamination != null)
|
||||
{
|
||||
this.ProjectId = PhysicalExamination.ProjectId;
|
||||
this.txtFileCode.Text = BLL.CodeRecordsService.ReturnCodeByDataId(this.FileId);
|
||||
this.txtFileName.Text = PhysicalExamination.FileName;
|
||||
if (!string.IsNullOrEmpty(PhysicalExamination.CompileMan))
|
||||
{
|
||||
this.drpCompileMan.SelectedValue = PhysicalExamination.CompileMan;
|
||||
}
|
||||
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.PersonId;
|
||||
this.txtCompileDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now);
|
||||
this.txtFileName.Text = this.SimpleForm1.Title;
|
||||
}
|
||||
///初始化审核菜单
|
||||
this.ctlAuditFlow.MenuId = BLL.Const.PhysicalExaminationMenuId;
|
||||
this.ctlAuditFlow.DataId = this.FileId;
|
||||
this.ctlAuditFlow.ProjectId = this.ProjectId;
|
||||
this.ctlAuditFlow.UnitId = this.CurrUser.UnitId;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 提交按钮
|
||||
/// <summary>
|
||||
/// 提交按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSubmit_Click(object sender, EventArgs e)
|
||||
this.SitePersonId = Request.Params["SitePersonId"];
|
||||
var getPerson= SitePerson_PersonService.GetSitePersonById(this.SitePersonId);
|
||||
if (getPerson != null)
|
||||
{
|
||||
if (this.ctlAuditFlow.NextStep == BLL.Const.State_1 && this.ctlAuditFlow.NextPerson == BLL.Const._Null)
|
||||
{
|
||||
ShowNotify("请选择下一步办理人!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
this.txtProjectName.Text = ProjectService.GetProjectNameByProjectId(getPerson.ProjectId);
|
||||
this.txtUnitName.Text = UnitService.GetUnitNameByUnitId(getPerson.UnitId);
|
||||
this.PersonId = getPerson.PersonId;
|
||||
this.txtCardNo.Text = getPerson.CardNo;
|
||||
this.txtPersonName.Text = getPerson.PersonName;
|
||||
}
|
||||
this.SaveData(BLL.Const.BtnSubmit);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 保存
|
||||
/// <summary>
|
||||
/// 保存按钮
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnSave_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.SaveData(BLL.Const.BtnSave);
|
||||
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 保存数据
|
||||
/// </summary>
|
||||
/// <param name="type"></param>
|
||||
private void SaveData(string type)
|
||||
{
|
||||
Model.OccupationHealth_PhysicalExamination PhysicalExamination = new Model.OccupationHealth_PhysicalExamination
|
||||
{
|
||||
FileCode = this.txtFileCode.Text.Trim(),
|
||||
FileName = this.txtFileName.Text.Trim()
|
||||
};
|
||||
if (this.drpCompileMan.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
PhysicalExamination.CompileMan = this.drpCompileMan.SelectedValue;
|
||||
}
|
||||
PhysicalExamination.CompileDate = Funs.GetNewDateTime(this.txtCompileDate.Text.Trim());
|
||||
PhysicalExamination.FileContent = HttpUtility.HtmlEncode(this.txtFileContent.Text);
|
||||
////单据状态
|
||||
PhysicalExamination.States = BLL.Const.State_0;
|
||||
if (type == BLL.Const.BtnSubmit)
|
||||
{
|
||||
PhysicalExamination.States = this.ctlAuditFlow.NextStep;
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.FileId))
|
||||
{
|
||||
PhysicalExamination.FileId = this.FileId;
|
||||
BLL.PhysicalExaminationService.UpdatePhysicalExamination(PhysicalExamination);
|
||||
BLL.LogService.AddSys_Log(this.CurrUser, PhysicalExamination.FileCode, PhysicalExamination.FileId, BLL.Const.PhysicalExaminationMenuId, BLL.Const.BtnModify);
|
||||
}
|
||||
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);
|
||||
}
|
||||
////保存流程审核数据
|
||||
this.ctlAuditFlow.btnSaveData(this.ProjectId, BLL.Const.PhysicalExaminationMenuId, this.FileId, (type == BLL.Const.BtnSubmit ? true : false), this.txtFileName.Text.Trim(), "../OccupationHealth/PhysicalExaminationView.aspx?FileId={0}");
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
|
@ -166,11 +70,8 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
|
|||
/// <param name="e"></param>
|
||||
protected void btnAttachUrl_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (string.IsNullOrEmpty(this.FileId))
|
||||
{
|
||||
SaveData(BLL.Const.BtnSave);
|
||||
}
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/PhysicalExaminationAttachUrl&menuId={1}", FileId, BLL.Const.PhysicalExaminationMenuId)));
|
||||
string filePath = "FileUpLoad/PersonBaseInfo/" + DateTime.Now.ToString("yyyy-MM") + "/newfile/";
|
||||
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=" + filePath + "&menuId={1}&strParam=3", this.PersonId, BLL.Const.PersonListMenuId)));
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,10 +7,12 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.OccupationHealth {
|
||||
namespace FineUIPro.Web.HSSE.OccupationHealth
|
||||
{
|
||||
|
||||
|
||||
public partial class PhysicalExaminationEdit {
|
||||
public partial class PhysicalExaminationEdit
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
|
|
@ -40,67 +42,40 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
|||
protected global::FineUIPro.Form SimpleForm1;
|
||||
|
||||
/// <summary>
|
||||
/// txtFileCode 控件。
|
||||
/// txtProjectName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtFileCode;
|
||||
protected global::FineUIPro.TextBox txtProjectName;
|
||||
|
||||
/// <summary>
|
||||
/// txtFileName 控件。
|
||||
/// txtUnitName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.TextBox txtFileName;
|
||||
protected global::FineUIPro.TextBox txtUnitName;
|
||||
|
||||
/// <summary>
|
||||
/// txtFileContent 控件。
|
||||
/// txtCardNo 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.HtmlEditor txtFileContent;
|
||||
protected global::FineUIPro.TextBox txtCardNo;
|
||||
|
||||
/// <summary>
|
||||
/// drpCompileMan 控件。
|
||||
/// txtPersonName 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DropDownList drpCompileMan;
|
||||
|
||||
/// <summary>
|
||||
/// txtCompileDate 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.DatePicker txtCompileDate;
|
||||
|
||||
/// <summary>
|
||||
/// ContentPanel1 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.ContentPanel ContentPanel1;
|
||||
|
||||
/// <summary>
|
||||
/// ctlAuditFlow 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Web.Controls.FlowOperateControl ctlAuditFlow;
|
||||
protected global::FineUIPro.TextBox txtPersonName;
|
||||
|
||||
/// <summary>
|
||||
/// Toolbar1 控件。
|
||||
|
|
@ -120,24 +95,6 @@ namespace FineUIPro.Web.HSSE.OccupationHealth {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnAttachUrl;
|
||||
|
||||
/// <summary>
|
||||
/// btnSave 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSave;
|
||||
|
||||
/// <summary>
|
||||
/// btnSubmit 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.Button btnSubmit;
|
||||
|
||||
/// <summary>
|
||||
/// btnClose 控件。
|
||||
/// </summary>
|
||||
|
|
|
|||
|
|
@ -325,14 +325,20 @@ namespace FineUIPro.Web
|
|||
this.drpProject.DataBind();
|
||||
|
||||
if (!string.IsNullOrEmpty(Request.Params["projectId"]))
|
||||
{
|
||||
var getp = projectlist.FirstOrDefault(x => x.ProjectId == Request.Params["projectId"]);
|
||||
if (getp == null)
|
||||
{
|
||||
Model.Base_Project project = BLL.ProjectService.GetProjectByProjectId(Request.Params["projectId"]);
|
||||
if (!projectlist.Contains(project))
|
||||
if (project != null)
|
||||
{
|
||||
projectlist.Add(project);
|
||||
this.drpProject.Items.Clear();
|
||||
this.drpProject.DataSource = projectlist;
|
||||
this.drpProject.DataBind();
|
||||
}
|
||||
}
|
||||
|
||||
this.drpProject.SelectedValue = Request.Params["projectId"];
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue