| 
									
										
										
										
											2025-03-24 14:21:16 +08:00
										 |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using Model; | 
					
						
							|  |  |  |  | using Newtonsoft.Json.Linq; | 
					
						
							|  |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Data; | 
					
						
							|  |  |  |  | using System.Data.SqlClient; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Web; | 
					
						
							|  |  |  |  | using System.Web.UI; | 
					
						
							|  |  |  |  | using System.Web.UI.WebControls; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace FineUIPro.Web.PZHGL.GJSX | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class GJSXDetailEdit : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         #region 定义项 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 事项Id | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         private string GJSXID | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return (string)ViewState["GJSXID"]; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             set | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 ViewState["GJSXID"] = value; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 事项进展Id | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         private string GJSXDetailId | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return (string)ViewState["GJSXDetailId"]; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             set | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 ViewState["GJSXDetailId"] = value; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 项目主键 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public string ProjectId | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return (string)ViewState["ProjectId"]; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             set | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 ViewState["ProjectId"] = value; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.GJSXID = Request.Params["GJSXID"]; | 
					
						
							|  |  |  |  |                 this.ProjectId = this.CurrUser.LoginProjectId; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 附件上传 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 上传附件 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnAttachUrl_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (string.IsNullOrWhiteSpace(this.txtProgress_detail.Text.Trim())) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Alert.ShowInParent("请输入进展情况!", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             SaveData(); | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?toKeyId={0}&path=FileUpload/Gjsx&menuId={1}", | 
					
						
							|  |  |  |  |                 this.GJSXDetailId, BLL.Const.GJSXMenuId))); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 保存 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnSave_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             SaveData(); | 
					
						
							|  |  |  |  |             ShowNotify("保存成功", MessageBoxIcon.Success); | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 保存事项进展数据 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         protected void SaveData() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             var progressStatus = this.ddlProgressStatus.SelectedValue; | 
					
						
							| 
									
										
										
										
											2025-09-22 20:39:23 +08:00
										 |  |  |  |             var progress_detail = this.txtProgress_detail.Text.Trim(); | 
					
						
							| 
									
										
										
										
											2025-03-24 14:21:16 +08:00
										 |  |  |  |             Model.SGGLDB db = Funs.DB; | 
					
						
							|  |  |  |  |             var model = new Model.GJSX_detail | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 GJSXID = this.GJSXID, | 
					
						
							|  |  |  |  |                 //Cuid = this.GJSXDetailId, | 
					
						
							| 
									
										
										
										
											2025-09-22 20:39:23 +08:00
										 |  |  |  |                 Progress_detail = progress_detail, | 
					
						
							| 
									
										
										
										
											2025-03-24 14:21:16 +08:00
										 |  |  |  |                 ProgressStatus = progressStatus, | 
					
						
							|  |  |  |  |                 Progress_user = this.CurrUser.UserId, | 
					
						
							|  |  |  |  |                 Date = DateTime.Now, | 
					
						
							|  |  |  |  |                 //Sort = sortIndex | 
					
						
							|  |  |  |  |             }; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(this.GJSXDetailId)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 model.Cuid = this.GJSXDetailId; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.GJSXDetailId = SQLHelper.GetNewID(typeof(Model.GJSX_detail)); | 
					
						
							|  |  |  |  |                 //var lastGJSX = db.GJSX_detail.Where(p => p.GJSXID == this.GJSXID).OrderByDescending(x => x.Sort).FirstOrDefault(); | 
					
						
							|  |  |  |  |                 //int sortIndex = lastGJSX != null ? (int)lastGJSX.Sort + 1 : 0; | 
					
						
							|  |  |  |  |                 //model.Sort = sortIndex; | 
					
						
							|  |  |  |  |                 model.Cuid = this.GJSXDetailId; | 
					
						
							|  |  |  |  |                 db.GJSX_detail.InsertOnSubmit(model); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             var gjsx = db.GJSX.Where(p => p.GJSXID == this.GJSXID).FirstOrDefault(); | 
					
						
							|  |  |  |  |             if (progressStatus == "申请关闭") | 
					
						
							|  |  |  |  |             {//申请关闭 | 
					
						
							|  |  |  |  |                 gjsx.State = "3"; | 
					
						
							|  |  |  |  |                 gjsx.ProgressStatus = "1"; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else if (progressStatus == "持续跟踪") | 
					
						
							|  |  |  |  |             {//持续跟踪 | 
					
						
							|  |  |  |  |                 gjsx.ProgressStatus = "0"; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             db.SubmitChanges(); | 
					
						
							| 
									
										
										
										
											2025-09-22 20:39:23 +08:00
										 |  |  |  |             if (progressStatus == "申请关闭") | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 //申请关闭邮件提醒:提出人和跟踪人 | 
					
						
							|  |  |  |  |                 GJSXMonitorService.GJSXApplyCloseNoticeSendEmail(this.GJSXID, progress_detail); | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-03-24 14:21:16 +08:00
										 |  |  |  |             //ShowNotify("保存成功", MessageBoxIcon.Success); | 
					
						
							|  |  |  |  |             //PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |