83 lines
		
	
	
		
			4.0 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			83 lines
		
	
	
		
			4.0 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.HJGL.PersonManage
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    public partial class PersonQualifiedProjectEdit : PageBase
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        #region 加载
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 加载页面
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e"></param>
							 | 
						|||
| 
								 | 
							
								        protected void Page_Load(object sender, EventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            if (!IsPostBack)
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
							 | 
						|||
| 
								 | 
							
								                string welderQualifiedProjectId = Request.Params["welderQualifiedProjectId"];
							 | 
						|||
| 
								 | 
							
								                string welderId = Request.Params["welderId"];
							 | 
						|||
| 
								 | 
							
								                if (!string.IsNullOrEmpty(welderId))
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    var welder = BLL.WelderService.GetWelderById(welderId);
							 | 
						|||
| 
								 | 
							
								                    if (welder != null)
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        this.txtWED_Code.Text = welder.WED_Code;
							 | 
						|||
| 
								 | 
							
								                        this.txtWED_Name.Text = welder.WED_Name;
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								                if (!string.IsNullOrEmpty(welderQualifiedProjectId))
							 | 
						|||
| 
								 | 
							
								                {
							 | 
						|||
| 
								 | 
							
								                    Model.BS_WelderQualifiedProject welderQualifiedProject = BLL.WelderQualifiedProjectService.GetWelderQualifiedProjectById(welderQualifiedProjectId);
							 | 
						|||
| 
								 | 
							
								                    if (welderQualifiedProject != null)
							 | 
						|||
| 
								 | 
							
								                    {
							 | 
						|||
| 
								 | 
							
								                        this.txtQualifiedProjectCode.Text = welderQualifiedProject.QualifiedProjectCode;
							 | 
						|||
| 
								 | 
							
								                        this.txtLimitDate.Text = welderQualifiedProject.LimitDate.HasValue ? string.Format("{0:yyyy-MM-dd}", welderQualifiedProject.LimitDate) : "";
							 | 
						|||
| 
								 | 
							
								                        this.txtGTAWMax.Text = welderQualifiedProject.GTAWMax.HasValue ? welderQualifiedProject.GTAWMax.ToString() : "";
							 | 
						|||
| 
								 | 
							
								                        this.txtSMAWMax.Text = welderQualifiedProject.SMAWMax.HasValue ? welderQualifiedProject.SMAWMax.ToString() : "";
							 | 
						|||
| 
								 | 
							
								                        this.txtDiaMin.Text = welderQualifiedProject.DiaMin.HasValue ? welderQualifiedProject.DiaMin.ToString() : "";
							 | 
						|||
| 
								 | 
							
								                    }
							 | 
						|||
| 
								 | 
							
								                }
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        #region 保存
							 | 
						|||
| 
								 | 
							
								        /// <summary>
							 | 
						|||
| 
								 | 
							
								        /// 保存按钮
							 | 
						|||
| 
								 | 
							
								        /// </summary>
							 | 
						|||
| 
								 | 
							
								        /// <param name="sender"></param>
							 | 
						|||
| 
								 | 
							
								        /// <param name="e"></param>
							 | 
						|||
| 
								 | 
							
								        protected void btnSave_Click(object sender, EventArgs e)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            string welderQualifiedProjectId = Request.Params["welderQualifiedProjectId"];
							 | 
						|||
| 
								 | 
							
								            string welderId = Request.Params["welderId"];
							 | 
						|||
| 
								 | 
							
								            Model.BS_WelderQualifiedProject newWelderQualifiedProject = new Model.BS_WelderQualifiedProject();
							 | 
						|||
| 
								 | 
							
								            newWelderQualifiedProject.WED_ID = welderId;
							 | 
						|||
| 
								 | 
							
								            newWelderQualifiedProject.QualifiedProjectCode = this.txtQualifiedProjectCode.Text.Trim();
							 | 
						|||
| 
								 | 
							
								            newWelderQualifiedProject.LimitDate = Funs.GetNewDateTime(this.txtLimitDate.Text.Trim());
							 | 
						|||
| 
								 | 
							
								            newWelderQualifiedProject.GTAWMax = Funs.GetNewDecimal(this.txtGTAWMax.Text.Trim());
							 | 
						|||
| 
								 | 
							
								            newWelderQualifiedProject.SMAWMax = Funs.GetNewDecimal(this.txtSMAWMax.Text.Trim());
							 | 
						|||
| 
								 | 
							
								            newWelderQualifiedProject.DiaMin = Funs.GetNewDecimal(this.txtDiaMin.Text.Trim());
							 | 
						|||
| 
								 | 
							
								            if (!string.IsNullOrEmpty(welderQualifiedProjectId))
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                newWelderQualifiedProject.WelderQualifiedProjectId = welderQualifiedProjectId;
							 | 
						|||
| 
								 | 
							
								                BLL.WelderQualifiedProjectService.UpdateWelderQualifiedProject(newWelderQualifiedProject);
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            else
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                newWelderQualifiedProject.WelderQualifiedProjectId = SQLHelper.GetNewID(typeof(Model.BS_WelderQualifiedProject));
							 | 
						|||
| 
								 | 
							
								                BLL.WelderQualifiedProjectService.AddWelderQualifiedProject(newWelderQualifiedProject);
							 | 
						|||
| 
								 | 
							
								            }
							 | 
						|||
| 
								 | 
							
								            ShowNotify("保存成功!", MessageBoxIcon.Success);
							 | 
						|||
| 
								 | 
							
								            PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        #endregion
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |