| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  | using BLL; | 
					
						
							|  |  |  |  | using System; | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  | using System.Collections.Generic; | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  | using System.Linq; | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | namespace FineUIPro.Web.CQMS.QuantityManagement | 
					
						
							|  |  |  |  | { | 
					
						
							|  |  |  |  |     public partial class BaseEdit : PageBase | 
					
						
							|  |  |  |  |     { | 
					
						
							|  |  |  |  |         #region 定义变量 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 主键 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public string BaseId | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return (string)ViewState["BaseId"]; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             set | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 ViewState["BaseId"] = value; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 办理类型 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public string State | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             get | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return (string)ViewState["State"]; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             set | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 ViewState["State"] = value; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 加载 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 加载页面 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void Page_Load(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (!IsPostBack) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 GetButtonPower(); | 
					
						
							|  |  |  |  |                 this.BaseId = Request.Params["BaseId"]; | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                 plApprove1.Hidden = true; | 
					
						
							|  |  |  |  |                 plApprove2.Hidden = true; | 
					
						
							|  |  |  |  |                 rblIsAgree.Hidden = true; | 
					
						
							|  |  |  |  |                 rblIsAgree.SelectedValue = "true"; | 
					
						
							|  |  |  |  |                 BLL.DrawingService.InitDrawingChangeDropDownList(drpDrawingNo, this.CurrUser.LoginProjectId, true); | 
					
						
							|  |  |  |  |                 BLL.TeamGroupService.InitTeamGroupProjectDropDownList(drpWorkTeam, this.CurrUser.LoginProjectId, true); | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |                 var Base = BLL.BaseService.GetBaseById(this.BaseId); | 
					
						
							|  |  |  |  |                 if (Base != null) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     Model.QuantityManagement_Drawing drawing = BLL.DrawingService.GetDrawingById(Base.DrawingId); | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                     Model.QuantityManagement_Change change = BLL.ChangeService.GetChangeById(Base.DrawingId); | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |                     this.BaseId = Base.BaseId; | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                     plApprove1.Hidden = false; | 
					
						
							|  |  |  |  |                     plApprove2.Hidden = false; | 
					
						
							|  |  |  |  |                     var dt = BaseApproveService.getListData(BaseId); | 
					
						
							|  |  |  |  |                     gvApprove.DataSource = dt; | 
					
						
							|  |  |  |  |                     gvApprove.DataBind(); | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |                     if (drawing != null) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         this.txtWorkSection.Text = drawing.WorkSection; | 
					
						
							|  |  |  |  |                         this.drpDrawingNo.SelectedValue = Base.DrawingId; | 
					
						
							|  |  |  |  |                         this.txtDrawingName.Text = drawing.DrawingName; | 
					
						
							|  |  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                     else if (change != null) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         this.txtWorkSection.Text = change.WorkSection; | 
					
						
							|  |  |  |  |                         this.drpDrawingNo.SelectedValue = Base.DrawingId; | 
					
						
							|  |  |  |  |                         this.txtDrawingName.Text = change.ChangeName; | 
					
						
							|  |  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |                     this.txtPart.Text = Base.Part; | 
					
						
							|  |  |  |  |                     this.txtProjectContent.Text = Base.ProjectContent; | 
					
						
							|  |  |  |  |                     this.txtUnit.Text = Base.Unit; | 
					
						
							|  |  |  |  |                     if (Base.Amount != null) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         this.txtAmount.Text = Base.Amount.ToString(); | 
					
						
							|  |  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                     if (!string.IsNullOrEmpty(Base.WorkTeam)) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         this.drpWorkTeam.SelectedValue = Base.WorkTeam; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                     if (!string.IsNullOrEmpty(Base.State)) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         State = Base.State; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                     else | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         State = BLL.Const.Base_Compile; | 
					
						
							|  |  |  |  |                         this.rblIsAgree.Visible = false; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                     if (State != BLL.Const.Base_Complete) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         //Funs.Bind(drpHandleType, BaseService.GetDHandleTypeByState(State)); | 
					
						
							|  |  |  |  |                         BaseService.Init(drpHandleType, State, false); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                     if (State == BLL.Const.Base_Compile) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         this.rblIsAgree.Visible = false; | 
					
						
							|  |  |  |  |                         UserService.InitUserDropDownList2(drpHandleMan, CurrUser.LoginProjectId, false, string.Empty); | 
					
						
							|  |  |  |  |                         this.drpHandleMan.SelectedIndex = 1; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                     else | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         UserService.InitUserDropDownList2(drpHandleMan, CurrUser.LoginProjectId, false, string.Empty); | 
					
						
							|  |  |  |  |                         this.rblIsAgree.Visible = true; | 
					
						
							|  |  |  |  |                         if (drpHandleType.SelectedValue == BLL.Const.Base_ReCompile) | 
					
						
							|  |  |  |  |                         { | 
					
						
							|  |  |  |  |                             var HandleMan = BLL.BaseApproveService.GetComplie(this.BaseId); | 
					
						
							|  |  |  |  |                             if (HandleMan != null) | 
					
						
							|  |  |  |  |                             { | 
					
						
							|  |  |  |  |                                 this.drpHandleMan.SelectedValue = UserService.GetUserNameByUserId(HandleMan.ApproveMan); | 
					
						
							|  |  |  |  |                             } | 
					
						
							|  |  |  |  |                         } | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     //设置流程上是否有同意不同意 | 
					
						
							|  |  |  |  |                     if (State == Const.Base_Audit1) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         rblIsAgree.Hidden = false; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                     else | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         rblIsAgree.Hidden = true; | 
					
						
							|  |  |  |  |                     } | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                     State = Const.Base_Compile; | 
					
						
							|  |  |  |  |                     BaseService.Init(drpHandleType, State, false); | 
					
						
							|  |  |  |  |                     UserService.InitUserDropDownList2(drpHandleMan, CurrUser.LoginProjectId, false, string.Empty); | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 //是否同意触发 | 
					
						
							|  |  |  |  |                 if (!rblIsAgree.Hidden) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     HandleType(); | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 待办事项的下拉框的处理 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         public void HandleType() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             drpHandleType.Items.Clear(); | 
					
						
							|  |  |  |  |             BaseService.Init(drpHandleType, State, false); | 
					
						
							|  |  |  |  |             string res = null; | 
					
						
							|  |  |  |  |             List<string> list = new List<string>(); | 
					
						
							|  |  |  |  |             list.Add(Const.Base_ReCompile); | 
					
						
							|  |  |  |  |             var count = drpHandleType.Items.Count; | 
					
						
							|  |  |  |  |             List<ListItem> listitem = new List<ListItem>(); | 
					
						
							|  |  |  |  |             if (rblIsAgree.SelectedValue.Equals("true")) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 for (int i = 0; i < count; i++) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     res = drpHandleType.Items[i].Value; | 
					
						
							|  |  |  |  |                     if (list.Contains(res)) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         var item = (drpHandleType.Items[i]); | 
					
						
							|  |  |  |  |                         listitem.Add(item); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (listitem.Count > 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     for (int i = 0; i < listitem.Count; i++) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         drpHandleType.Items.Remove(listitem[i]); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 for (int i = 0; i < count; i++) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                     res = drpHandleType.Items[i].Value; | 
					
						
							|  |  |  |  |                     if (!list.Contains(res)) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         var item = drpHandleType.Items[i]; | 
					
						
							|  |  |  |  |                         listitem.Add(item); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (listitem.Count > 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     for (int i = 0; i < listitem.Count; i++) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         drpHandleType.Items.Remove(listitem[i]); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             if (count > 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 drpHandleType.SelectedIndex = 0; | 
					
						
							|  |  |  |  |                 HandleMan(); | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 办理人员的自动筛选 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         protected void HandleMan() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             drpHandleMan.Items.Clear(); | 
					
						
							|  |  |  |  |             if (!string.IsNullOrEmpty(drpHandleType.SelectedText)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 UserService.InitUserDropDownList2(drpHandleMan, CurrUser.LoginProjectId, false, string.Empty); | 
					
						
							|  |  |  |  |                 if (drpHandleMan.Items.Count > 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     drpHandleMan.SelectedIndex = 0; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (drpHandleType.SelectedText.Contains("重新编制")) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     UserService.InitUserDropDownList2(drpHandleMan, CurrUser.LoginProjectId, false, string.Empty); | 
					
						
							|  |  |  |  |                     var HandleMan = BLL.BaseApproveService.GetComplie(this.BaseId); | 
					
						
							|  |  |  |  |                     if (HandleMan != null) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         this.drpHandleMan.SelectedValue = HandleMan.ApproveMan; | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 if (drpHandleType.SelectedValue == BLL.Const.Base_Complete) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     drpHandleMan.Items.Clear(); | 
					
						
							|  |  |  |  |                     drpHandleMan.Enabled = false; | 
					
						
							|  |  |  |  |                     drpHandleMan.Required = false; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     drpHandleMan.Enabled = true; | 
					
						
							|  |  |  |  |                     drpHandleMan.Required = true; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void drpHandleType_SelectedIndexChanged(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             HandleMan(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         protected void rblIsAgree_SelectedIndexChanged(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             HandleType(); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |         protected void drpDrawingNo_SelectedIndexChanged(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             Model.QuantityManagement_Drawing drawing = BLL.DrawingService.GetDrawingById(this.drpDrawingNo.SelectedValue); | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |             Model.QuantityManagement_Change change = BLL.ChangeService.GetChangeById(this.drpDrawingNo.SelectedValue); | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |             if (drawing != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.txtWorkSection.Text = drawing.WorkSection; | 
					
						
							|  |  |  |  |                 this.txtDrawingName.Text = drawing.DrawingName; | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                 this.txtAmount.NoNegative = true; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             else if (change != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.txtWorkSection.Text = change.WorkSection; | 
					
						
							|  |  |  |  |                 this.txtDrawingName.Text = change.ChangeName; | 
					
						
							|  |  |  |  |                 this.txtAmount.NoNegative = false; | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 this.txtWorkSection.Text = string.Empty; | 
					
						
							|  |  |  |  |                 this.txtDrawingName.Text = string.Empty; | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                 this.txtAmount.NoNegative = true; | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 保存 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 保存按钮 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="sender"></param> | 
					
						
							|  |  |  |  |         /// <param name="e"></param> | 
					
						
							|  |  |  |  |         protected void btnSave_Click(object sender, EventArgs e) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (this.drpDrawingNo.SelectedValue == BLL.Const._Null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Alert.ShowInTop("请选择图号", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |             if (this.drpWorkTeam.SelectedValue == BLL.Const._Null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 Alert.ShowInTop("请选择计划作业队", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             Model.QuantityManagement_Drawing drawing = BLL.DrawingService.GetDrawingById(this.drpDrawingNo.SelectedValue); | 
					
						
							|  |  |  |  |             if (drawing != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 decimal d = Funs.GetNewDecimalOrZero(this.txtAmount.Text.Trim()); | 
					
						
							|  |  |  |  |                 if (d < 0) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     Alert.ShowInTop("图纸工程量总数不能为负数", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                     return; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |             Model.QuantityManagement_Base newBase = new Model.QuantityManagement_Base(); | 
					
						
							|  |  |  |  |             newBase.ProjectId = this.CurrUser.LoginProjectId; | 
					
						
							|  |  |  |  |             newBase.DrawingId = this.drpDrawingNo.SelectedValue; | 
					
						
							|  |  |  |  |             newBase.Part = this.txtPart.Text.Trim(); | 
					
						
							|  |  |  |  |             newBase.ProjectContent = this.txtProjectContent.Text.Trim(); | 
					
						
							|  |  |  |  |             newBase.Unit = this.txtUnit.Text.Trim(); | 
					
						
							|  |  |  |  |             newBase.Amount = Funs.GetNewDecimal(this.txtAmount.Text.Trim()); | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |             newBase.WorkTeam = this.drpWorkTeam.SelectedValue; | 
					
						
							|  |  |  |  |             newBase.State = drpHandleType.SelectedValue.Trim(); | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |             if (string.IsNullOrEmpty(this.BaseId)) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 newBase.BaseId = SQLHelper.GetNewID(typeof(Model.QuantityManagement_Base)); | 
					
						
							|  |  |  |  |                 newBase.CompileMan = this.CurrUser.UserId; | 
					
						
							|  |  |  |  |                 newBase.CompileDate = DateTime.Now; | 
					
						
							|  |  |  |  |                 //var sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == newBase.BaseId); | 
					
						
							|  |  |  |  |                 //if (sour == null || string.IsNullOrEmpty(sour.AttachUrl)) | 
					
						
							|  |  |  |  |                 //{ | 
					
						
							|  |  |  |  |                 //    Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 //    return; | 
					
						
							|  |  |  |  |                 //} | 
					
						
							|  |  |  |  |                 BLL.BaseService.AddBase(newBase); | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                 Model.QuantityManagement_BaseApprove approve1 = new Model.QuantityManagement_BaseApprove(); | 
					
						
							|  |  |  |  |                 approve1.BaseId = newBase.BaseId; | 
					
						
							|  |  |  |  |                 approve1.ApproveDate = DateTime.Now; | 
					
						
							|  |  |  |  |                 approve1.ApproveMan = this.CurrUser.UserId; | 
					
						
							|  |  |  |  |                 approve1.ApproveType = BLL.Const.Base_Compile; | 
					
						
							|  |  |  |  |                 BLL.BaseApproveService.AddBaseApprove(approve1); | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |                 Model.QuantityManagement_BaseApprove approve = new Model.QuantityManagement_BaseApprove(); | 
					
						
							|  |  |  |  |                 approve.BaseId = newBase.BaseId; | 
					
						
							|  |  |  |  |                 if (this.drpHandleMan.SelectedValue != "") | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     approve.ApproveMan = this.drpHandleMan.SelectedValue; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 approve.ApproveType = this.drpHandleType.SelectedValue; | 
					
						
							|  |  |  |  |                 BLL.BaseApproveService.AddBaseApprove(approve); | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |             } | 
					
						
							|  |  |  |  |             else | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 newBase.BaseId = this.BaseId; | 
					
						
							|  |  |  |  |                 //var sour = Funs.DB.AttachFile.FirstOrDefault(x => x.ToKeyId == this.BaseId); | 
					
						
							|  |  |  |  |                 //if (sour == null || string.IsNullOrEmpty(sour.AttachUrl)) | 
					
						
							|  |  |  |  |                 //{ | 
					
						
							|  |  |  |  |                 //    Alert.ShowInTop("请上传附件!", MessageBoxIcon.Warning); | 
					
						
							|  |  |  |  |                 //    return; | 
					
						
							|  |  |  |  |                 //} | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                 Model.QuantityManagement_BaseApprove approve1 = BLL.BaseApproveService.GetBaseApproveByBaseId(BaseId); | 
					
						
							|  |  |  |  |                 if (approve1 != null) | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                     approve1.ApproveDate = DateTime.Now; | 
					
						
							|  |  |  |  |                     approve1.ApproveIdea = txtOpinions.Text.Trim(); | 
					
						
							|  |  |  |  |                     approve1.IsAgree = Convert.ToBoolean(this.rblIsAgree.SelectedValue); | 
					
						
							|  |  |  |  |                     BLL.BaseApproveService.UpdateBaseApprove(approve1); | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                 if (this.drpHandleMan.SelectedValue != null) | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |                 { | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                     Model.QuantityManagement_BaseApprove approve = new Model.QuantityManagement_BaseApprove(); | 
					
						
							|  |  |  |  |                     approve.BaseId = BaseId; | 
					
						
							|  |  |  |  |                     approve.ApproveMan = this.drpHandleMan.SelectedValue; | 
					
						
							|  |  |  |  |                     approve.ApproveType = this.drpHandleType.SelectedValue; | 
					
						
							|  |  |  |  |                     if (this.drpHandleType.SelectedValue == BLL.Const.Base_Complete) | 
					
						
							|  |  |  |  |                     { | 
					
						
							|  |  |  |  |                         approve.ApproveDate = DateTime.Now.AddMinutes(1); | 
					
						
							|  |  |  |  |                     } | 
					
						
							|  |  |  |  |                     BLL.BaseApproveService.AddBaseApprove(approve); | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |                 } | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  |                 BLL.BaseService.UpdateBase(newBase); | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |             } | 
					
						
							|  |  |  |  |             ShowNotify("保存成功!", MessageBoxIcon.Success); | 
					
						
							|  |  |  |  |             PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							|  |  |  |  | 
 | 
					
						
							|  |  |  |  |         #region 获取按钮权限 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 获取按钮权限 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="button"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         private void GetButtonPower() | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (Request.Params["value"] == "0") | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 return; | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.BaseMenuId); | 
					
						
							|  |  |  |  |             if (buttonList.Count() > 0) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (buttonList.Contains(BLL.Const.BtnSave)) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     this.btnSave.Hidden = false; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |         } | 
					
						
							|  |  |  |  |         #endregion | 
					
						
							| 
									
										
										
										
											2025-03-05 16:48:17 +08:00
										 |  |  |  | 
 | 
					
						
							|  |  |  |  |         /// <summary> | 
					
						
							|  |  |  |  |         /// 把状态转换代号为文字形式 | 
					
						
							|  |  |  |  |         /// </summary> | 
					
						
							|  |  |  |  |         /// <param name="state"></param> | 
					
						
							|  |  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |  |         protected string ConvertState(object state) | 
					
						
							|  |  |  |  |         { | 
					
						
							|  |  |  |  |             if (state != null) | 
					
						
							|  |  |  |  |             { | 
					
						
							|  |  |  |  |                 if (state.ToString() == BLL.Const.Base_ReCompile) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return "重新编制"; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else if (state.ToString() == BLL.Const.Base_Compile) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return "编制"; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else if (state.ToString() == BLL.Const.Base_Audit1) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return "审核"; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else if (state.ToString() == BLL.Const.Base_Complete) | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return "审批完成"; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |                 else | 
					
						
							|  |  |  |  |                 { | 
					
						
							|  |  |  |  |                     return ""; | 
					
						
							|  |  |  |  |                 } | 
					
						
							|  |  |  |  |             } | 
					
						
							|  |  |  |  |             return ""; | 
					
						
							|  |  |  |  |         } | 
					
						
							| 
									
										
										
										
											2025-02-12 09:27:47 +08:00
										 |  |  |  |     } | 
					
						
							|  |  |  |  | } |