Files
HJGL_DS/HJGL_DS/FineUIPro.Web/JGZL/PipeFittingInspectionRecordEdit.aspx.cs
T
xiaju e78630ea13 交工资料
39、管件宏观检查验收记录表
40、工序交接记录
41、管道预制施工检查记录
2026-01-26 19:34:13 +08:00

132 lines
5.5 KiB
C#

using BLL;
using System;
namespace FineUIPro.Web.JGZL
{
public partial class PipeFittingInspectionRecordEdit : 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.PipeFittingInspectionRecordService.GetPipeFittingInspectionRecordById(this.RecordId);
if (report != null)
{
this.txtContractNo.Text = report.ContractNo;
this.txtName.Text = report.Name;
this.txtArrivalNum.Text = report.ArrivalNum.ToString();
this.txtArrivalUnit.Text = report.ArrivalUnit;
this.txtMaterialCertificateNumber.Text = report.MaterialCertificateNumber;
this.txtMaterial.Text = report.Material;
this.txtSpecifications.Text = report.Specifications;
this.txtInspectionNum.Text = report.InspectionNum.ToString();
this.txtODVariation.Text = report.ODVariation;
this.txtIDVariation.Text = report.IDVariation;
this.txtWallVariation.Text = report.WallVariation;
this.txtOtherVariation.Text = report.OtherVariation;
this.txtAppearanceQuality.Text = report.AppearanceQuality;
this.txtResult.Text = report.Result;
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_PipeFittingInspectionRecordMenuId, Const.BtnSave))
{
Model.JGZL_PipeFittingInspectionRecord newReport = new Model.JGZL_PipeFittingInspectionRecord();
newReport.ContractNo = this.txtContractNo.Text.Trim();
newReport.Name = this.txtName.Text.Trim();
newReport.ArrivalNum = Funs.GetNewIntOrZero(this.txtArrivalNum.Text.Trim());
newReport.ArrivalUnit = this.txtArrivalUnit.Text.Trim();
newReport.MaterialCertificateNumber = this.txtMaterialCertificateNumber.Text.Trim();
newReport.Material = this.txtMaterial.Text.Trim();
newReport.Specifications = this.txtSpecifications.Text.Trim();
newReport.InspectionNum = Funs.GetNewIntOrZero(this.txtInspectionNum.Text.Trim());
newReport.ODVariation = this.txtODVariation.Text.Trim();
newReport.IDVariation = this.txtIDVariation.Text.Trim();
newReport.WallVariation = this.txtWallVariation.Text.Trim();
newReport.OtherVariation = this.txtOtherVariation.Text.Trim();
newReport.AppearanceQuality = this.txtAppearanceQuality.Text.Trim();
newReport.Result = this.txtResult.Text.Trim();
newReport.Remark = this.txtRemark.Text.Trim();
if (!string.IsNullOrEmpty(this.RecordId))
{
newReport.RecordId = this.RecordId;
BLL.PipeFittingInspectionRecordService.UpdatePipeFittingInspectionRecord(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_PipeFittingInspectionRecord));
this.RecordId = newReport.RecordId;
BLL.PipeFittingInspectionRecordService.AddPipeFittingInspectionRecord(newReport);
}
ShowNotify("保存成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
return;
}
}
#endregion
}
}