899 lines
43 KiB
C#
899 lines
43 KiB
C#
using BLL;
|
||
using FineUIPro.Web.HJGL.DataIn;
|
||
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 JointInfoBatchModity : PageBase
|
||
{
|
||
#region 定义项
|
||
/// <summary>
|
||
/// 管线主键
|
||
/// </summary>
|
||
private string ISO_ID
|
||
{
|
||
get
|
||
{
|
||
return (string)ViewState["ISO_ID"];
|
||
}
|
||
set
|
||
{
|
||
ViewState["ISO_ID"] = value;
|
||
}
|
||
}
|
||
#endregion
|
||
protected void Page_Load(object sender, EventArgs e)
|
||
{
|
||
if (!IsPostBack)
|
||
{
|
||
///初始化下拉框
|
||
this.LoadDropDownList();
|
||
///初始化显示信息
|
||
this.LoadShowInfo();
|
||
}
|
||
}
|
||
|
||
#region 加载下拉框
|
||
/// <summary>
|
||
/// 加载下拉框
|
||
/// </summary>
|
||
private void LoadDropDownList()
|
||
{
|
||
///材质1
|
||
this.ddlSTE1.DataTextField = "STE_Code";
|
||
this.ddlSTE1.DataValueField = "STE_ID";
|
||
this.ddlSTE1.DataSource = BLL.HJGL_MaterialService.GetSteelList();
|
||
this.ddlSTE1.DataBind();
|
||
Funs.FineUIPleaseSelect(this.ddlSTE1);
|
||
|
||
///材质2
|
||
this.ddlSTE2.DataTextField = "STE_Code";
|
||
this.ddlSTE2.DataValueField = "STE_ID";
|
||
this.ddlSTE2.DataSource = BLL.HJGL_MaterialService.GetSteelList();
|
||
this.ddlSTE2.DataBind();
|
||
Funs.FineUIPleaseSelect(this.ddlSTE2);
|
||
|
||
///焊缝类型
|
||
this.ddlJOTY_ID.DataTextField = "JOTY_Name";
|
||
this.ddlJOTY_ID.DataValueField = "JOTY_ID";
|
||
this.ddlJOTY_ID.DataSource = BLL.HJGL_WeldService.GetJointTypeNameList("2");
|
||
this.ddlJOTY_ID.DataBind();
|
||
Funs.FineUIPleaseSelect(this.ddlJOTY_ID);
|
||
|
||
///坡口类型
|
||
this.ddlJST_ID.DataTextField = "JST_Name";
|
||
this.ddlJST_ID.DataValueField = "JST_ID";
|
||
this.ddlJST_ID.DataSource = BLL.HJGL_GrooveService.GetSlopeTypeNameList();
|
||
this.ddlJST_ID.DataBind();
|
||
Funs.FineUIPleaseSelect(this.ddlJST_ID);
|
||
|
||
///焊口属性
|
||
this.ddlJointAttribute.DataTextField = "Text";
|
||
this.ddlJointAttribute.DataValueField = "Value";
|
||
this.ddlJointAttribute.DataSource = BLL.DropListService.HJGL_JointAttributeItem();
|
||
this.ddlJointAttribute.DataBind();
|
||
Funs.FineUIPleaseSelect(this.ddlJointAttribute);
|
||
|
||
///焊接方法
|
||
this.ddlWME_ID.DataTextField = "WME_Name";
|
||
this.ddlWME_ID.DataValueField = "WME_ID";
|
||
this.ddlWME_ID.DataSource = BLL.HJGL_WeldingMethodService.GetWeldMethodNameList();
|
||
this.ddlWME_ID.DataBind();
|
||
Funs.FineUIPleaseSelect(this.ddlWME_ID);
|
||
|
||
///焊接区域
|
||
this.ddlWLO_CODE.DataTextField = "Text";
|
||
this.ddlWLO_CODE.DataValueField = "Value";
|
||
this.ddlWLO_CODE.DataSource = BLL.DropListService.HJGL_WLO_CODEItem();
|
||
this.ddlWLO_CODE.DataBind();
|
||
Funs.FineUIPleaseSelect(this.ddlWLO_CODE);
|
||
|
||
///组件1号
|
||
this.ddlComponent1.DataTextField = "COM_Name";
|
||
this.ddlComponent1.DataValueField = "COM_ID";
|
||
this.ddlComponent1.DataSource = BLL.HJGL_ComponentsService.GetComponentNameList();
|
||
this.ddlComponent1.DataBind();
|
||
Funs.FineUIPleaseSelect(this.ddlComponent1);
|
||
|
||
///组件2号
|
||
this.ddlComponent2.DataTextField = "COM_Name";
|
||
this.ddlComponent2.DataValueField = "COM_ID";
|
||
this.ddlComponent2.DataSource = BLL.HJGL_ComponentsService.GetComponentNameList();
|
||
this.ddlComponent2.DataBind();
|
||
Funs.FineUIPleaseSelect(this.ddlComponent2);
|
||
|
||
///焊丝
|
||
this.ddlWeldSilk.DataTextField = "WeldName";
|
||
this.ddlWeldSilk.DataValueField = "WeldId";
|
||
this.ddlWeldSilk.DataSource = from x in Funs.DB.View_WeldInfoDropDownLists
|
||
where x.WeldTypeName.Contains("焊丝")
|
||
select x; // BLL.HJGL_ConsumablesService.GetMaterialList("1");
|
||
this.ddlWeldSilk.DataBind();
|
||
Funs.FineUIPleaseSelect(this.ddlWeldSilk);
|
||
|
||
///焊条
|
||
this.ddlWeldMat.DataTextField = "WeldName";
|
||
this.ddlWeldMat.DataValueField = "WeldId";
|
||
this.ddlWeldMat.DataSource = from x in Funs.DB.View_WeldInfoDropDownLists
|
||
where x.WeldTypeName.Contains("焊条")
|
||
select x; //BLL.HJGL_ConsumablesService.GetMaterialList("2");
|
||
this.ddlWeldMat.DataBind();
|
||
Funs.FineUIPleaseSelect(this.ddlWeldMat);
|
||
|
||
List<Model.HandleStep> myList = new List<Model.HandleStep>();
|
||
myList = BLL.HJGL_PW_JointInfoService.GetProessTypes();
|
||
RadioButtonList1.DataTextField = "Name";
|
||
RadioButtonList1.DataValueField = "Id";
|
||
RadioButtonList1.DataSource = myList;
|
||
RadioButtonList1.DataBind();
|
||
|
||
this.drpInstallationId.DataTextField = "Text";
|
||
this.drpInstallationId.DataValueField = "Value";
|
||
this.drpInstallationId.DataSource = BLL.Project_InstallationService.GetInstallationList(this.CurrUser.LoginProjectId);
|
||
this.drpInstallationId.DataBind();
|
||
Funs.FineUIPleaseSelect(this.drpInstallationId);
|
||
|
||
//探伤比例
|
||
this.drpNDTR_ID.DataTextField = "NDTR_Name";
|
||
this.drpNDTR_ID.DataValueField = "NDTR_ID";
|
||
this.drpNDTR_ID.DataSource = BLL.HJGL_DetectionService.GetNDTRateNameList();
|
||
this.drpNDTR_ID.DataBind();
|
||
Funs.FineUIPleaseSelect(this.drpNDTR_ID);
|
||
|
||
//合格等级
|
||
this.drpJOT_QualifiedLevel.DataTextField = "Text";
|
||
this.drpJOT_QualifiedLevel.DataValueField = "Value";
|
||
this.drpJOT_QualifiedLevel.DataSource = BLL.DropListService.HJGL_NDTClassItem();
|
||
this.drpJOT_QualifiedLevel.DataBind();
|
||
Funs.FineUIPleaseSelect(this.drpJOT_QualifiedLevel);
|
||
}
|
||
#endregion
|
||
|
||
#region 加载页面显示信息
|
||
/// <summary>
|
||
/// 加载页面显示信息
|
||
/// </summary>
|
||
private void LoadShowInfo()
|
||
{
|
||
string jotIdStr = Request.Params["jotIdList"];
|
||
if (!string.IsNullOrEmpty(jotIdStr))
|
||
{
|
||
var jotIdList = jotIdStr.Split(',');
|
||
txtJointNoS.Text = BLL.HJGL_PW_JointInfoService.ConvertJointCodeString(jotIdStr);
|
||
var jointInfo = BLL.HJGL_PW_JointInfoService.GetJointInfoByJotID(jotIdList[0]);
|
||
this.ISO_ID = jointInfo.ISO_ID;
|
||
if (jointInfo != null)
|
||
{
|
||
this.txtJointDesc.Text = jointInfo.JOT_JointDesc;
|
||
if (!string.IsNullOrEmpty(jointInfo.DReportID))
|
||
{
|
||
this.drpNDTR_ID.Enabled = false;
|
||
this.drpIsGold.Enabled = false;
|
||
}
|
||
if (!string.IsNullOrEmpty(jointInfo.STE_ID))
|
||
{
|
||
this.ddlSTE1.SelectedValue = jointInfo.STE_ID;
|
||
var ste = BLL.HJGL_MaterialService.GetSteelBySteID(jointInfo.STE_ID);
|
||
if (ste != null)
|
||
{
|
||
this.txtHardQuaStandard.Text = ste.HardQuaStandard;
|
||
}
|
||
}
|
||
if (!string.IsNullOrEmpty(jointInfo.STE_ID2))
|
||
{
|
||
this.ddlSTE2.SelectedValue = jointInfo.STE_ID2;
|
||
}
|
||
if (!string.IsNullOrEmpty(jointInfo.JOTY_ID))
|
||
{
|
||
this.ddlJOTY_ID.SelectedValue = jointInfo.JOTY_ID;
|
||
}
|
||
if (!string.IsNullOrEmpty(jointInfo.JST_ID))
|
||
{
|
||
this.ddlJST_ID.SelectedValue = jointInfo.JST_ID;
|
||
}
|
||
if (!string.IsNullOrEmpty(jointInfo.JOT_JointAttribute))
|
||
{
|
||
this.ddlJointAttribute.SelectedValue = jointInfo.JOT_JointAttribute;
|
||
//if (this.ddlJointAttribute.SelectedValue == "固定")
|
||
//{
|
||
// if (this.txtJointNo.Text.Trim().Last() != 'G')
|
||
// {
|
||
// this.txtJointNo.Text = this.txtJointNo.Text.Trim() + "G";
|
||
// }
|
||
//}
|
||
//else
|
||
//{
|
||
// if (this.txtJointNo.Text.Trim().Last() == 'G')
|
||
// {
|
||
// this.txtJointNo.Text = this.txtJointNo.Text.Trim().Replace("G", "");
|
||
// }
|
||
//}
|
||
}
|
||
if (!string.IsNullOrEmpty(jointInfo.WME_ID))
|
||
{
|
||
this.ddlWME_ID.SelectedValue = jointInfo.WME_ID;
|
||
}
|
||
this.txtSize.Text = Convert.ToString(jointInfo.JOT_Size);
|
||
this.txtDial.Text = (jointInfo.JOT_Dia ?? 0).ToString("N2");
|
||
this.txtSch.Text = jointInfo.JOT_Sch;
|
||
if (!string.IsNullOrEmpty(jointInfo.WLO_Code))
|
||
{
|
||
this.ddlWLO_CODE.SelectedValue = jointInfo.WLO_Code;
|
||
}
|
||
if (!string.IsNullOrEmpty(jointInfo.JOT_Component1))
|
||
{
|
||
this.ddlComponent1.SelectedValue = jointInfo.JOT_Component1;
|
||
}
|
||
if (!string.IsNullOrEmpty(jointInfo.JOT_Component2))
|
||
{
|
||
this.ddlComponent2.SelectedValue = jointInfo.JOT_Component2;
|
||
}
|
||
this.txtLastTemp.Text = Convert.ToString(jointInfo.JOT_LastTemp);
|
||
this.txtCellTemp.Text = Convert.ToString(jointInfo.JOT_CellTemp);
|
||
this.txtPrepareTemp.Text = Convert.ToString(jointInfo.JOT_PrepareTemp);
|
||
if (!string.IsNullOrEmpty(jointInfo.JOT_WeldSilk))
|
||
{
|
||
this.ddlWeldSilk.SelectedValue = jointInfo.JOT_WeldSilk;
|
||
}
|
||
if (jointInfo.WeldL != null)
|
||
{
|
||
this.txtWeldL.Text = jointInfo.WeldL.ToString();
|
||
}
|
||
if (!string.IsNullOrEmpty(jointInfo.JOT_WeldMat))
|
||
{
|
||
this.ddlWeldMat.SelectedValue = jointInfo.JOT_WeldMat;
|
||
}
|
||
this.txtElectricity.Text = jointInfo.JOT_Electricity;
|
||
this.txtVoltage.Text = jointInfo.JOT_Voltage;
|
||
if (!string.IsNullOrEmpty(jointInfo.IS_Proess))
|
||
{
|
||
this.drpIS_Proess.SelectedValue = jointInfo.IS_Proess;
|
||
if (jointInfo.IS_Proess == "1")
|
||
{
|
||
this.drpProessTypes.Hidden = false;
|
||
if (!string.IsNullOrEmpty(jointInfo.ProessTypes))
|
||
{
|
||
string[] proessTypes = jointInfo.ProessTypes.Split('|');
|
||
this.drpProessTypes.Values = proessTypes;
|
||
}
|
||
}
|
||
}
|
||
if (jointInfo.IsSpecial == true)
|
||
{
|
||
this.drpIsSpecial.SelectedValue = "1";
|
||
}
|
||
else
|
||
{
|
||
this.drpIsSpecial.SelectedValue = "0";
|
||
}
|
||
this.txtRemark.Text = jointInfo.JOT_Remark;
|
||
if (!string.IsNullOrEmpty(jointInfo.InstallationId))
|
||
{
|
||
this.drpInstallationId.Items.Clear();
|
||
this.drpInstallationId.DataTextField = "Text";
|
||
this.drpInstallationId.DataValueField = "Value";
|
||
this.drpInstallationId.DataSource = BLL.Project_InstallationService.GetInstallationList(jointInfo.ProjectId);
|
||
this.drpInstallationId.DataBind();
|
||
Funs.FineUIPleaseSelect(this.drpInstallationId);
|
||
this.drpInstallationId.SelectedValue = jointInfo.InstallationId;
|
||
}
|
||
if (!string.IsNullOrEmpty(jointInfo.NDTR_ID))
|
||
{
|
||
this.drpNDTR_ID.SelectedValue = jointInfo.NDTR_ID;
|
||
}
|
||
if (!string.IsNullOrEmpty(jointInfo.JOT_QualifiedLevel))
|
||
{
|
||
this.drpJOT_QualifiedLevel.SelectedValue = jointInfo.JOT_QualifiedLevel;
|
||
}
|
||
this.txtPressureTestPackageNo.Text = jointInfo.PressureTestPackageNo;
|
||
if (jointInfo.IsGold == true)
|
||
{
|
||
this.drpIsGold.SelectedValue = "1";
|
||
this.drpNDTR_ID.Enabled = false;
|
||
}
|
||
else
|
||
{
|
||
this.drpIsGold.SelectedValue = "0";
|
||
}
|
||
}
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 文本框是否可编辑
|
||
/// <summary>
|
||
/// 文本框是否可编辑
|
||
/// </summary>
|
||
/// <param name="readOnly"></param>
|
||
private void TextIsReadOnly(bool readOnly)
|
||
{
|
||
//this.btnSave.Hidden = readOnly;
|
||
//this.txtJointNo.Readonly = readOnly;
|
||
this.ddlWLO_CODE.Enabled = !readOnly;
|
||
this.ddlSTE1.Enabled = !readOnly;
|
||
this.ddlSTE2.Enabled = !readOnly;
|
||
this.ddlComponent1.Enabled = !readOnly;
|
||
this.ddlComponent2.Enabled = !readOnly;
|
||
this.txtJointDesc.Readonly = readOnly;
|
||
this.ddlJOTY_ID.Enabled = !readOnly;
|
||
this.txtSize.Readonly = readOnly;
|
||
this.txtDial.Readonly = readOnly;
|
||
this.ddlJST_ID.Enabled = !readOnly;
|
||
this.txtSch.Readonly = readOnly;
|
||
this.txtLastTemp.Readonly = readOnly;
|
||
this.txtCellTemp.Readonly = readOnly;
|
||
//this.txtPrepareTemp.Readonly = readOnly;
|
||
this.ddlJointAttribute.Enabled = !readOnly;
|
||
this.ddlWME_ID.Enabled = !readOnly;
|
||
this.ddlWeldSilk.Enabled = !readOnly;
|
||
this.ddlWeldMat.Enabled = !readOnly;
|
||
this.txtElectricity.Readonly = readOnly;
|
||
this.txtVoltage.Readonly = readOnly;
|
||
this.txtRemark.Readonly = readOnly;
|
||
this.drpInstallationId.Enabled = !readOnly;
|
||
this.drpNDTR_ID.Enabled = !readOnly;
|
||
this.drpJOT_QualifiedLevel.Enabled = !readOnly;
|
||
this.drpIsSpecial.Enabled = !readOnly;
|
||
this.txtHardQuaStandard.Readonly = readOnly;
|
||
this.txtWeldL.Readonly = readOnly;
|
||
}
|
||
#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_JointInfoMenuId, Const.BtnSave))
|
||
{
|
||
if (this.drpInstallationId.SelectedValue == BLL.Const._Null||string.IsNullOrEmpty(this.drpInstallationId.SelectedValue))
|
||
{
|
||
Alert.ShowInTop("请选择装置!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
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.ddlJST_ID.SelectedValue == BLL.Const._Null||string.IsNullOrEmpty(this.ddlJST_ID.SelectedValue))
|
||
{
|
||
Alert.ShowInTop("请选择坡口类型!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
if (this.ddlJointAttribute.SelectedValue == BLL.Const._Null||string.IsNullOrEmpty(this.ddlJointAttribute.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.drpNDTR_ID.SelectedValue == BLL.Const._Null||string.IsNullOrEmpty(this.drpNDTR_ID.SelectedValue))
|
||
{
|
||
Alert.ShowInTop("请选择探伤比例!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
if (this.drpJOT_QualifiedLevel.SelectedValue == BLL.Const._Null||string.IsNullOrEmpty(this.drpJOT_QualifiedLevel.SelectedValue))
|
||
{
|
||
Alert.ShowInTop("请选择合格等级!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
|
||
string jotIdStr = Request.Params["jotIdList"];
|
||
if (!string.IsNullOrEmpty(jotIdStr))
|
||
{
|
||
Model.SGGLDB db = Funs.DB;
|
||
var jotIdList = jotIdStr.Split(',');
|
||
foreach (var jotId in jotIdList)
|
||
{
|
||
Model.HJGL_PW_JointInfo newJointInfo = db.HJGL_PW_JointInfo.FirstOrDefault(x => x.JOT_ID == jotId);
|
||
var hotItems = from x in BLL.Funs.DB.HJGL_CH_HotProessTrustItem where x.JOT_ID == jotId select x;
|
||
var batchDetail = BLL.HJGL_BO_BatchDetailService.GetBatchDetailByJotId(jotId);
|
||
if ((batchDetail != null || hotItems.Count() > 0) && this.CurrUser.UserId != BLL.Const.GlyId)
|
||
{
|
||
newJointInfo.JOT_PrepareTemp = Funs.GetNewDecimal(this.txtPrepareTemp.Text);
|
||
newJointInfo.PressureTestPackageNo = this.txtPressureTestPackageNo.Text;
|
||
if (this.drpIS_Proess.SelectedValue != BLL.Const._Null)
|
||
{
|
||
newJointInfo.IS_Proess = this.drpIS_Proess.SelectedValue;
|
||
if (this.drpIS_Proess.SelectedValue == "1")
|
||
{
|
||
if (drpProessTypes.Values.Length > 0)
|
||
{
|
||
newJointInfo.ProessTypes = String.Join("|", drpProessTypes.Values);
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("请选择热处理类型!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
BLL.HJGL_PW_JointInfoService.UpdateJointInfo(newJointInfo);
|
||
}
|
||
else
|
||
{
|
||
newJointInfo.JOT_JointDesc = this.txtJointDesc.Text.Trim();
|
||
newJointInfo.STE_ID = this.ddlSTE1.SelectedValue;
|
||
if (this.ddlSTE2.SelectedValue != BLL.Const._Null)
|
||
{
|
||
newJointInfo.STE_ID2 = this.ddlSTE2.SelectedValue;
|
||
}
|
||
newJointInfo.JOTY_ID = this.ddlJOTY_ID.SelectedValue;
|
||
newJointInfo.JST_ID = this.ddlJST_ID.SelectedValue;
|
||
newJointInfo.JOT_JointAttribute = this.ddlJointAttribute.SelectedValue;
|
||
newJointInfo.WME_ID = this.ddlWME_ID.SelectedValue;
|
||
newJointInfo.JOT_Size = Funs.GetNewDecimal(this.txtSize.Text);
|
||
newJointInfo.JOT_Dia = Funs.GetNewDecimal(this.txtDial.Text);
|
||
newJointInfo.JOT_Sch = this.txtSch.Text.Trim();
|
||
if (this.ddlWLO_CODE.SelectedValue != BLL.Const._Null)
|
||
{
|
||
newJointInfo.WLO_Code = this.ddlWLO_CODE.SelectedValue;
|
||
}
|
||
if (this.ddlComponent1.SelectedValue != BLL.Const._Null)
|
||
{
|
||
newJointInfo.JOT_Component1 = this.ddlComponent1.SelectedValue;
|
||
}
|
||
if (this.ddlComponent2.SelectedValue != BLL.Const._Null)
|
||
{
|
||
newJointInfo.JOT_Component2 = this.ddlComponent2.SelectedValue;
|
||
}
|
||
newJointInfo.JOT_LastTemp = Funs.GetNewDecimal(this.txtLastTemp.Text);
|
||
newJointInfo.JOT_CellTemp = Funs.GetNewDecimal(this.txtCellTemp.Text);
|
||
newJointInfo.JOT_PrepareTemp = Funs.GetNewDecimal(this.txtPrepareTemp.Text);
|
||
if (this.ddlWeldSilk.SelectedValue != BLL.Const._Null)
|
||
{
|
||
newJointInfo.JOT_WeldSilk = this.ddlWeldSilk.SelectedValue;
|
||
}
|
||
if (this.ddlWeldMat.SelectedValue != BLL.Const._Null)
|
||
{
|
||
newJointInfo.JOT_WeldMat = this.ddlWeldMat.SelectedValue;
|
||
}
|
||
newJointInfo.JOT_Electricity = this.txtElectricity.Text.Trim();
|
||
newJointInfo.JOT_Voltage = this.txtVoltage.Text.Trim();
|
||
if (this.drpIS_Proess.SelectedValue != BLL.Const._Null)
|
||
{
|
||
newJointInfo.IS_Proess = this.drpIS_Proess.SelectedValue;
|
||
if (this.drpIS_Proess.SelectedValue == "1")
|
||
{
|
||
if (drpProessTypes.Values.Length > 0)
|
||
{
|
||
newJointInfo.ProessTypes = String.Join("|", drpProessTypes.Values);
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("请选择热处理类型!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
}
|
||
}
|
||
newJointInfo.JOT_Remark = this.txtRemark.Text;
|
||
newJointInfo.PressureTestPackageNo = this.txtPressureTestPackageNo.Text;
|
||
newJointInfo.InstallationId = this.drpInstallationId.SelectedValue;
|
||
newJointInfo.NDTR_ID = this.drpNDTR_ID.SelectedValue;
|
||
newJointInfo.JOT_QualifiedLevel = this.drpJOT_QualifiedLevel.SelectedValue;
|
||
if (this.drpIsSpecial.SelectedValue == "1")
|
||
{
|
||
newJointInfo.IsSpecial = true;
|
||
}
|
||
else
|
||
{
|
||
newJointInfo.IsSpecial = false;
|
||
}
|
||
if (this.drpIsGold.SelectedValue == "1")
|
||
{
|
||
newJointInfo.IsGold = true;
|
||
}
|
||
else
|
||
{
|
||
newJointInfo.IsGold = false;
|
||
}
|
||
if (!string.IsNullOrEmpty(this.txtWeldL.Text))
|
||
{
|
||
newJointInfo.WeldL = Convert.ToInt32(this.txtWeldL.Text);
|
||
}
|
||
newJointInfo.JOT_JointStatus = "100";
|
||
newJointInfo.JOT_TrustFlag = "00";
|
||
newJointInfo.JOT_CheckFlag = "00";
|
||
if (newJointInfo.DReportID != null)
|
||
{
|
||
BLL.HJGL_PW_JointInfoService.UpdateJointNoAddG(jotId, this.ddlJointAttribute.SelectedValue, Const.BtnModify);
|
||
}
|
||
var joty = BLL.HJGL_WeldService.GetJointTypeByID(newJointInfo.JOTY_ID);
|
||
if (joty != null)
|
||
{
|
||
var jot = BLL.HJGL_PW_JointInfoService.GetJointInfoByJotID(jotId);
|
||
if (jot != null)
|
||
{
|
||
if (!string.IsNullOrEmpty(jot.JOT_JointNo))
|
||
{
|
||
if (joty.JOTY_Group == "2")//角焊缝(承插)
|
||
{
|
||
if (char.IsDigit(jot.JOT_JointNo[0]))
|
||
{
|
||
newJointInfo.JOT_JointNo = "C" + jot.JOT_JointNo;
|
||
}
|
||
else
|
||
{
|
||
newJointInfo.JOT_JointNo = "C" + jot.JOT_JointNo.Substring(1);
|
||
}
|
||
}
|
||
else if (joty.JOTY_Group == "3")//支管连接焊缝
|
||
{
|
||
if (char.IsDigit(jot.JOT_JointNo[0]))
|
||
{
|
||
newJointInfo.JOT_JointNo = "D" + jot.JOT_JointNo;
|
||
}
|
||
else
|
||
{
|
||
newJointInfo.JOT_JointNo = "D" + jot.JOT_JointNo.Substring(1);
|
||
}
|
||
}
|
||
}
|
||
}
|
||
}
|
||
BLL.HJGL_PW_JointInfoService.UpdateJointInfo(newJointInfo);
|
||
|
||
//// 更新排序字段
|
||
string strSort = @"UPDATE dbo.HJGL_PW_JointInfo SET
|
||
Sort1=(case when PATINDEX('[A-Z]%',JOT_JointNo)>0 THEN 'B'
|
||
WHEN ISNUMERIC(JOT_JointNo)=1 then 'C' ELSE 'C' END),
|
||
Sort2=(CASE WHEN ISNUMERIC(JOT_JointNo)=1 then try_cast(REPLACE(JOT_JointNo,'.','') AS INT)
|
||
WHEN ISNUMERIC(SUBSTRING(JOT_JointNo,0,CHARINDEX('Z',JOT_JointNo)))=1
|
||
THEN TRY_CAST(SUBSTRING(JOT_JointNo,0,CHARINDEX('Z',JOT_JointNo)) as int)
|
||
WHEN PATINDEX('[0-9]%',JOT_JointNo)>0 then
|
||
TRY_CAST(left(JOT_JointNo,PATINDEX('%[^0-9]%',JOT_JointNo)-1) as int)
|
||
ELSE 0 END),
|
||
Sort3= SUBSTRING(JOT_JointNo,1,1),
|
||
Sort4=(CASE WHEN CHARINDEX('Z',JOT_JointNo)>0 and SUBSTRING(JOT_JointNo,1,1)<>'Z'
|
||
THEN ISNULL(TRY_CAST(SUBSTRING(replace(JOT_JointNo,'#',''),2,CHARINDEX('Z',JOT_JointNo)-2) as int),0)
|
||
WHEN PATINDEX('%[A-G]%',SUBSTRING(replace(JOT_JointNo,'#',''),2,len(JOT_JointNo)))>0
|
||
THEN ISNULL(TRY_CAST(SUBSTRING(JOT_JointNo,2,len(JOT_JointNo)-2) as int),0)
|
||
ELSE ISNULL(TRY_CAST(SUBSTRING(replace(JOT_JointNo,'#',''),2,len(JOT_JointNo)) as int),0) END),
|
||
Sort5=(CASE WHEN CHARINDEX('Z',JOT_JointNo)>0
|
||
THEN ISNULL(TRY_CAST(SUBSTRING(JOT_JointNo,charindex('Z',JOT_JointNo)+1,len(JOT_JointNo)) AS INT),0)
|
||
WHEN PATINDEX('%[A-Y]',SUBSTRING(replace(JOT_JointNo,'#',''),2,len(JOT_JointNo)))>0
|
||
THEN ISNULL(TRY_CAST(SUBSTRING(JOT_JointNo,2,len(JOT_JointNo)-1) as int),0) ELSE 0 END)
|
||
WHERE JOT_ID='" + jotId+ "'";
|
||
SQLHelper.ExecutSql(strSort);
|
||
}
|
||
}
|
||
}
|
||
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
|
||
ShowNotify("提交成功!", MessageBoxIcon.Success);
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
}
|
||
#endregion
|
||
|
||
#region 格式化字符串
|
||
/// <summary>
|
||
/// 材质1下拉选择事件
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void ddlSTE1_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
if (this.ddlSTE1.SelectedValue != BLL.Const._Null)
|
||
{
|
||
var ste = BLL.HJGL_MaterialService.GetSteelBySteID(this.ddlSTE1.SelectedValue);
|
||
if (ste != null)
|
||
{
|
||
this.txtHardQuaStandard.Text = ste.HardQuaStandard;
|
||
}
|
||
else
|
||
{
|
||
this.txtHardQuaStandard.Text = string.Empty;
|
||
}
|
||
this.ddlSTE2.SelectedValue = ddlSTE1.SelectedValue;
|
||
}
|
||
else
|
||
{
|
||
this.txtHardQuaStandard.Text = string.Empty;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 焊缝类型下拉选择事件
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void ddlJOTY_ID_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
if (this.ddlJOTY_ID.SelectedValue != BLL.Const._Null)
|
||
{
|
||
var joty = BLL.HJGL_WeldService.GetJointTypeByID(this.ddlJOTY_ID.SelectedValue);
|
||
if (joty != null)
|
||
{
|
||
var isoInfo = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoInfoId(this.ISO_ID);
|
||
if (isoInfo != null)
|
||
{
|
||
if (joty.JOTY_Group == "1")//对接
|
||
{
|
||
if (!string.IsNullOrEmpty(isoInfo.Joty_B_Rate))
|
||
{
|
||
this.drpNDTR_ID.SelectedValue = isoInfo.Joty_B_Rate;
|
||
}
|
||
else
|
||
{
|
||
this.drpNDTR_ID.SelectedValue = BLL.Const._Null;
|
||
}
|
||
if (!string.IsNullOrEmpty(isoInfo.Joty_B_Level))
|
||
{
|
||
this.drpJOT_QualifiedLevel.SelectedValue = isoInfo.Joty_B_Level;
|
||
}
|
||
else
|
||
{
|
||
this.drpJOT_QualifiedLevel.SelectedValue = BLL.Const._Null;
|
||
}
|
||
}
|
||
else if (joty.JOTY_Group == "2")//角焊缝(承插)
|
||
{
|
||
if (!string.IsNullOrEmpty(isoInfo.Joty_C_Rate))
|
||
{
|
||
this.drpNDTR_ID.SelectedValue = isoInfo.Joty_C_Rate;
|
||
}
|
||
else
|
||
{
|
||
this.drpNDTR_ID.SelectedValue = BLL.Const._Null;
|
||
}
|
||
if (!string.IsNullOrEmpty(isoInfo.Joty_C_Level))
|
||
{
|
||
this.drpJOT_QualifiedLevel.SelectedValue = isoInfo.Joty_C_Level;
|
||
}
|
||
else
|
||
{
|
||
this.drpJOT_QualifiedLevel.SelectedValue = BLL.Const._Null;
|
||
}
|
||
//焊口号前自动加C
|
||
//string jointNo = this.txtJointNo.Text.Trim();
|
||
//if (!string.IsNullOrEmpty(jointNo))
|
||
//{
|
||
// if (char.IsDigit(jointNo[0]))
|
||
// {
|
||
// this.txtJointNo.Text = "C" + jointNo;
|
||
// }
|
||
// else
|
||
// {
|
||
// this.txtJointNo.Text = "C" + jointNo.Substring(1);
|
||
// }
|
||
//}
|
||
//else
|
||
//{
|
||
// this.txtJointNo.Text = "C";
|
||
//}
|
||
}
|
||
else if (joty.JOTY_Group == "3")//支管连接焊缝
|
||
{
|
||
if (!string.IsNullOrEmpty(isoInfo.Joty_D_Rate))
|
||
{
|
||
this.drpNDTR_ID.SelectedValue = isoInfo.Joty_D_Rate;
|
||
}
|
||
else
|
||
{
|
||
this.drpNDTR_ID.SelectedValue = BLL.Const._Null;
|
||
}
|
||
if (!string.IsNullOrEmpty(isoInfo.Joty_D_Level))
|
||
{
|
||
this.drpJOT_QualifiedLevel.SelectedValue = isoInfo.Joty_D_Level;
|
||
}
|
||
else
|
||
{
|
||
this.drpJOT_QualifiedLevel.SelectedValue = BLL.Const._Null;
|
||
}
|
||
////焊口号前自动加D
|
||
//string jointNo = this.txtJointNo.Text.Trim();
|
||
//if (!string.IsNullOrEmpty(jointNo))
|
||
//{
|
||
// if (char.IsDigit(jointNo[0]))
|
||
// {
|
||
// this.txtJointNo.Text = "D" + jointNo;
|
||
// }
|
||
// else
|
||
// {
|
||
// this.txtJointNo.Text = "D" + jointNo.Substring(1);
|
||
// }
|
||
//}
|
||
//else
|
||
//{
|
||
// this.txtJointNo.Text = "D";
|
||
//}
|
||
}
|
||
}
|
||
}
|
||
else
|
||
{
|
||
this.drpNDTR_ID.SelectedValue = BLL.Const._Null;
|
||
this.drpJOT_QualifiedLevel.SelectedValue = BLL.Const._Null;
|
||
}
|
||
}
|
||
else
|
||
{
|
||
this.drpNDTR_ID.SelectedValue = BLL.Const._Null;
|
||
this.drpJOT_QualifiedLevel.SelectedValue = BLL.Const._Null;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 焊工属性下拉选择事件
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void ddlJointAttribute_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
//if (this.ddlJointAttribute.SelectedValue == "固定")
|
||
//{
|
||
//if (this.txtJointNo.Text.Trim().Last() != 'G')
|
||
//{
|
||
// this.txtJointNo.Text = this.txtJointNo.Text.Trim() + "G";
|
||
//}
|
||
//}
|
||
//else
|
||
//{
|
||
//if (this.txtJointNo.Text.Trim().Last() == 'G')
|
||
//{
|
||
// this.txtJointNo.Text = this.txtJointNo.Text.Trim().Replace("G", "");
|
||
//}
|
||
//}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 根据寸经外径对照表,输入外径是自动得到寸径;焊口规格:Φ外径*壁厚
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void txtText_TextChanged(object sender, EventArgs e)
|
||
{
|
||
//根据寸经外径对照表,输入外径是自动得到寸径
|
||
if (!string.IsNullOrEmpty(this.txtDial.Text.Trim()))
|
||
{
|
||
decimal dia = Funs.GetNewDecimalOrZero(this.txtDial.Text.Trim());
|
||
if (dia >= 500)
|
||
{
|
||
this.drpIsSpecial.SelectedValue = "1";
|
||
}
|
||
var inch = HJGL_ControlService.GetSizeByDia(dia);
|
||
if (inch != null)
|
||
{
|
||
this.txtSize.Text = Convert.ToString(inch);
|
||
}
|
||
}
|
||
|
||
//焊口规格:Φ外径*壁厚
|
||
if (!string.IsNullOrEmpty(this.txtDial.Text.Trim()) && !string.IsNullOrEmpty(this.txtSch.Text.Trim()))
|
||
{
|
||
this.txtJointDesc.Text = "Φ" + this.txtDial.Text.Trim() + "×" + this.txtSch.Text.Trim();
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 是否显示热处理类型
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void drpIS_Proess_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
if (this.drpIS_Proess.SelectedValue == "1")
|
||
{
|
||
this.drpProessTypes.Hidden = false;
|
||
}
|
||
else
|
||
{
|
||
this.drpProessTypes.Hidden = true;
|
||
}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 热处理类型选择变化事件
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
string jotIdStr = Request.Params["jotIdList"];
|
||
var jotIdList = jotIdStr.Split(',');
|
||
//已委托的热处理类型
|
||
var isTrustProessTypes = from x in BLL.Funs.DB.HJGL_CH_HotProessTrustItem where x.JOT_ID == jotIdList[0] select x.ProessTypes;
|
||
if (drpProessTypes.Values.Length > 0)
|
||
{
|
||
List<string> strs = this.RadioButtonList1.SelectedValueArray.ToList();
|
||
foreach (var isTrustProessType in isTrustProessTypes) //已委托的热处理类型不能去除
|
||
{
|
||
if (!strs.Contains(isTrustProessType))
|
||
{
|
||
strs.Add(isTrustProessType);
|
||
}
|
||
}
|
||
this.RadioButtonList1.SelectedValueArray = strs.ToArray();
|
||
this.drpProessTypes.Values = strs.ToArray();
|
||
string proessTypes = String.Join("|", drpProessTypes.Values);
|
||
this.drpProessTypes.Text = BLL.HJGL_PW_JointInfoService.ConvertProessTypes(proessTypes);
|
||
}
|
||
else
|
||
{
|
||
Alert.ShowInTop("请选择热处理类型!", MessageBoxIcon.Warning);
|
||
return;
|
||
}
|
||
}
|
||
|
||
protected void drpIsGold_SelectedIndexChanged(object sender, EventArgs e)
|
||
{
|
||
//var jotIdList = jotIdStr.Split(',');
|
||
//foreach (var item in jotIdList)
|
||
//{
|
||
if (this.drpIsGold.SelectedValue == "1")
|
||
{
|
||
this.drpNDTR_ID.SelectedValue = "e2612188-fc99-492a-937c-74c7a0151656"; //黄金口检测比例100%
|
||
this.drpNDTR_ID.Enabled = false;
|
||
//this.txtJointNoPrix.Text =BLL.HJGL_PW_JointInfoService.GetJointInfoByJotID(item).JOT_JointNo + "H";
|
||
}
|
||
else
|
||
{
|
||
this.drpNDTR_ID.SelectedValue = BLL.Const._Null;
|
||
this.drpNDTR_ID.Enabled = true;
|
||
//string jotNo= BLL.HJGL_PW_JointInfoService.GetJointInfoByJotID(item).JOT_JointNo;
|
||
//this.txtJointNo.Text = this.txtJointNo.Text.Trim().Substring(0, this.txtJointNo.Text.Trim().Length - 1);
|
||
}
|
||
//}
|
||
}
|
||
|
||
/// <summary>
|
||
/// 外径输入事件
|
||
/// </summary>
|
||
/// <param name="sender"></param>
|
||
/// <param name="e"></param>
|
||
protected void txtDial_TextChanged(object sender, EventArgs e)
|
||
{
|
||
//根据寸经外径对照表,输入外径是自动得到寸径
|
||
if (!string.IsNullOrEmpty(this.txtDial.Text.Trim()))
|
||
{
|
||
decimal dia = Funs.GetNewDecimalOrZero(this.txtDial.Text.Trim());
|
||
if (dia >= 500)
|
||
{
|
||
this.drpIsSpecial.SelectedValue = "1";
|
||
}
|
||
var inch = HJGL_ControlService.GetSizeByDia(dia);
|
||
if (inch != null)
|
||
{
|
||
this.txtSize.Text = Convert.ToString(inch);
|
||
}
|
||
}
|
||
|
||
//焊口规格:Φ外径*壁厚
|
||
if (!string.IsNullOrEmpty(this.txtDial.Text.Trim()) && !string.IsNullOrEmpty(this.txtSch.Text.Trim()))
|
||
{
|
||
this.txtJointDesc.Text = "Φ" + this.txtDial.Text.Trim() + "×" + this.txtSch.Text.Trim();
|
||
}
|
||
}
|
||
|
||
// 非常规焊缝
|
||
protected void txtWeldL_TextChanged(object sender, EventArgs e)
|
||
{
|
||
if (!string.IsNullOrEmpty(this.txtWeldL.Text.Trim()))
|
||
{
|
||
this.txtJointDesc.Text = "L=" + this.txtWeldL.Text.Trim() + "×" + this.txtSch.Text.Trim();
|
||
}
|
||
}
|
||
#endregion
|
||
}
|
||
} |