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.DataIn { public partial class CheckManageStaticEdit : PageBase { #region 定义项 /// /// 临时表主键 /// public string CheckStaticId { get { return (string)ViewState["CheckStaticId"]; } set { ViewState["CheckStaticId"] = value; } } #endregion #region 加载页面 /// /// 加载页面 /// /// /// protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { this.CheckStaticId = Request.Params["CheckStaticId"]; var CheckStatic = Funs.DB.CH_CheckStatic.FirstOrDefault(x=>x.CheckStaticId==this.CheckStaticId); if (CheckStatic != null) { this.txtValue1.Text = CheckStatic.TrustUnitName; this.txtValue2.Text = CheckStatic.UnitName; this.txtValue3.Text = CheckStatic.InstallationName; this.txtValue4.Text = CheckStatic.WorkAreaCode; this.txtValue5.Text = CheckStatic.CH_TrustCode; this.txtValue6.Text = string.Format("{0:yyyy-MM-dd}", CheckStatic.Trust_Date); this.txtValue7.Text = CheckStatic.CheckThingName; this.txtValue8.Text = CheckStatic.DefectCode; this.txtValue9.Text = CheckStatic.CheckOpportunity; this.txtValue10.Text = CheckStatic.ISO_IsoNo; this.txtValue11.Text = CheckStatic.JOT_JointNo; this.txtValue12.Text = CheckStatic.WED_Code; this.txtValue13.Text = CheckStatic.JOT_JointDesc; this.txtValue14.Text = CheckStatic.MaterialCode; this.txtValue15.Text = CheckStatic.DetectionRateCode; this.txtValue16.Text = CheckStatic.WeldingMethodCode; this.txtValue17.Text = CheckStatic.WorkAmout1; this.txtValue18.Text = CheckStatic.WorkAmout2; this.txtValue19.Text = CheckStatic.CheckLevel; this.txtValue20.Text = string.Format("{0:yyyy-MM-dd}", CheckStatic.CheckDate); this.txtValue21.Text = CheckStatic.CheckTemperature; this.txtValue22.Text = CheckStatic.CheckPerson; this.txtValue23.Text = CheckStatic.DefectType; this.txtValue24.Text = CheckStatic.DefectNum; this.txtValue25.Text = CheckStatic.CheckResult; this.txtValue26.Text = CheckStatic.CheckResultNum; this.txtValue27.Text = string.Format("{0:yyyy-MM-dd}", CheckStatic.CheckResultDate); this.txtValue28.Text = CheckStatic.ReportNo; this.txtValue29.Text = string.Format("{0:yyyy-MM-dd}", CheckStatic.ReportDate); this.txtValue30.Text = CheckStatic.ReportAmount; this.txtValue31.Text = CheckStatic.ProgressMoney; this.txtValue32.Text = CheckStatic.DetectionTypeCode; this.txtValue33.Text = CheckStatic.Remark; } } } #endregion #region 保存按钮 /// /// 保存按钮 /// /// /// protected void btnSave_Click(object sender, EventArgs e) { var CheckStatic = Funs.DB.CH_CheckStatic.FirstOrDefault(x => x.CheckStaticId == this.CheckStaticId); CheckStatic.ProjectId = this.CurrUser.ProjectId; CheckStatic.TrustUnitName = this.txtValue1.Text; CheckStatic.UnitName = this.txtValue2.Text; CheckStatic.InstallationName = this.txtValue3.Text; CheckStatic.WorkAreaCode = this.txtValue4.Text; CheckStatic.CH_TrustCode = this.txtValue5.Text; if (!string.IsNullOrEmpty(this.txtValue6.Text)) CheckStatic.Trust_Date = DateUtil.ToDateTime(this.txtValue6.Text); CheckStatic.CheckThingName = this.txtValue7.Text; CheckStatic.DefectCode = this.txtValue8.Text; CheckStatic.CheckOpportunity = this.txtValue9.Text; CheckStatic.ISO_IsoNo = this.txtValue10.Text; CheckStatic.JOT_JointNo = this.txtValue11.Text; CheckStatic.WED_Code = this.txtValue12.Text; CheckStatic.JOT_JointDesc = this.txtValue13.Text; CheckStatic.MaterialCode = this.txtValue14.Text; CheckStatic.DetectionRateCode = this.txtValue15.Text; CheckStatic.WeldingMethodCode = this.txtValue16.Text; CheckStatic.WorkAmout1 = this.txtValue17.Text; CheckStatic.WorkAmout2 = this.txtValue18.Text; CheckStatic.CheckLevel = this.txtValue19.Text; if (!string.IsNullOrEmpty(this.txtValue20.Text)) CheckStatic.CheckDate = DateUtil.ToDateTime(this.txtValue20.Text); CheckStatic.CheckTemperature = this.txtValue21.Text; CheckStatic.CheckPerson = this.txtValue22.Text; CheckStatic.DefectType = this.txtValue23.Text; CheckStatic.DefectNum = this.txtValue24.Text; CheckStatic.CheckResult = this.txtValue25.Text; CheckStatic.CheckResultNum = this.txtValue26.Text; if (!string.IsNullOrEmpty(this.txtValue27.Text)) CheckStatic.CheckResultDate = DateUtil.ToDateTime(this.txtValue27.Text); CheckStatic.ReportNo = this.txtValue28.Text; if (!string.IsNullOrEmpty(this.txtValue29.Text)) CheckStatic.ReportDate = DateUtil.ToDateTime(this.txtValue29.Text); CheckStatic.ReportAmount = this.txtValue30.Text; CheckStatic.ProgressMoney = this.txtValue31.Text; CheckStatic.DetectionTypeCode = this.txtValue32.Text; CheckStatic.Remark = this.txtValue33.Text; Funs.DB.SubmitChanges(); ShowNotify("信息修改完成!", MessageBoxIcon.Success); PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference()); } #endregion } }