ChengDa_English/SGGL/FineUIPro.Web/HJGL/WeldingManage/JointInfoBatchEdit.aspx.cs

182 lines
8.2 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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.WeldingManage
{
public partial class JointInfoBatchEdit : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.btnClose.OnClientClick = ActiveWindow.GetHideReference();
#region
BLL.Base_MaterialService.InitMaterialDropDownList(this.ddlSTE1, true, this.CurrUser.LoginProjectId);//材质1
BLL.Base_MaterialService.InitMaterialDropDownList(this.ddlSTE2, true, this.CurrUser.LoginProjectId);//材质2
BLL.Base_WeldTypeService.InitWeldTypeDropDownList(this.ddlJOTY_ID, true);//焊缝类型
BLL.Base_WeldingMethodService.InitWeldingMethodDropDownList(this.ddlWME_ID, true);//焊接方法
BLL.Base_ConsumablesService.InitConsumablesDropDownList(this.ddlWeldSilk, true, "1");//焊丝
BLL.Base_ConsumablesService.InitConsumablesDropDownList(this.ddlWeldMat, true, "2");//焊条
#endregion
string ISO_ID = Request.Params["ISO_ID"];
if (!string.IsNullOrEmpty(ISO_ID))
{
var isoInfo = BLL.PW_IsoInfoService.GetIsoInfoByIsoInfoId(ISO_ID);
if (isoInfo != null)
{
if (!string.IsNullOrEmpty(isoInfo.WorkAreaId))
{
var workArea = BLL.WorkAreaService.getWorkAreaByWorkAreaId(isoInfo.WorkAreaId);
if (workArea != null)
{
this.txtWorkAreaId.Text = workArea.WorkAreaCode;
}
}
if (isoInfo.Is_Standard)
{
BLL.Base_DetectionRateService.InitDetectionRateDropDownList(this.drpNDTRate, true);//探伤比例
BLL.Base_DetectionTypeService.InitDetectionTypeDropDownList(this.drpNDTName, true);//探伤类型
}
else
{
this.drpNDTRate.Hidden = true;
this.drpNDTName.Hidden = true;
this.txtWallBoard.Hidden = true;
}
}
}
}
}
#endregion
#region
/// <summary>
/// 保存按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSave_Click(object sender, EventArgs e)
{
if (this.ddlSTE1.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.ddlSTE1.SelectedValue))
{
Alert.ShowInTop("请选择材质1!", MessageBoxIcon.Warning);
return;
}
if (this.ddlJOTY_ID.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.ddlJOTY_ID.SelectedValue))
{
Alert.ShowInTop("请选择焊缝类型!", MessageBoxIcon.Warning);
return;
}
if (this.ddlWME_ID.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.ddlWME_ID.SelectedValue))
{
Alert.ShowInTop("请选择焊接方法!", MessageBoxIcon.Warning);
return;
}
if (!this.drpNDTRate.Hidden&& (this.drpNDTRate.SelectedValue == BLL.Const._Null || string.IsNullOrEmpty(this.drpNDTRate.SelectedValue)))
{
Alert.ShowInTop("请选择探伤比例!", MessageBoxIcon.Warning);
return;
}
Model.PW_JointInfo jointInfo = new Model.PW_JointInfo();
jointInfo.ProjectId = this.CurrUser.LoginProjectId;
jointInfo.WallBoard = this.txtWallBoard.Text.Trim();
if (!string.IsNullOrEmpty(Request.Params["ISO_ID"]))
{
jointInfo.ISO_ID = Request.Params["ISO_ID"];
}
jointInfo.WLO_Code = this.ddlWLO_CODE.SelectedValue;
if (this.ddlSTE1.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.ddlSTE1.SelectedValue))
{
jointInfo.MaterialId = this.ddlSTE1.SelectedValue;
}
if (this.ddlSTE2.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.ddlSTE2.SelectedValue))
{
jointInfo.MaterialId2 = this.ddlSTE2.SelectedValue;
}
jointInfo.JOT_JointDesc = this.txtJointDesc.Text.Trim();
if (this.ddlJOTY_ID.SelectedValue != BLL.Const._Null && string.IsNullOrEmpty(this.ddlJOTY_ID.SelectedValue))
{
jointInfo.JOTY_ID = this.ddlJOTY_ID.SelectedValue;
}
if (!string.IsNullOrEmpty(this.txtSize.Text.Trim()))
{
jointInfo.JOT_Size = Convert.ToDecimal(this.txtSize.Text.Trim());
}
if (!string.IsNullOrEmpty(this.txtDia.Text.Trim()))
{
jointInfo.JOT_Dia = Convert.ToDecimal(this.txtDia.Text.Trim());
}
jointInfo.JOT_JointAttribute = this.ddlJointAttribute.SelectedValue;
jointInfo.JOT_Sch = this.txtSch.Text.Trim();
jointInfo.JOT_TrustFlag = "00";
jointInfo.JOT_CheckFlag = "00";
jointInfo.JOT_JointStatus = "100";
if (this.ddlWeldMat.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.ddlWeldMat.SelectedValue))
{
jointInfo.JOT_WeldMat = this.ddlWeldMat.SelectedValue;
}
if (this.ddlWeldSilk.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.ddlWeldSilk.SelectedValue))
{
jointInfo.JOT_WeldSilk = this.ddlWeldSilk.SelectedValue;
}
if (ddlWME_ID.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.ddlWME_ID.SelectedValue))
{
jointInfo.WME_ID = this.ddlWME_ID.SelectedValue;
}
jointInfo.IS_Proess = this.drpIS_Proess.SelectedValue;
if (this.drpNDTName.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpNDTName.SelectedValue))
{
jointInfo.DetectionTypeId = this.drpNDTName.SelectedValue;
}
if (this.drpNDTRate.SelectedValue != BLL.Const._Null && !string.IsNullOrEmpty(this.drpNDTRate.SelectedValue))
{
jointInfo.DetectionRateId = this.drpNDTRate.SelectedValue;
}
int jointNo1 = Convert.ToInt32(this.txtJointNo1.Text.Trim());
int jointNo2 = Convert.ToInt32(this.txtJointNo2.Text.Trim());
if (jointNo1 > jointNo2)
{
Alert.ShowInTop("焊口号1必须小于焊口2", MessageBoxIcon.Warning);
return;
}
else
{
for (int i = jointNo1; i <= jointNo2; i++)
{
if (i < 10)
{
jointInfo.JOT_JointNo = this.txtJointNo.Text.Trim() + "0" + Convert.ToString(i);
}
else
{
jointInfo.JOT_JointNo = this.txtJointNo.Text.Trim() + Convert.ToString(i);
}
if (jointInfo.JOT_JointNo == BLL.PW_JointInfoService.GetJointInfoByJOTNO(Request.Params["ISO_ID"], jointInfo.JOT_JointNo))
{
Alert.ShowInTop(jointInfo.JOT_JointNo + "焊口号已经存在!", MessageBoxIcon.Warning);
return;
}
BLL.PW_JointInfoService.AddJointInfoFatch(jointInfo);
//BLL.LogService.AddLog(this.CurrUser.UserId, "添加焊口信息!");
}
}
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
}
}