20231115人员信息与体检关联关联

This commit is contained in:
2023-11-15 16:11:07 +08:00
parent 46752f3351
commit 11e8156f65
10 changed files with 308 additions and 483 deletions
@@ -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,47 +119,12 @@ 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, "编辑 - ")));
}
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("PhysicalExaminationEdit.aspx?SitePersonId={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);
}
}
#endregion
#endregion
#region
/// <summary>
@@ -221,19 +145,11 @@ 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
{
@@ -299,6 +215,26 @@ namespace FineUIPro.Web.HSSE.OccupationHealth
return sb.ToString();
}
#endregion
#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;
}
}
}