using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace FineUIPro.Web.HSSE.Check { public partial class CheckDayWHPrint : PageBase { #region 定义变量 /// /// 主键 /// public string CheckDayId { get { return (string)ViewState["CheckDayId"]; } set { ViewState["CheckDayId"] = value; } } /// /// 项目主键 /// public string ProjectId { get { return (string)ViewState["ProjectId"]; } set { ViewState["ProjectId"] = value; } } #endregion #region 加载页面 /// /// 加载页面 /// /// /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.CheckDayId = Request.Params["CheckDayId"]; var checkDay = BLL.Check_CheckDayService.GetCheckDayByCheckDayId(this.CheckDayId); if (checkDay != null) { this.txtCheckTime.Text = "检查时间:"; if (checkDay.CheckTime != null) { this.txtCheckTime.Text += string.Format("{0:yyyy-MM-dd}", checkDay.CheckTime); } this.txtCheckPerson.Text = "检查人:"; Model.Sys_User user = BLL.UserService.GetUserByUserId(checkDay.CheckPerson); if (user != null) { this.txtCheckPerson.Text += user.UserName; } var checkDayDetails = BLL.Check_CheckDayDetailService.GetCheckDayDetailByCheckDayId(this.CheckDayId); int i = 1; string str = "" + "" + "" + "" + "" + "" + "" + "" + "" + "" + ""; foreach (var checkDayDetail in checkDayDetails) { string photo1 = string.Empty; string photo2 = string.Empty; Model.AttachFile attachFile = BLL.AttachFileService.GetAttachFile(checkDayDetail.CheckDayDetailId, BLL.Const.ProjectCheckDayWHMenuId); if (attachFile != null) { List urls = new List(); string[] lists = attachFile.AttachUrl.Split(','); foreach (var list in lists) { if (!string.IsNullOrEmpty(list)) { urls.Add(list); } } if (urls.Count > 1) //两个附件 { photo1 = ""; photo2 = ""; } else { photo1 = ""; } } string unitName = string.Empty; string personName = string.Empty; string handleStepName = string.Empty; Model.Base_Unit unit = BLL.UnitService.GetUnitByUnitId(checkDayDetail.UnitId); if (unit != null) { unitName = unit.UnitName; } if (!string.IsNullOrEmpty(checkDayDetail.PersonId)) { Model.SitePerson_Person person = BLL.PersonService.GetPersonById(checkDayDetail.PersonId); if (person != null) { personName = person.PersonName; } } if (!string.IsNullOrEmpty(checkDayDetail.HandleStep)) { List lists = checkDayDetail.HandleStep.Split('|').ToList(); if (lists.Count > 0) { foreach (var item in lists) { Model.Sys_Const con = BLL.ConstValue.GetConstByConstValueAndGroupId(item, BLL.ConstValue.Group_HandleStep); if (con != null) { handleStepName += con.ConstText + "|"; } } } if (!string.IsNullOrEmpty(handleStepName)) { handleStepName = handleStepName.Substring(0, handleStepName.LastIndexOf("|")); } } str += "" + "" + "" + "" + "" + "" + "" + "" + "" + ""; i++; } str += "
序号隐患内容检查区域隐患类型隐患级别责任单位责任人整改限时整改要求处理措施
" + i + "" + checkDayDetail.Unqualified + "
" + photo1 + "
" + photo2 + "
" + checkDayDetail.WorkArea + "" + checkDayDetail.HiddenDangerType + "" + checkDayDetail.HiddenDangerLevel + "" + unitName + "" + personName + "" + string.Format("{0:yyyy-MM-dd}", checkDayDetail.LimitedDate) + "" + checkDayDetail.Suggestions + "" + handleStepName + "
"; this.div3.InnerHtml = str; } } } #endregion } }