123 lines
4.9 KiB
C#
123 lines
4.9 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.JGZL
|
|
{
|
|
public partial class QualityControlPointInspectionEdit : PageBase
|
|
{
|
|
#region 定义项
|
|
/// <summary>
|
|
/// 主键
|
|
/// </summary>
|
|
private string QualityControlPointInspectionId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["QualityControlPointInspectionId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["QualityControlPointInspectionId"] = 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.QualityControlPointInspectionId = Request.Params["qualityControlPointInspectionId"];
|
|
if (!string.IsNullOrEmpty(this.QualityControlPointInspectionId))
|
|
{
|
|
var report = BLL.QualityControlPointInspectionService.GetQualityControlPointInspectionById(this.QualityControlPointInspectionId);
|
|
if (report != null)
|
|
{
|
|
this.txtProfessional.Text = report.Professional;
|
|
this.txtConstructionStandards.Text = report.ConstructionStandards;
|
|
this.txtControlPointName.Text = report.ControlPointName;
|
|
this.txtConTeamGroup.Text = report.ConTeamGroup;
|
|
this.txtCheckContents.Text = report.CheckContents;
|
|
this.txtProblems.Text = report.Problems;
|
|
this.txtConclusion.Text = report.Conclusion;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
this.txtProfessional.Text = "管道安装工程";
|
|
this.txtConstructionStandards.Text = "SH/T 3501/2011《石油化工有毒、可燃介质钢制管道工程施工及验收规范》";
|
|
}
|
|
}
|
|
}
|
|
#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_QualityControlPointInspectionMenuId, Const.BtnSave))
|
|
{
|
|
Model.JGZL_QualityControlPointInspection newReport = new Model.JGZL_QualityControlPointInspection();
|
|
newReport.Professional = this.txtProfessional.Text.Trim();
|
|
newReport.ConstructionStandards = this.txtConstructionStandards.Text.Trim();
|
|
newReport.ControlPointName = this.txtControlPointName.Text.Trim();
|
|
newReport.ConTeamGroup = this.txtConTeamGroup.Text.Trim();
|
|
newReport.CheckContents = this.txtCheckContents.Text;
|
|
newReport.Problems = txtProblems.Text;
|
|
newReport.Conclusion = this.txtConclusion.Text;
|
|
if (!string.IsNullOrEmpty(this.QualityControlPointInspectionId))
|
|
{
|
|
newReport.QualityControlPointInspectionId = this.QualityControlPointInspectionId;
|
|
BLL.QualityControlPointInspectionService.UpdateQualityControlPointInspection(newReport);
|
|
}
|
|
else
|
|
{
|
|
newReport.ProjectId = this.ProjectId;
|
|
newReport.CompileMan = this.CurrUser.UserId;
|
|
newReport.CompileDate = DateTime.Now;
|
|
newReport.QualityControlPointInspectionId = SQLHelper.GetNewID(typeof(Model.JGZL_QualityControlPointInspection));
|
|
this.QualityControlPointInspectionId = newReport.QualityControlPointInspectionId;
|
|
BLL.QualityControlPointInspectionService.AddQualityControlPointInspection(newReport);
|
|
}
|
|
ShowNotify("保存成功!", MessageBoxIcon.Success);
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
|
}
|
|
else
|
|
{
|
|
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
} |