99 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			99 lines
		
	
	
		
			3.6 KiB
		
	
	
	
		
			C#
		
	
	
	
|  | using BLL; | |||
|  | using System; | |||
|  | using System.Collections.Generic; | |||
|  | using System.Linq; | |||
|  | using System.Web; | |||
|  | using System.Web.UI; | |||
|  | using System.Web.UI.WebControls; | |||
|  | 
 | |||
|  | namespace FineUIPro.Web.JDGL.Check | |||
|  | { | |||
|  |     public partial class SteelStructureCompletionEdit : PageBase | |||
|  |     { | |||
|  |         /// <summary> | |||
|  |         /// id | |||
|  |         /// </summary> | |||
|  |         public string SteelStructureCompletionId | |||
|  |         { | |||
|  |             get | |||
|  |             { | |||
|  |                 return (string)ViewState["SteelStructureCompletionId"]; | |||
|  |             } | |||
|  |             set | |||
|  |             { | |||
|  |                 ViewState["SteelStructureCompletionId"] = value; | |||
|  |             } | |||
|  |         } | |||
|  |         /// <summary> | |||
|  |         /// 项目id | |||
|  |         /// </summary> | |||
|  |         public string ProjectId | |||
|  |         { | |||
|  |             get | |||
|  |             { | |||
|  |                 return (string)ViewState["ProjectId"]; | |||
|  |             } | |||
|  |             set | |||
|  |             { | |||
|  |                 ViewState["ProjectId"] = value; | |||
|  |             } | |||
|  |         } | |||
|  |         protected void Page_Load(object sender, EventArgs e) | |||
|  |         { | |||
|  |             if (!IsPostBack) | |||
|  |             { | |||
|  | 
 | |||
|  |                 this.btnClose.OnClientClick = ActiveWindow.GetHideReference(); | |||
|  |                 SteelStructureCompletionId = Request.Params["SteelStructureCompletionId"]; | |||
|  |                 if (!string.IsNullOrEmpty(SteelStructureCompletionId)) | |||
|  |                 { | |||
|  | 
 | |||
|  |                     Model.JDGL_SteelStructureCompletion SteelStructureCompletion = BLL.SteelStructureCompletionService.GetSteelStructureCompletionById(SteelStructureCompletionId); | |||
|  |                     if (SteelStructureCompletion != null) | |||
|  |                     { | |||
|  |                         this.ProjectId = SteelStructureCompletion.ProjectId; | |||
|  |                         if (SteelStructureCompletion.ArrivalNum != null) | |||
|  |                         { | |||
|  |                             this.txtArrivalNum.Text = SteelStructureCompletion.ArrivalNum.ToString(); | |||
|  |                         } | |||
|  |                         if (SteelStructureCompletion.ThisNum != null) | |||
|  |                         { | |||
|  |                             this.txtThisNum.Text = SteelStructureCompletion.ThisNum.ToString(); | |||
|  |                         } | |||
|  |                     } | |||
|  |                 } | |||
|  |             } | |||
|  |         } | |||
|  | 
 | |||
|  |         protected void btnSave_Click(object sender, EventArgs e) | |||
|  |         { | |||
|  |             SaveData(true); | |||
|  |         } | |||
|  | 
 | |||
|  |         private void SaveData(bool bl) | |||
|  |         { | |||
|  |             string SteelStructureCompletionId = Request.Params["SteelStructureCompletionId"]; | |||
|  |             Model.JDGL_SteelStructureCompletion SteelStructureCompletion = new Model.JDGL_SteelStructureCompletion(); | |||
|  |             if (!string.IsNullOrEmpty(this.txtArrivalNum.Text.Trim())) | |||
|  |             { | |||
|  |                 SteelStructureCompletion.ArrivalNum = Convert.ToDecimal(this.txtArrivalNum.Text.Trim()); | |||
|  |             } | |||
|  |             if (!string.IsNullOrEmpty(this.txtThisNum.Text.Trim())) | |||
|  |             { | |||
|  |                 SteelStructureCompletion.ThisNum = Convert.ToDecimal(this.txtThisNum.Text.Trim()); | |||
|  |             } | |||
|  |             if (!string.IsNullOrEmpty(SteelStructureCompletionId)) | |||
|  |             { | |||
|  |                 SteelStructureCompletion.SteelStructureCompletionId = SteelStructureCompletionId; | |||
|  |                 BLL.SteelStructureCompletionService.UpdateSteelStructureCompletion(SteelStructureCompletion); | |||
|  |             } | |||
|  |             else | |||
|  |             { | |||
|  |                 SteelStructureCompletion.SteelStructureCompletionId = SQLHelper.GetNewID(typeof(Model.JDGL_SteelStructureCompletion)); | |||
|  |                 BLL.SteelStructureCompletionService.AddSteelStructureCompletion(SteelStructureCompletion); | |||
|  |             } | |||
|  |             ShowNotify("保存成功!", MessageBoxIcon.Success); | |||
|  |             PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); | |||
|  |         } | |||
|  |     } | |||
|  | } |