f70b4eb2cd
15、阀门试验确认表 16、阀门检验试验记录
132 lines
5.6 KiB
C#
132 lines
5.6 KiB
C#
using BLL;
|
|
using System;
|
|
|
|
namespace FineUIPro.Web.JGZL
|
|
{
|
|
public partial class ValveInspectionTestRecordEdit : PageBase
|
|
{
|
|
#region 定义项
|
|
/// <summary>
|
|
/// 主键
|
|
/// </summary>
|
|
private string RecordId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["RecordId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["RecordId"] = value;
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 项目Id
|
|
/// </summary>
|
|
private string ProjectId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["ProjectId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["ProjectId"] = value;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 加载页面
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
this.ProjectId = Request.Params["projectId"];
|
|
this.RecordId = Request.Params["recordId"];
|
|
if (!string.IsNullOrEmpty(this.RecordId))
|
|
{
|
|
var report = BLL.ValveInspectionTestRecordService.GetValveInspectionTestRecordById(this.RecordId);
|
|
if (report != null)
|
|
{
|
|
this.txtCode.Text = report.Code;
|
|
this.txtName.Text = report.Name;
|
|
this.txtSpecificationModel.Text = report.SpecificationModel;
|
|
this.txtNominalPressure.Text = report.NominalPressure;
|
|
this.txtPressuretTestMedium.Text = report.PressuretTestMedium;
|
|
this.txtPressuretTestPressure.Text = report.PressuretTestPressure;
|
|
this.txtPressureTestTime.Text = report.PressureTestTime;
|
|
this.txtSealTestMedium.Text = report.SealTestMedium;
|
|
this.txtSealTestPressure.Text = report.SealTestPressure;
|
|
this.txtSealTestTime.Text = report.SealTestTime;
|
|
this.txtUpperSealTestMedium.Text = report.UpperSealTestMedium;
|
|
this.txtUpperSealTestPressure.Text = report.UpperSealTestPressure;
|
|
this.txtUpperSealTestTime.Text = report.UpperSealTestTime;
|
|
this.txtInspectionResults.Text = report.InspectionResults;
|
|
this.txtRemark.Text = report.Remark;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 提交按钮
|
|
/// <summary>
|
|
/// 提交按钮
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnSave_Click(object sender, EventArgs e)
|
|
{
|
|
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ValveInspectionTestRecordMenuId, Const.BtnSave))
|
|
{
|
|
Model.JGZL_ValveInspectionTestRecord newReport = new Model.JGZL_ValveInspectionTestRecord();
|
|
newReport.Code = this.txtCode.Text.Trim();
|
|
newReport.Name = this.txtName.Text.Trim();
|
|
newReport.SpecificationModel = this.txtSpecificationModel.Text.Trim();
|
|
newReport.NominalPressure = this.txtNominalPressure.Text.Trim();
|
|
newReport.PressuretTestMedium = this.txtPressuretTestMedium.Text.Trim();
|
|
newReport.PressuretTestPressure = this.txtPressuretTestPressure.Text.Trim();
|
|
newReport.PressureTestTime = this.txtPressureTestTime.Text.Trim();
|
|
newReport.SealTestMedium = this.txtSealTestMedium.Text.Trim();
|
|
newReport.SealTestPressure = this.txtSealTestPressure.Text.Trim();
|
|
newReport.SealTestTime = this.txtSealTestTime.Text.Trim();
|
|
newReport.UpperSealTestMedium = this.txtUpperSealTestMedium.Text.Trim();
|
|
newReport.UpperSealTestPressure = this.txtUpperSealTestPressure.Text.Trim();
|
|
newReport.UpperSealTestTime = this.txtUpperSealTestTime.Text.Trim();
|
|
newReport.InspectionResults = this.txtInspectionResults.Text.Trim();
|
|
newReport.Remark = this.txtRemark.Text.Trim();
|
|
|
|
if (!string.IsNullOrEmpty(this.RecordId))
|
|
{
|
|
newReport.RecordId = this.RecordId;
|
|
BLL.ValveInspectionTestRecordService.UpdateValveInspectionTestRecord(newReport);
|
|
}
|
|
else
|
|
{
|
|
newReport.ProjectId = this.ProjectId;
|
|
newReport.CompileMan = this.CurrUser.UserId;
|
|
newReport.CompileDate = DateTime.Now;
|
|
newReport.Reviewer = this.CurrUser.UserId;
|
|
newReport.RevieweDate = DateTime.Now;
|
|
newReport.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_ValveInspectionTestRecord));
|
|
this.RecordId = newReport.RecordId;
|
|
BLL.ValveInspectionTestRecordService.AddValveInspectionTestRecord(newReport);
|
|
}
|
|
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
}
|
|
else
|
|
{
|
|
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
} |