65 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			65 lines
		
	
	
		
			2.4 KiB
		
	
	
	
		
			C#
		
	
	
	
|  | using BLL; | |||
|  | using System; | |||
|  | 
 | |||
|  | namespace FineUIPro.Web.BaseInfo | |||
|  | { | |||
|  |     public partial class RectificationMeasureEdit : 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["id"]; | |||
|  |                 if (!string.IsNullOrEmpty(id)) | |||
|  |                 { | |||
|  |                     Model.JDGL_Base_RectificationMeasure data = BLL.RectificationMeasureService.GetRectificationMeasureByRectificationMeasureId(id); | |||
|  |                     if (data != null) | |||
|  |                     { | |||
|  |                         this.txtRectificationMeasureName.Text = data.RectificationMeasureName; | |||
|  |                         if (!string.IsNullOrEmpty(data.RectificationMeasureType)) | |||
|  |                         { | |||
|  |                             this.drpRectificationMeasureType.SelectedValue = data.RectificationMeasureType; | |||
|  |                         } | |||
|  |                         this.txtRemark.Text = data.Remark; | |||
|  |                     } | |||
|  |                 } | |||
|  |             } | |||
|  |         } | |||
|  |         #endregion | |||
|  | 
 | |||
|  |         #region 保存 | |||
|  |         /// <summary> | |||
|  |         /// 保存按钮 | |||
|  |         /// </summary> | |||
|  |         /// <param name="sender"></param> | |||
|  |         /// <param name="e"></param> | |||
|  |         protected void btnSave_Click(object sender, EventArgs e) | |||
|  |         { | |||
|  |             string id = Request.Params["id"]; | |||
|  |             Model.JDGL_Base_RectificationMeasure newData = new Model.JDGL_Base_RectificationMeasure(); | |||
|  |             newData.RectificationMeasureName = this.txtRectificationMeasureName.Text.Trim(); | |||
|  |             newData.RectificationMeasureType = this.drpRectificationMeasureType.SelectedValue; | |||
|  |             newData.Remark = this.txtRemark.Text.Trim(); | |||
|  | 
 | |||
|  |             if (!string.IsNullOrEmpty(id)) | |||
|  |             { | |||
|  |                 newData.RectificationMeasureId = id; | |||
|  |                 BLL.RectificationMeasureService.UpdateRectificationMeasure(newData); | |||
|  |             } | |||
|  |             else | |||
|  |             { | |||
|  |                 newData.RectificationMeasureId = SQLHelper.GetNewID(typeof(Model.JDGL_Base_RectificationMeasure)); | |||
|  |                 BLL.RectificationMeasureService.AddRectificationMeasure(newData); | |||
|  |             } | |||
|  |             ShowNotify("保存成功!", MessageBoxIcon.Success); | |||
|  |             PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); | |||
|  |         } | |||
|  |         #endregion | |||
|  |     } | |||
|  | } |