211 lines
6.4 KiB
C#
211 lines
6.4 KiB
C#
|
|
using BLL;
|
|
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Threading.Tasks;
|
|
using System.Web;
|
|
using System.Web.UI;
|
|
using System.Web.UI.WebControls;
|
|
|
|
namespace FineUIPro.Web.Customization.CNCCG.HSSE.Check
|
|
{
|
|
public partial class SafePersonView : PageBase
|
|
{
|
|
#region 公共字段
|
|
/// <summary>
|
|
/// 主键
|
|
/// </summary>
|
|
public string SafetyOfficerCheckPersonId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["SafetyOfficerCheckPersonId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["SafetyOfficerCheckPersonId"] = value;
|
|
}
|
|
}
|
|
|
|
public string Userid
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["Userid"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["Userid"] = value;
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// 办理类型
|
|
/// </summary>
|
|
public string State
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["State"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["State"] = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 办理类型
|
|
/// </summary>
|
|
public string Type
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["Type"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["Type"] = value;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
|
|
/// <summary>
|
|
/// 红头文件
|
|
/// </summary>
|
|
public int HandleImg
|
|
{
|
|
get
|
|
{
|
|
return Convert.ToInt32(ViewState["HandleImg"]);
|
|
}
|
|
set
|
|
{
|
|
ViewState["HandleImg"] = value;
|
|
}
|
|
}
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
SafetyOfficerCheckPersonId = Request.Params["SafetyOfficerCheckPersonId"];
|
|
Userid = Request.Params["Userid"];
|
|
//根据userid获取数据
|
|
var UserModel = Funs.DB.Sys_User.FirstOrDefault(x => x.UserId == Userid);
|
|
if (UserModel != null)
|
|
{
|
|
txtProjectName.Text = Funs.DB.Base_Project.FirstOrDefault(x => x.ProjectId == UserModel.ProjectId).ProjectName;
|
|
txtUnitName.Text = Funs.DB.Base_Unit.FirstOrDefault(x => x.UnitId == UserModel.UnitId).UnitName;
|
|
TxtUserName.Text = UserModel.UserName;
|
|
txtJobName.Text = "群众安全生产监督员";
|
|
}
|
|
|
|
Type = Request.Params["Type"];
|
|
if (Type == "0")
|
|
{
|
|
HandleImg = -1;
|
|
}
|
|
else
|
|
{
|
|
HandleImg = 0;
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(SafetyOfficerCheckPersonId))
|
|
{
|
|
Model.SafetyOfficerCheckPerson model = Funs.DB.SafetyOfficerCheckPerson.FirstOrDefault(x => x.SafetyOfficerCheckPersonId == SafetyOfficerCheckPersonId);
|
|
|
|
|
|
var dt = SafetyOfficerCheckPersonService.getListData(SafetyOfficerCheckPersonId);
|
|
gvApprove.DataSource = dt;
|
|
gvApprove.DataBind();
|
|
if (model.BirthDate != null)
|
|
{
|
|
this.txtBirthDate.Text = string.Format("{0:yyyy-MM-dd}", model.BirthDate);
|
|
}
|
|
if (model.Sex != null)
|
|
{
|
|
this.rblSex.SelectedValue = model.Sex;
|
|
}
|
|
numberAge.Text = model.Age.ToString();
|
|
txtAffTeam.Text = model.AffTeam;
|
|
txtAffTeamsGroup.Text = model.AffTeamsGroup;
|
|
txtEduLevel.Text = model.EduLevel;
|
|
txtPoStates.Text = model.PoStates;
|
|
txtJobName.Text = model.JobName;
|
|
txtJobResume.Text = model.JobResume;
|
|
State = model.State;
|
|
//设置页面图片附件是否可以编辑
|
|
if (!State.Equals(Const.Safe_Audit3))
|
|
{
|
|
if (State.Equals(Const.Safe_Audit1) || State.Equals(Const.Safe_Audit2) || State.Equals(Const.Safe_Audit3))
|
|
{
|
|
HandleImg = 0;
|
|
}
|
|
else
|
|
{
|
|
//不能修改图片
|
|
HandleImg = -1;
|
|
}
|
|
}
|
|
|
|
|
|
}
|
|
}
|
|
}
|
|
|
|
#region 附件上传
|
|
/// <summary>
|
|
/// 上传附件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnAttach_Click(object sender, EventArgs e)
|
|
{
|
|
PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=-1&toKeyId={1}&path=FileUpload/CheckControl&menuId={2}", HandleImg, SafetyOfficerCheckPersonId, BLL.Const.SafePersonMenuId)));
|
|
}
|
|
#endregion
|
|
|
|
/// <summary>
|
|
/// 把状态转换代号为文字形式
|
|
/// </summary>
|
|
/// <param name="state"></param>
|
|
/// <returns></returns>
|
|
public string ConvertState(object state)
|
|
{
|
|
if (state != null)
|
|
{
|
|
if (state.ToString() == BLL.Const.Safe_ReCompile)
|
|
{
|
|
return "重新编制";
|
|
}
|
|
else if (state.ToString() == BLL.Const.Safe_Compile)
|
|
{
|
|
return "编制";
|
|
}
|
|
else if (state.ToString() == BLL.Const.Safe_Audit1)
|
|
{
|
|
return "安质部部长审批";
|
|
}
|
|
else if (state.ToString() == BLL.Const.Safe_Audit2)
|
|
{
|
|
return "项目经理审批";
|
|
}
|
|
else if (state.ToString() == BLL.Const.Safe_Audit3)
|
|
{
|
|
return "审批完成";
|
|
}
|
|
else
|
|
{
|
|
return "待任命";
|
|
}
|
|
}
|
|
return "";
|
|
}
|
|
}
|
|
} |