| 
									
										
										
										
											2024-03-22 17:26:57 +08:00
										 |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							| 
									
										
										
										
											2024-04-01 10:29:19 +08:00
										 |  |  |  | using System.Data; | 
					
						
							| 
									
										
										
										
											2024-03-22 17:26:57 +08:00
										 |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Web; | 
					
						
							|  |  |  |  | using System.Web.UI; | 
					
						
							|  |  |  |  | using System.Web.UI.WebControls; | 
					
						
							|  |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using Model; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace FineUIPro.Web.Personal | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class TestRunMonthSummaryEdit : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 定义项 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public string TestRunMonthSummaryId | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return (string)ViewState["TestRunMonthSummaryId"]; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             set | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 ViewState["TestRunMonthSummaryId"] = value; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 加载页面 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); | 
					
						
							|  |  |  |  |                 ProjectService.InitAllProjectDropDownList2(this.drpProject, true); | 
					
						
							|  |  |  |  |                 this.TestRunMonthSummaryId = Request.QueryString["TestRunMonthSummaryId"]; | 
					
						
							|  |  |  |  |                 if (!String.IsNullOrEmpty(this.TestRunMonthSummaryId)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     var MonthSummary = BLL.Person_TestRunMonthSummaryService.GetPersonTestRunMonthSummaryById(this.TestRunMonthSummaryId); | 
					
						
							|  |  |  |  |                     if (MonthSummary != null) | 
					
						
							|  |  |  |  |                     { | 
					
						
							| 
									
										
										
										
											2024-04-01 10:29:19 +08:00
										 |  |  |  |                         this.hdId.Text = this.TestRunMonthSummaryId; | 
					
						
							| 
									
										
										
										
											2024-03-22 17:26:57 +08:00
										 |  |  |  |                         if (MonthSummary.RaiseDate != null) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             this.txtRaiseDate.Text = string.Format("{0:yyyy-MM-dd}", MonthSummary.RaiseDate); | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         this.lbUserName.Text = BLL.UserService.GetUserNameByUserId(MonthSummary.UserId); | 
					
						
							|  |  |  |  |                         if (!string.IsNullOrEmpty(MonthSummary.ProjectId)) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             this.drpProject.SelectedValue = MonthSummary.ProjectId; | 
					
						
							|  |  |  |  |                         } | 
					
						
							| 
									
										
										
										
											2024-04-01 10:29:19 +08:00
										 |  |  |  |                         this.txtMajor.Text = MonthSummary.Major; | 
					
						
							| 
									
										
										
										
											2024-03-22 17:26:57 +08:00
										 |  |  |  |                         this.txtProcessName.Text = MonthSummary.ProcessName; | 
					
						
							|  |  |  |  |                         this.txtProblemDescription.Text = MonthSummary.ProblemDescription; | 
					
						
							|  |  |  |  |                         this.txtHandleMethod.Text = MonthSummary.HandleMethod; | 
					
						
							|  |  |  |  |                         this.txtExperienceOrSuggestion.Text = MonthSummary.ExperienceOrSuggestion; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2024-04-01 10:29:19 +08:00
										 |  |  |  |                     this.txtMajor.Text = "开车"; | 
					
						
							| 
									
										
										
										
											2024-03-22 17:26:57 +08:00
										 |  |  |  |                     this.lbUserName.Text = this.CurrUser.UserName; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 保存数据 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnSave_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (string.IsNullOrEmpty(this.txtRaiseDate.Text.Trim())) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Alert.ShowInParent("请选择提出时间!", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (this.drpProject.SelectedValue == BLL.Const._Null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Alert.ShowInParent("请选择项目名称/项目号或本部!", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             Model.Person_TestRunMonthSummary newMonthSummary = new Model.Person_TestRunMonthSummary() | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 RaiseDate = Funs.GetNewDateTimeOrNow(this.txtRaiseDate.Text.Trim()), | 
					
						
							|  |  |  |  |                 UserId = this.CurrUser.UserId, | 
					
						
							|  |  |  |  |                 ProjectId = this.drpProject.SelectedValue, | 
					
						
							| 
									
										
										
										
											2024-04-01 10:29:19 +08:00
										 |  |  |  |                 Major = this.txtMajor.Text.Trim(), | 
					
						
							| 
									
										
										
										
											2024-03-22 17:26:57 +08:00
										 |  |  |  |                 ProcessName = this.txtProcessName.Text.Trim(), | 
					
						
							|  |  |  |  |                 ProblemDescription = this.txtProblemDescription.Text.Trim(), | 
					
						
							|  |  |  |  |                 HandleMethod = this.txtHandleMethod.Text.Trim(), | 
					
						
							|  |  |  |  |                 ExperienceOrSuggestion = this.txtExperienceOrSuggestion.Text.Trim(), | 
					
						
							|  |  |  |  |             }; | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(this.TestRunMonthSummaryId)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 newMonthSummary.TestRunMonthSummaryId = this.TestRunMonthSummaryId; | 
					
						
							|  |  |  |  |                 BLL.Person_TestRunMonthSummaryService.UpdatePersonTestRunMonthSummary(newMonthSummary); | 
					
						
							|  |  |  |  |                 BLL.LogService.AddSys_Log(this.CurrUser, null, newMonthSummary.TestRunMonthSummaryId, BLL.Const.TestRunMonthSummaryMenuId, BLL.Const.BtnAdd); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-04-01 10:29:19 +08:00
										 |  |  |  |                 if (!string.IsNullOrEmpty(this.hdId.Text)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     newMonthSummary.TestRunMonthSummaryId = this.hdId.Text; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     newMonthSummary.TestRunMonthSummaryId = SQLHelper.GetNewID(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2024-03-22 17:26:57 +08:00
										 |  |  |  |                 BLL.Person_TestRunMonthSummaryService.AddPersonTestRunMonthSummary(newMonthSummary); | 
					
						
							|  |  |  |  |                 BLL.LogService.AddSys_Log(this.CurrUser, null, newMonthSummary.TestRunMonthSummaryId, BLL.Const.TestRunMonthSummaryMenuId, BLL.Const.BtnModify); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             ShowNotify("保存成功!", MessageBoxIcon.Success); | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2024-04-01 10:29:19 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 附件上传 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 附件上传 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnAttach_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (string.IsNullOrEmpty(this.hdId.Text))   //新增记录 | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.hdId.Text = SQLHelper.GetNewID(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(Request.Params["type"])) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/TestRun/TestRunMonthSummary&menuId={1}", this.hdId.Text, BLL.Const.TestRunMonthSummaryMenuId))); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/TestRunMonthSummary&menuId={1}", this.hdId.Text, BLL.Const.TestRunMonthSummaryMenuId))); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 附件上传 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnAttachR_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (string.IsNullOrEmpty(this.hdId.Text))   //新增记录 | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.hdId.Text = SQLHelper.GetNewID(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(Request.Params["type"])) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=-1&toKeyId={0}&path=FileUpload/TestRun/TestRunMonthSummary&menuId={1}", this.hdId.Text + "R", BLL.Const.TestRunMonthSummaryMenuId))); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/TestRunMonthSummary&menuId={1}", this.hdId.Text + "R", BLL.Const.TestRunMonthSummaryMenuId))); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 关闭弹出窗口 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 关闭弹出窗口 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void WindowAtt_Close(object sender, WindowCloseEventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |        | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							| 
									
										
										
										
											2024-03-22 17:26:57 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | } |