| 
									
										
										
										
											2024-01-22 22:14:57 +08:00
										 |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using System; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace FineUIPro.Web.TestRun.PersonTrain | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class PersonTrainPlanEdit : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         #region 加载 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 页面加载 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 ///培训类型 | 
					
						
							| 
									
										
										
										
											2024-02-06 17:11:15 +08:00
										 |  |  |  |                 //this.drpTrainType.DataTextField = "Text"; | 
					
						
							|  |  |  |  |                 //this.drpTrainType.DataValueField = "Value"; | 
					
						
							|  |  |  |  |                 //this.drpTrainType.DataSource=BLL.DropListService.drpTrainTypeList(); | 
					
						
							|  |  |  |  |                 //this.drpTrainType.DataBind(); | 
					
						
							| 
									
										
										
										
											2024-01-22 22:14:57 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |                 string id = Request.Params["id"]; | 
					
						
							|  |  |  |  |                 if (!string.IsNullOrEmpty(id)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     Model.TestRun_PersonTrainPlan data = BLL.PersonTrainPlanService.GetPersonTrainPlanById(id); | 
					
						
							|  |  |  |  |                     if (data != null) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         this.hdId.Text = id; | 
					
						
							| 
									
										
										
										
											2024-02-06 17:11:15 +08:00
										 |  |  |  |                         //if (!string.IsNullOrEmpty(data.TrainType)) | 
					
						
							|  |  |  |  |                         //{ | 
					
						
							|  |  |  |  |                         //    this.drpTrainType.SelectedValue = data.TrainType; | 
					
						
							|  |  |  |  |                         //} | 
					
						
							|  |  |  |  |                         //this.txtPurpose.Text = data.Purpose; | 
					
						
							| 
									
										
										
										
											2024-01-22 22:14:57 +08:00
										 |  |  |  |                         this.txtTrainingContent.Text = data.TrainingContent; | 
					
						
							|  |  |  |  |                         this.txtTrainingAddress.Text = data.TrainingAddress; | 
					
						
							|  |  |  |  |                         this.txtTrainingDate.Text = data.TrainingDate.HasValue ? string.Format("{0:yyyy-MM-dd}", data.TrainingDate) : ""; | 
					
						
							| 
									
										
										
										
											2024-02-06 17:11:15 +08:00
										 |  |  |  |                         //this.txtTrainingPersonNum.Text = data.TrainingPersonNum; | 
					
						
							|  |  |  |  |                         //this.txtTrainingHours.Text = data.TrainingHours.HasValue ? data.TrainingHours.ToString() : ""; | 
					
						
							|  |  |  |  |                         //this.txtTrainingManager.Text = data.TrainingManager; | 
					
						
							|  |  |  |  |                         //this.txtTrainingTeacher.Text = data.TrainingTeacher; | 
					
						
							|  |  |  |  |                         //this.txtAssessmentMethod.Text = data.AssessmentMethod; | 
					
						
							| 
									
										
										
										
											2024-01-22 22:14:57 +08:00
										 |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     this.txtTrainingDate.Text = string.Format("{0:yyyy-MM-dd}", DateTime.Now); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #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(typeof(Model.TestRun_PersonTrainPlan)); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("../../AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/TestRun/PersonTrain/PersonTrainPlan&menuId={1}", this.hdId.Text, BLL.Const.PersonTrainPlanMenuId))); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 保存 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 保存按钮 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnSave_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-02-06 17:11:15 +08:00
										 |  |  |  |             //if (string.IsNullOrEmpty(this.drpTrainType.SelectedValue)||this.drpTrainType.SelectedValue==BLL.Const._Null) | 
					
						
							|  |  |  |  |             //{ | 
					
						
							|  |  |  |  |             //    Alert.ShowInTop("请选择培训类型!", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |             //    return; | 
					
						
							|  |  |  |  |             //} | 
					
						
							| 
									
										
										
										
											2024-01-22 22:14:57 +08:00
										 |  |  |  |             string id = Request.Params["id"]; | 
					
						
							|  |  |  |  |             Model.TestRun_PersonTrainPlan newData = new Model.TestRun_PersonTrainPlan(); | 
					
						
							| 
									
										
										
										
											2024-02-06 17:11:15 +08:00
										 |  |  |  |             //newData.TrainType = this.drpTrainType.SelectedValue; | 
					
						
							|  |  |  |  |             //newData.Purpose = this.txtPurpose.Text.Trim(); | 
					
						
							| 
									
										
										
										
											2024-01-22 22:14:57 +08:00
										 |  |  |  |             newData.TrainingContent = this.txtTrainingContent.Text.Trim(); | 
					
						
							|  |  |  |  |             newData.TrainingAddress = this.txtTrainingAddress.Text.Trim(); | 
					
						
							|  |  |  |  |             newData.TrainingDate = Funs.GetNewDateTime(this.txtTrainingDate.Text.Trim()); | 
					
						
							| 
									
										
										
										
											2024-02-06 17:11:15 +08:00
										 |  |  |  |             //newData.TrainingPersonNum = this.txtTrainingPersonNum.Text.Trim(); | 
					
						
							|  |  |  |  |             //newData.TrainingHours = Funs.GetNewDecimal(this.txtTrainingHours.Text.Trim()); | 
					
						
							|  |  |  |  |             //newData.TrainingManager = this.txtTrainingManager.Text.Trim(); | 
					
						
							|  |  |  |  |             //newData.TrainingTeacher = this.txtTrainingTeacher.Text.Trim(); | 
					
						
							|  |  |  |  |             //newData.AssessmentMethod = this.txtAssessmentMethod.Text.Trim(); | 
					
						
							| 
									
										
										
										
											2024-01-22 22:14:57 +08:00
										 |  |  |  |             newData.ProjectId = this.CurrUser.LoginProjectId; | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(id)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 newData.PersonTrainPlanId = id; | 
					
						
							|  |  |  |  |                 BLL.PersonTrainPlanService.UpdatePersonTrainPlan(newData); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (!string.IsNullOrEmpty(this.hdId.Text)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     newData.PersonTrainPlanId = this.hdId.Text.Trim(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     newData.PersonTrainPlanId = SQLHelper.GetNewID(typeof(Model.TestRun_PersonTrainPlan)); | 
					
						
							|  |  |  |  |                     this.hdId.Text = newData.PersonTrainPlanId; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 BLL.PersonTrainPlanService.AddPersonTrainPlan(newData); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             ShowNotify("保存成功!", MessageBoxIcon.Success); | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |