| 
									
										
										
										
											2021-06-21 14:10:40 +08:00
										 |  |  |  | using System; | 
					
						
							|  |  |  |  | using System.Collections.Generic; | 
					
						
							|  |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | using System.Web; | 
					
						
							|  |  |  |  | using System.Web.UI; | 
					
						
							|  |  |  |  | using System.Web.UI.WebControls; | 
					
						
							|  |  |  |  | using BLL; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace FineUIPro.Web.Party | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class PartyCongressEdit : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         #region 加载 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 页面加载 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 string id = Request.Params["partyCongressId"]; | 
					
						
							|  |  |  |  |                 string year = DateTime.Now.Year.ToString(); | 
					
						
							|  |  |  |  |                 if (!string.IsNullOrEmpty(Request.Params["Year"])) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     year = Request.Params["Year"]; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 ConstValue.InitConstValueDropDownList(this.drpQuarter, ConstValue.Group_0011, true); | 
					
						
							|  |  |  |  |                 if (!string.IsNullOrEmpty(id)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     Model.Party_PartyCongress partyCongress = BLL.PartyCongressService.GetPartyCongressById(id); | 
					
						
							|  |  |  |  |                     if (partyCongress != null) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         this.hdId.Text = id; | 
					
						
							|  |  |  |  |                         if (partyCongress.Year != null) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             this.txtYear.Text = partyCongress.Year.ToString(); | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                         if (partyCongress.Quarter != null) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             this.drpQuarter.SelectedValue = partyCongress.Quarter.ToString(); | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     this.txtYear.Text = year; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #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.Party_PartyCongress)); | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2021-08-13 11:15:59 +08:00
										 |  |  |  |             PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/Party/PartyCongress&menuId={1}", this.hdId.Text, BLL.Const.PartyCongressMenuId))); | 
					
						
							| 
									
										
										
										
											2021-06-21 14:10:40 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void btnAttach2_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (string.IsNullOrEmpty(this.hdId.Text))   //新增记录 | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.hdId.Text = SQLHelper.GetNewID(typeof(Model.Party_PartyCongress)); | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2021-08-13 11:15:59 +08:00
										 |  |  |  |             PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/Party/PartyCongress&menuId={1}", this.hdId.Text + "2", BLL.Const.PartyCongressMenuId))); | 
					
						
							| 
									
										
										
										
											2021-06-21 14:10:40 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void btnAttach3_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (string.IsNullOrEmpty(this.hdId.Text))   //新增记录 | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.hdId.Text = SQLHelper.GetNewID(typeof(Model.Party_PartyCongress)); | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2021-08-13 11:15:59 +08:00
										 |  |  |  |             PageContext.RegisterStartupScript(WindowAtt.GetShowReference(String.Format("~/AttachFile/webuploader.aspx?type=0&toKeyId={0}&path=FileUpload/Party/PartyCongress&menuId={1}", this.hdId.Text + "3", BLL.Const.PartyCongressMenuId))); | 
					
						
							| 
									
										
										
										
											2021-06-21 14:10:40 +08:00
										 |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 保存 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 保存按钮 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnSave_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (this.drpQuarter.SelectedValue == BLL.Const._Null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Alert.ShowInTop("请选择季度", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             string id = Request.Params["partyCongressId"]; | 
					
						
							|  |  |  |  |             Model.Party_PartyCongress newPartyCongress = new Model.Party_PartyCongress(); | 
					
						
							|  |  |  |  |             newPartyCongress.Year = Funs.GetNewIntOrZero(this.txtYear.Text.Trim()); | 
					
						
							|  |  |  |  |             newPartyCongress.Quarter = Funs.GetNewInt(this.drpQuarter.SelectedValue); | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(id)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 newPartyCongress.PartyCongressId = id; | 
					
						
							|  |  |  |  |                 BLL.PartyCongressService.UpdatePartyCongress(newPartyCongress); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (!string.IsNullOrEmpty(this.hdId.Text)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     newPartyCongress.PartyCongressId = this.hdId.Text.Trim(); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     newPartyCongress.PartyCongressId = SQLHelper.GetNewID(typeof(Model.Party_PartyCongress)); | 
					
						
							|  |  |  |  |                     this.hdId.Text = newPartyCongress.PartyCongressId; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 newPartyCongress.CompileMan = this.CurrUser.UserId; | 
					
						
							|  |  |  |  |                 newPartyCongress.CompileDate = DateTime.Now; | 
					
						
							|  |  |  |  |                 BLL.PartyCongressService.AddPartyCongress(newPartyCongress); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             ShowNotify("保存成功!", MessageBoxIcon.Success); | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  |     } | 
					
						
							|  |  |  |  | } |