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.BaseInfo { public partial class HotProcessTechEdit : PageBase { #region 定义项 /// /// 主键 /// public string Id { get { return (string)ViewState["Id"]; } set { ViewState["Id"] = value; } } #endregion #region 加载 /// /// 加载页面 /// /// /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { btnClose.OnClientClick = ActiveWindow.GetHideReference(); this.Id = Request.Params["Id"]; if (!string.IsNullOrEmpty(this.Id)) { Model.Base_HotProcessTech hotProcessTech = Funs.DB.Base_HotProcessTech.FirstOrDefault(x=>x.Id == this.Id); if (hotProcessTech != null) { if ( hotProcessTech.JOT_DiaMin.HasValue) { this.ndJOTDiaMin.Text = hotProcessTech.JOT_DiaMin.Value.ToString("#.##"); } if (hotProcessTech.JOT_DiaMax.HasValue) { this.ndJOTDiaMax.Text = hotProcessTech.JOT_DiaMax.Value.ToString("#.##"); } if (hotProcessTech.PointNum.HasValue) { this.ndPointNum.Text = hotProcessTech.PointNum.Value.ToString("#.##"); } if (!string.IsNullOrEmpty(hotProcessTech.PointCount)) { this.txtPointCount.Text = hotProcessTech.PointCount; } if (!string.IsNullOrEmpty(hotProcessTech.RequiredT)) { this.txtRequiredT.Text = hotProcessTech.RequiredT; } if (!string.IsNullOrEmpty(hotProcessTech.ActualT)) { this.txtActualT.Text = hotProcessTech.ActualT; } if (!string.IsNullOrEmpty(hotProcessTech.ActualTime)) { this.txtActualTime.Text = hotProcessTech.ActualTime; } if (!string.IsNullOrEmpty(hotProcessTech.RequiredTime)) { this.txtRequiredTime.Text = hotProcessTech.RequiredTime; } if (!string.IsNullOrEmpty(hotProcessTech.TimeMin)) { this.txtTimeMin.Text = hotProcessTech.TimeMin; } if (!string.IsNullOrEmpty(hotProcessTech.Material)) { this.txtMaterial.Text = hotProcessTech.Material; } if (!string.IsNullOrEmpty(hotProcessTech.HotHard)) { this.txtHotHard.Text = hotProcessTech.HotHard; } if (!string.IsNullOrEmpty(hotProcessTech.JointDesc)) { this.txtJointDesc.Text = hotProcessTech.JointDesc; } } } } } #endregion #region 保存 /// /// 保存按钮 /// /// /// protected void btnSave_Click(object sender, EventArgs e) { Model.Base_HotProcessTech hotProcessTech = new Model.Base_HotProcessTech(); hotProcessTech.ProjectId = CurrUser.LoginProjectId; hotProcessTech.PointCount = this.txtPointCount.Text; hotProcessTech.RequiredT = this.txtRequiredT.Text; hotProcessTech.ActualT = this.txtActualT.Text; hotProcessTech.ActualTime = this.txtActualTime.Text; hotProcessTech.RequiredTime = this.txtRequiredTime.Text; hotProcessTech.TimeMin = this.txtTimeMin.Text; hotProcessTech.Material = this.txtMaterial.Text; hotProcessTech.HotHard = this.txtHotHard.Text; hotProcessTech.JointDesc = this.txtJointDesc.Text; hotProcessTech.CreateMan = CurrUser.UserId; hotProcessTech.CreateDate = DateTime.Now; if (!string.IsNullOrEmpty(this.ndJOTDiaMin.Text)) { hotProcessTech.JOT_DiaMin = decimal.Parse(this.ndJOTDiaMin.Text); } if (!string.IsNullOrEmpty(this.ndJOTDiaMax.Text)) { hotProcessTech.JOT_DiaMax = decimal.Parse(this.ndJOTDiaMax.Text); } if (!string.IsNullOrEmpty(this.ndPointNum.Text)) { hotProcessTech.PointNum = int.Parse(this.ndPointNum.Text); } if (!string.IsNullOrEmpty(this.Id)) { hotProcessTech.Id = this.Id; BLL.Base_HotProcessTechService.UpdateHotProcessTech(hotProcessTech); //BLL.Sys_LogService.AddLog(Const.System_6, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_MediumMenuId, Const.BtnDelete, this.MediumId); } else { this.Id = SQLHelper.GetNewID(typeof(Model.Base_VCS)); hotProcessTech.Id = this.Id; BLL.Base_HotProcessTechService.AddHotProcessTech(hotProcessTech); //BLL.Sys_LogService.AddLog(Const.System_6, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_MediumMenuId, Const.BtnDelete, this.MediumId); } ShowNotify("保存成功!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } #endregion } }