| 
									
										
										
										
											2023-12-20 15:48:05 +08:00
										 |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using Model; | 
					
						
							|  |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Web; | 
					
						
							|  |  |  |  | using System.Web.UI; | 
					
						
							|  |  |  |  | using System.Web.UI.WebControls; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace FineUIPro.Web.TestRun.BeforeTestRun | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class FourDecisionOtherConfirmEdit : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 主键 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public string DecisionId | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get { return (string)ViewState["DecisionId"]; } | 
					
						
							|  |  |  |  |             set { ViewState["DecisionId"] = value; } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         ///  | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public int ConfirmType | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get { return (int)ViewState["ConfirmType"]; } | 
					
						
							|  |  |  |  |             set { ViewState["ConfirmType"] = value; } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 是否查看 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public bool IsView | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get { return (bool)ViewState["IsView"]; } | 
					
						
							|  |  |  |  |             set { ViewState["IsView"] = value; } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             this.DecisionId = Request["DecisionId"]; | 
					
						
							|  |  |  |  |             this.ConfirmType = string.IsNullOrWhiteSpace(Request["ConfirmType"]) ? 0 : int.Parse(Request["ConfirmType"]); | 
					
						
							|  |  |  |  |             ContentPanel1.Title = this.ConfirmType == 2 ? "提出人确认" : this.ConfirmType == 3 ? "总包确认" : this.ConfirmType == 4 ? "监理确认" : this.ConfirmType == 5 ? "业主确认" : ""; | 
					
						
							|  |  |  |  |             //是否查看 | 
					
						
							|  |  |  |  |             this.IsView = string.IsNullOrWhiteSpace(Request["IsView"]) ? false : bool.Parse(Request["IsView"]); | 
					
						
							|  |  |  |  |             //数据绑定 | 
					
						
							|  |  |  |  |             PageInit(); | 
					
						
							|  |  |  |  |             //判断是否查看 | 
					
						
							|  |  |  |  |             if (IsView) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 btnPass.Hidden = true; | 
					
						
							|  |  |  |  |                 lblResponsibilityUnit.Enabled = false; | 
					
						
							|  |  |  |  |                 lblQuestionDesc.Enabled = false; | 
					
						
							|  |  |  |  |                 lblRestrictCondition.Enabled = false; | 
					
						
							|  |  |  |  |                 lblLevel.Enabled = false; | 
					
						
							|  |  |  |  |                 lblSpeciality.Enabled = false; | 
					
						
							|  |  |  |  |                 lblAskDestructionTime.Enabled = false; | 
					
						
							|  |  |  |  |                 lblRealityDestructionTime.Enabled = false; | 
					
						
							|  |  |  |  |                 lblResponsibilityUser.Enabled = false; | 
					
						
							|  |  |  |  |                 lblProposeUser.Enabled = false; | 
					
						
							|  |  |  |  |                 lblGeneraUser.Enabled = false; | 
					
						
							|  |  |  |  |                 lblSupervisionUser.Enabled = false; | 
					
						
							|  |  |  |  |                 lblOwnerUser.Enabled = false; | 
					
						
							|  |  |  |  |                 lblDecisionIsClose.Enabled = false; | 
					
						
							|  |  |  |  |                 txtConfirmDesc.Enabled = false; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 默认绑定 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public void PageInit() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             var query = from a in Funs.DB.PreRun_SubThreeChecksFourDecision | 
					
						
							|  |  |  |  |                         join b in Funs.DB.Base_Project on a.ProjectId equals b.ProjectId | 
					
						
							|  |  |  |  |                         join c in Funs.DB.Base_Unit on a.ResponsibilityUnit equals c.UnitId | 
					
						
							|  |  |  |  |                         join d in Funs.DB.Sys_User on a.ResponsibilityUser equals d.UserId | 
					
						
							|  |  |  |  |                         join e in Funs.DB.Sys_User on a.ProposeUser equals e.UserId | 
					
						
							|  |  |  |  |                         join f in Funs.DB.Sys_User on a.GeneraUser equals f.UserId | 
					
						
							|  |  |  |  |                         join g in Funs.DB.Sys_User on a.SupervisionUser equals g.UserId | 
					
						
							|  |  |  |  |                         join h in Funs.DB.Sys_User on a.OwnerUser equals h.UserId | 
					
						
							|  |  |  |  |                         where a.DecisionId == this.DecisionId | 
					
						
							|  |  |  |  |                         select new | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             a.DecisionId, | 
					
						
							|  |  |  |  |                             a.ProjectId, | 
					
						
							|  |  |  |  |                             b.ProjectName, | 
					
						
							|  |  |  |  |                             a.ResponsibilityUnit, | 
					
						
							|  |  |  |  |                             ResponsibilityUnitName = c.UnitName, | 
					
						
							|  |  |  |  |                             a.ResponsibilityUser, | 
					
						
							|  |  |  |  |                             ResponsibilityUserName = d.UserName, | 
					
						
							|  |  |  |  |                             a.ProposeUser, | 
					
						
							|  |  |  |  |                             ProposeUserName = e.UserName, | 
					
						
							|  |  |  |  |                             a.GeneraUser, | 
					
						
							|  |  |  |  |                             GeneraUserName = f.UserName, | 
					
						
							|  |  |  |  |                             a.SupervisionUser, | 
					
						
							|  |  |  |  |                             SupervisionUserName = g.UserName, | 
					
						
							|  |  |  |  |                             a.OwnerUser, | 
					
						
							|  |  |  |  |                             OwnerUserName = h.UserName, | 
					
						
							|  |  |  |  |                             a.QuestionDesc, | 
					
						
							|  |  |  |  |                             a.Level, | 
					
						
							|  |  |  |  |                             a.Speciality, | 
					
						
							|  |  |  |  |                             a.AskDestructionTime, | 
					
						
							|  |  |  |  |                             a.RealityDestructionTime, | 
					
						
							|  |  |  |  |                             a.RestrictCondition, | 
					
						
							|  |  |  |  |                             a.DecisionIsClose, | 
					
						
							|  |  |  |  |                             DecisionIsCloseName = a.DecisionIsClose == 1 ? "已关闭" : "未关闭" | 
					
						
							|  |  |  |  |                         }; | 
					
						
							|  |  |  |  |             var model = query.FirstOrDefault(); | 
					
						
							|  |  |  |  |             if (model != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 lblProjectName.Text = model.ProjectName; | 
					
						
							|  |  |  |  |                 lblResponsibilityUnit.Text = model.ResponsibilityUnitName; | 
					
						
							|  |  |  |  |                 lblQuestionDesc.Text = model.QuestionDesc; | 
					
						
							|  |  |  |  |                 lblRestrictCondition.Text = model.RestrictCondition; | 
					
						
							|  |  |  |  |                 lblLevel.Text = model.Level; | 
					
						
							|  |  |  |  |                 lblSpeciality.Text = model.Speciality; | 
					
						
							|  |  |  |  |                 lblAskDestructionTime.Text = model.AskDestructionTime.Value != null ? model.AskDestructionTime.Value.ToString("yyyy-MM-dd") : string.Empty; | 
					
						
							|  |  |  |  |                 lblRealityDestructionTime.Text = model.RealityDestructionTime != null ? model.RealityDestructionTime.Value.ToString("yyyy-MM-dd") : string.Empty; | 
					
						
							|  |  |  |  |                 lblResponsibilityUser.Text = model.ResponsibilityUserName; | 
					
						
							|  |  |  |  |                 lblProposeUser.Text = model.ProposeUserName; | 
					
						
							|  |  |  |  |                 lblGeneraUser.Text = model.GeneraUserName; | 
					
						
							|  |  |  |  |                 lblSupervisionUser.Text = model.SupervisionUserName; | 
					
						
							|  |  |  |  |                 lblOwnerUser.Text = model.OwnerUserName; | 
					
						
							|  |  |  |  |                 lblDecisionIsClose.Text = model.DecisionIsCloseName; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 问题图片查看 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         protected void imgBtnQuestionFile_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/CheckControl&menuId={1}", this.DecisionId + "q", Const.InspectTailTerm))); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							| 
									
										
										
										
											2023-12-25 14:19:31 +08:00
										 |  |  |  |         /// 整改图片查看 | 
					
						
							| 
									
										
										
										
											2023-12-20 15:48:05 +08:00
										 |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         protected void imgBtnRectifyFile_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/CheckControl&menuId={1}", this.DecisionId + "h", Const.InspectTailTerm))); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 确认 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         protected void btnPass_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             var decisionModel = Funs.DB.PreRun_SubThreeChecksFourDecision.FirstOrDefault(x => x.DecisionId == this.DecisionId); | 
					
						
							|  |  |  |  |             if (decisionModel != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2023-12-25 14:19:31 +08:00
										 |  |  |  |                 if (this.ConfirmType == 4) | 
					
						
							| 
									
										
										
										
											2023-12-20 15:48:05 +08:00
										 |  |  |  |                 { | 
					
						
							|  |  |  |  |                     decisionModel.GeneraConfirm = 2; | 
					
						
							|  |  |  |  |                     decisionModel.GeneraConfirmData = DateTime.Now; | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2023-12-25 14:19:31 +08:00
										 |  |  |  |                 if (this.ConfirmType == 5) | 
					
						
							| 
									
										
										
										
											2023-12-20 15:48:05 +08:00
										 |  |  |  |                 { | 
					
						
							|  |  |  |  |                     decisionModel.SupervisionConfirm = 2; | 
					
						
							|  |  |  |  |                     decisionModel.SupervisionConfirmData = DateTime.Now; | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2023-12-25 14:19:31 +08:00
										 |  |  |  |                 if (this.ConfirmType == 6) | 
					
						
							| 
									
										
										
										
											2023-12-20 15:48:05 +08:00
										 |  |  |  |                 { | 
					
						
							|  |  |  |  |                     decisionModel.OwnerConfirm = 2; | 
					
						
							|  |  |  |  |                     decisionModel.OwnerConfirmData = DateTime.Now; | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2023-12-25 14:19:31 +08:00
										 |  |  |  |                 if (decisionModel.GeneraConfirm == 2 && decisionModel.SupervisionConfirm == 2 && decisionModel.OwnerConfirm == 2) | 
					
						
							| 
									
										
										
										
											2023-12-20 15:48:05 +08:00
										 |  |  |  |                 { | 
					
						
							|  |  |  |  |                     decisionModel.DecisionIsClose = 1; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 var model = new PreRun_DecisionConfirmRecords(); | 
					
						
							|  |  |  |  |                 model.ConfirmId = Guid.NewGuid().ToString(); | 
					
						
							|  |  |  |  |                 model.ProjectId = this.CurrUser.LoginProjectId; | 
					
						
							|  |  |  |  |                 model.DecisionId = this.DecisionId; | 
					
						
							|  |  |  |  |                 model.ConfirmDesc = txtConfirmDesc.Text; | 
					
						
							|  |  |  |  |                 model.ConfirmTime = DateTime.Now; | 
					
						
							|  |  |  |  |                 model.ConfirmUser = this.CurrUser.UserId; | 
					
						
							|  |  |  |  |                 model.ConfirmType = this.ConfirmType; | 
					
						
							|  |  |  |  |                 model.ConfirmState = 1; | 
					
						
							|  |  |  |  |                 model.AddUser = this.CurrUser.UserId; | 
					
						
							|  |  |  |  |                 model.AddTime = DateTime.Now; | 
					
						
							|  |  |  |  |                 Funs.DB.PreRun_DecisionConfirmRecords.InsertOnSubmit(model); | 
					
						
							|  |  |  |  |                 Funs.DB.SubmitChanges(); | 
					
						
							|  |  |  |  |                 ShowNotify("确认成功!", MessageBoxIcon.Success); | 
					
						
							|  |  |  |  |                 PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 关闭 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         protected void WindowAtt_Close(object sender, WindowCloseEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |