171 lines
7.4 KiB
C#
171 lines
7.4 KiB
C#
namespace FineUIPro.Web.HJGL.WeldingManage
|
|
{
|
|
using System;
|
|
using System.IO;
|
|
using System.Web.UI;
|
|
using BLL;
|
|
|
|
public partial class WeldingProcedureEdit : PageBase
|
|
{
|
|
#region 定义项
|
|
/// <summary>
|
|
/// 焊接工艺评定id
|
|
/// </summary>
|
|
public string WeldingProcedureId
|
|
{
|
|
get
|
|
{
|
|
return (string)ViewState["WeldingProcedureId"];
|
|
}
|
|
set
|
|
{
|
|
ViewState["WeldingProcedureId"] = value;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 加载页面
|
|
/// <summary>
|
|
/// 加载页面
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
this.WeldingProcedureId = Request.Params["weldingProcedureId"];
|
|
///材质
|
|
this.drpSte_Name.DataTextField = "STE_Name";
|
|
this.drpSte_Name.DataValueField = "STE_ID";
|
|
this.drpSte_Name.DataSource = BLL.HJGL_MaterialService.GetSteelList();
|
|
this.drpSte_Name.DataBind();
|
|
Funs.FineUIPleaseSelect(this.drpSte_Name);
|
|
////初始化页面
|
|
this.PageLoad();
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 初始化页面信息
|
|
/// <summary>
|
|
/// 初始化页面信息
|
|
/// </summary>
|
|
protected void PageLoad()
|
|
{
|
|
Model.HJGL_PW_WeldingProcedure weldingProcedure = BLL.HJGL_WeldingProcedureService.GetWeldingProcedureByWeldingProcedureId(this.WeldingProcedureId);
|
|
if (weldingProcedure != null)
|
|
{
|
|
this.txtWeldingProcedureCode.Text = weldingProcedure.WeldingProcedureCode;
|
|
this.txtWtype.Text = weldingProcedure.WType;
|
|
|
|
var steel = BLL.HJGL_MaterialService.GetSteelBySteID(weldingProcedure.STE_ID);
|
|
if (steel != null)
|
|
{
|
|
this.drpSte_Name.SelectedValue = weldingProcedure.STE_ID;
|
|
this.txtMaterialType.Text = weldingProcedure.MaterialType;
|
|
this.txtMaterialGroup.Text = weldingProcedure.MaterialGroup;
|
|
}
|
|
this.txtSpecification.Text = weldingProcedure.Specification;
|
|
this.txtWelding.Text = weldingProcedure.Welding;
|
|
this.txtWRange.Text = weldingProcedure.WRange;
|
|
this.txtRemark.Text = weldingProcedure.Remark;
|
|
this.txtJointsForm.Text = weldingProcedure.JointsForm;
|
|
this.txtTubeDiameter.Text = weldingProcedure.TubeDiameter;
|
|
this.txtSpecimenThickness.Text = Convert.ToString(weldingProcedure.SpecimenThickness);
|
|
this.txtWeldMethod.Text = weldingProcedure.WeldMethod;
|
|
this.txtWeldPositionCode.Text = weldingProcedure.WeldPositionCode;
|
|
this.txtWeldPreheating.Text = weldingProcedure.WeldPreheating;
|
|
this.txtPWHT.Text = weldingProcedure.PWHT;
|
|
}
|
|
}
|
|
#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.HJGL_WeldingProcedureSearchMenuId, Const.BtnSave))
|
|
{
|
|
if (string.IsNullOrEmpty(this.txtWeldingProcedureCode.Text.Trim()))
|
|
{
|
|
Alert.ShowInTop("工艺评定编号不能为空!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
if (BLL.HJGL_WeldingProcedureService.GetIsExitWeldingProcedureCode(this.txtWeldingProcedureCode.Text.Trim(),this.WeldingProcedureId) != null)
|
|
{
|
|
Alert.ShowInTop("工艺评定编号已存在!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
|
|
Model.HJGL_PW_WeldingProcedure weldingProcedure = new Model.HJGL_PW_WeldingProcedure();
|
|
weldingProcedure.WeldingProcedureCode = this.txtWeldingProcedureCode.Text.Trim();
|
|
weldingProcedure.WType = this.txtWtype.Text.Trim();
|
|
if (this.drpSte_Name.SelectedValue != BLL.Const._Null)
|
|
{
|
|
weldingProcedure.STE_ID = this.drpSte_Name.SelectedValue;
|
|
}
|
|
weldingProcedure.Specification = this.txtSpecification.Text.Trim();
|
|
weldingProcedure.Welding = this.txtWelding.Text.Trim();
|
|
weldingProcedure.WRange = this.txtWRange.Text.Trim();
|
|
weldingProcedure.Remark = this.txtRemark.Text.Trim();
|
|
weldingProcedure.MaterialGroup = this.txtMaterialGroup.Text.Trim();
|
|
weldingProcedure.JointsForm = this.txtJointsForm.Text.Trim();
|
|
weldingProcedure.TubeDiameter = this.txtTubeDiameter.Text.Trim();
|
|
weldingProcedure.SpecimenThickness = Funs.GetNewDecimal(this.txtSpecimenThickness.Text.Trim());
|
|
weldingProcedure.WeldMethod = this.txtWeldMethod.Text.Trim();
|
|
weldingProcedure.WeldPositionCode = this.txtWeldPositionCode.Text.Trim();
|
|
weldingProcedure.WeldPreheating = this.txtWeldPreheating.Text.Trim();
|
|
weldingProcedure.PWHT = this.txtPWHT.Text.Trim();
|
|
|
|
if (string.IsNullOrEmpty(this.WeldingProcedureId))
|
|
{
|
|
weldingProcedure.IsAdd = true;
|
|
BLL.HJGL_WeldingProcedureService.AddWeldProcedure(weldingProcedure);
|
|
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "添加图片信息");
|
|
}
|
|
else
|
|
{
|
|
weldingProcedure.WeldingProcedureId = this.WeldingProcedureId;
|
|
BLL.HJGL_WeldingProcedureService.UpdateWeldProcedure(weldingProcedure);
|
|
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "修改图片信息!");
|
|
}
|
|
|
|
Alert.ShowInTop("提交成功!", MessageBoxIcon.Success);
|
|
PageContext.RegisterStartupScript(ActiveWindow.GetHideRefreshReference());
|
|
}
|
|
else
|
|
{
|
|
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
}
|
|
#endregion
|
|
|
|
#region 材质联动事件
|
|
/// <summary>
|
|
/// 材质联动事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void drpSte_Name_TextChanged(object sender, EventArgs e)
|
|
{
|
|
var steel = BLL.HJGL_MaterialService.GetSteelBySteID(this.drpSte_Name.SelectedValue);
|
|
if (steel != null)
|
|
{
|
|
this.txtMaterialType.Text = steel.MaterialType;
|
|
this.txtMaterialGroup.Text = steel.MaterialGroup;
|
|
}
|
|
else
|
|
{
|
|
this.txtMaterialType.Text = string.Empty;
|
|
this.txtMaterialGroup.Text = string.Empty;
|
|
}
|
|
}
|
|
#endregion
|
|
}
|
|
} |