using System; using System.Collections.Generic; namespace FineUIPro.Web.HSSE.Check { public partial class CheckHolidayPrint : PageBase { #region 定义变量 /// /// 主键 /// public string CheckHolidayId { get { return (string)ViewState["CheckHolidayId"]; } set { ViewState["CheckHolidayId"] = 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.CheckHolidayId = Request.Params["CheckHolidayId"]; var checkHoliday = BLL.Check_CheckHolidayService.GetCheckHolidayByCheckHolidayId(this.CheckHolidayId); if (checkHoliday != null) { this.txtCheckTime.Text = "检查时间:"; if (checkHoliday.CheckTime != null) { this.txtCheckTime.Text += string.Format("{0:yyyy-MM-dd}", checkHoliday.CheckTime); } string personStr = "检查人:"; if (!string.IsNullOrEmpty(checkHoliday.MainUnitPerson)) { string[] strs = checkHoliday.MainUnitPerson.Split(','); foreach (var s in strs) { Model.Sys_User checkPerson = BLL.UserService.GetUserByUserId(s); if (checkPerson != null) { personStr += checkPerson.UserName + "、"; } } } if (!string.IsNullOrEmpty(checkHoliday.SubUnitPerson)) { string[] strs = checkHoliday.SubUnitPerson.Split(','); foreach (var s in strs) { Model.Sys_User checkPerson = BLL.UserService.GetUserByUserId(s); if (checkPerson != null) { personStr += checkPerson.UserName + "、"; } } } if (!string.IsNullOrEmpty(personStr)) { personStr = personStr.Substring(0, personStr.LastIndexOf("、")); } if (!string.IsNullOrEmpty(checkHoliday.PartInPersonNames)) { if (personStr != "检查人:") { personStr += "、" + checkHoliday.PartInPersonNames; } else { personStr += checkHoliday.PartInPersonNames; } } this.txtCheckPerson.Text = personStr; var checkHolidayDetails = BLL.Check_CheckHolidayDetailService.GetCheckHolidayDetailByCheckHolidayId(this.CheckHolidayId); int i = 1; string str = "" + "" + "" + "" + "" + "" + "" + "" + "" + ""; foreach (var checkHolidayDetail in checkHolidayDetails) { string photo1 = string.Empty; string photo2 = string.Empty; Model.AttachFile attachFile = BLL.AttachFileService.GetAttachFile(checkHolidayDetail.CheckHolidayDetailId, BLL.Const.ProjectCheckHolidayMenuId); 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 completedDate = string.Empty; //Model.Base_Unit unit = BLL.UnitService.GetUnitByUnitId(checkHolidayDetail.UnitId); //if (unit != null) //{ // unitName = unit.UnitName; //} str += "" + "" + "" + "" + "" + "" + "" + "" + ""; i++; } str += "
序号隐患照片或描述整改措施整改责任人整改时间责任单位复检人复检时间复检结果
" + i + "" + checkHolidayDetail.CheckResult + "
" + photo1 + "
" + photo2 + "
" + completedDate + "" + unitName + "
"; this.div3.InnerHtml = str; } } } #endregion } }