606 lines
27 KiB
C#
606 lines
27 KiB
C#
using BLL;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Data;
|
|
using System.Data.SqlClient;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace FineUIPro.Web.HJGL.WeldingManage
|
|
{
|
|
public partial class WeldingConDate : PageBase
|
|
{
|
|
public int pageSize = PipelineService.pageSize;
|
|
|
|
protected void Page_Load(object sender, EventArgs e)
|
|
{
|
|
if (!IsPostBack)
|
|
{
|
|
BLL.UnitService.InitUnitByProjectIdUnitTypeDropDownList(drpUnit, this.CurrUser.LoginProjectId, Const.ProjectUnitType_2, true);
|
|
///焊接属性
|
|
this.drpJointAttribute.DataTextField = "Text";
|
|
this.drpJointAttribute.DataValueField = "Value";
|
|
this.drpJointAttribute.DataSource = BLL.DropListService.HJGL_JointAttribute();
|
|
this.drpJointAttribute.DataBind();
|
|
///管线划分
|
|
this.drpPipeArea.DataTextField = "Text";
|
|
this.drpPipeArea.DataValueField = "Value";
|
|
this.drpPipeArea.DataSource = BLL.PipelineService.GetPipeArea();
|
|
this.drpPipeArea.DataBind();
|
|
Funs.FineUIPleaseSelect(this.drpPipeArea);
|
|
this.InitTreeMenu();
|
|
}
|
|
}
|
|
|
|
#region 加载树装置-单位-工作区
|
|
/// <summary>
|
|
/// 加载树
|
|
/// </summary>
|
|
private void InitTreeMenu()
|
|
{
|
|
this.tvControlItem.Nodes.Clear();
|
|
|
|
TreeNode rootNode1 = new TreeNode();
|
|
rootNode1.NodeID = "1";
|
|
rootNode1.Text = "建筑工程";
|
|
rootNode1.CommandName = "建筑工程";
|
|
rootNode1.Selectable = false;
|
|
this.tvControlItem.Nodes.Add(rootNode1);
|
|
|
|
TreeNode rootNode2 = new TreeNode();
|
|
rootNode2.NodeID = "2";
|
|
rootNode2.Text = "安装工程";
|
|
rootNode2.CommandName = "安装工程";
|
|
rootNode2.Expanded = true;
|
|
this.tvControlItem.Nodes.Add(rootNode2);
|
|
|
|
var pUnits = (from x in Funs.DB.Project_ProjectUnit where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
|
|
// 获取当前用户所在单位
|
|
var currUnit = pUnits.FirstOrDefault(x => x.UnitId == this.CurrUser.UnitId);
|
|
|
|
var unitWorkList = (from x in Funs.DB.WBS_UnitWork
|
|
where x.ProjectId == this.CurrUser.LoginProjectId
|
|
&& x.SuperUnitWork == null && x.UnitId != null && x.ProjectType != null
|
|
select x).ToList();
|
|
|
|
List<Model.WBS_UnitWork> unitWork1 = null;
|
|
List<Model.WBS_UnitWork> unitWork2 = null;
|
|
|
|
//// 当前为施工单位,只能操作本单位的数据
|
|
//if (currUnit != null && currUnit.UnitType == Const.ProjectUnitType_2)
|
|
//{
|
|
// unitWork1 = (from x in unitWorkList
|
|
// where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "1"
|
|
// select x).ToList();
|
|
// unitWork2 = (from x in unitWorkList
|
|
// where x.UnitId == this.CurrUser.UnitId && x.ProjectType == "2"
|
|
// select x).ToList();
|
|
//}
|
|
//else
|
|
//{
|
|
unitWork1 = (from x in unitWorkList where x.ProjectType == "1" select x).ToList();
|
|
unitWork2 = (from x in unitWorkList where x.ProjectType == "2" select x).ToList();
|
|
//}
|
|
string pipeAreasql = string.Empty;
|
|
if (this.drpPipeArea.SelectedValue != BLL.Const._Null)
|
|
{
|
|
pipeAreasql += " AND PipeArea='" + this.drpPipeArea.SelectedValue + "'";
|
|
}
|
|
if (unitWork1.Count() > 0)
|
|
{
|
|
foreach (var q in unitWork1)
|
|
{
|
|
int a = 0;
|
|
if (ckNOEdit.Checked)
|
|
{
|
|
string strSql = "SELECT distinct PipelineCode FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL AND UnitWorkId =@UnitWorkId AND WPQId IS NULL" + pipeAreasql;
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|
listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId));
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
System.Data.DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|
a = dt.Rows.Count;
|
|
|
|
}
|
|
else
|
|
{
|
|
if (this.drpPipeArea.SelectedValue == BLL.Const._Null)
|
|
{
|
|
a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId select x).Count();
|
|
}
|
|
else
|
|
{
|
|
a = (from x in Funs.DB.HJGL_Pipeline where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId && x.PipeArea == this.drpPipeArea.SelectedValue select x).Count();
|
|
}
|
|
|
|
}
|
|
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
|
|
TreeNode tn1 = new TreeNode();
|
|
tn1.NodeID = q.UnitWorkId;
|
|
tn1.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
|
|
tn1.ToolTip = "施工单位:" + unitNamesUnitIds;
|
|
tn1.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
|
|
tn1.EnableExpandEvent = true;
|
|
tn1.EnableClickEvent = true;
|
|
tn1.EnableCheckBox = false;
|
|
rootNode1.Nodes.Add(tn1);
|
|
if (a > 0)
|
|
{
|
|
// BindNodes(tn1);
|
|
TreeNode newNode = new TreeNode();
|
|
newNode.Text = "加载管线...";
|
|
newNode.NodeID = "加载管线...";
|
|
tn1.Nodes.Add(newNode);
|
|
}
|
|
}
|
|
}
|
|
if (unitWork2.Count() > 0)
|
|
{
|
|
foreach (var q in unitWork2)
|
|
{
|
|
int a = 0;
|
|
if (ckNOEdit.Checked)
|
|
{
|
|
string strSql = "SELECT distinct PipelineCode FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL AND UnitWorkId =@UnitWorkId AND WPQId IS NULL" + pipeAreasql;
|
|
List<SqlParameter> listStr = new List<SqlParameter>();
|
|
listStr.Add(new SqlParameter("@UnitWorkId", q.UnitWorkId));
|
|
if (!string.IsNullOrEmpty(this.txtPipelineCode.Text.Trim()))
|
|
{
|
|
strSql += " and PipelineCode=@PipelineCode ";
|
|
listStr.Add(new SqlParameter("@PipelineCode", "" + this.txtPipelineCode.Text.Trim() + ""));
|
|
|
|
}
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
System.Data.DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|
a = dt.Rows.Count;
|
|
|
|
}
|
|
else
|
|
{
|
|
if (this.drpPipeArea.SelectedValue == BLL.Const._Null)
|
|
{
|
|
a = (from x in Funs.DB.HJGL_Pipeline
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId
|
|
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim())
|
|
select x).Count();
|
|
}
|
|
else
|
|
{
|
|
a = (from x in Funs.DB.HJGL_Pipeline
|
|
where x.ProjectId == this.CurrUser.LoginProjectId && x.UnitWorkId == q.UnitWorkId
|
|
&& x.PipelineCode.Contains(this.txtPipelineCode.Text.Trim()) && x.PipeArea == this.drpPipeArea.SelectedValue
|
|
select x).Count();
|
|
}
|
|
}
|
|
var unitNamesUnitIds = BLL.UnitService.getUnitNamesUnitIds(q.UnitId);
|
|
TreeNode tn2 = new TreeNode();
|
|
tn2.NodeID = q.UnitWorkId;
|
|
tn2.Text = q.UnitWorkName + "【" + a.ToString() + "】" + "管线";
|
|
//if (q.UnitWorkId == this.hdUnitWorkId.Text)
|
|
//{
|
|
// tn2.Expanded = true;
|
|
//}
|
|
tn2.ToolTip = "施工单位:" + unitNamesUnitIds;
|
|
tn2.CommandName = 1 + "|" + Funs.GetEndPageNumber(a, pageSize);
|
|
tn2.EnableExpandEvent = true;
|
|
tn2.EnableClickEvent = true;
|
|
tn2.EnableCheckBox = false;
|
|
rootNode2.Nodes.Add(tn2);
|
|
if (a > 0)
|
|
{
|
|
// BindNodes(tn2);
|
|
TreeNode newNode = new TreeNode();
|
|
newNode.Text = "加载管线...";
|
|
newNode.NodeID = "加载管线...";
|
|
tn2.Nodes.Add(newNode);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
protected void tvControlItem_TreeNodeExpanded(object sender, TreeNodeEventArgs e)
|
|
{
|
|
if (e.Node.Nodes[0].NodeID == "加载管线...")
|
|
{
|
|
e.Node.Nodes.Clear();
|
|
BindNodes(e.Node);
|
|
}
|
|
|
|
}
|
|
private void BindNodes(TreeNode node)
|
|
{
|
|
BLL.PipelineService.BindTreeNodes(node, ckNOEdit.Checked, this.txtPipelineCode.Text.Trim(), this.CurrUser.LoginProjectId, pageSize, this.drpPipeArea.SelectedValue);
|
|
}
|
|
#endregion
|
|
|
|
protected void btnTreeFind_Click(object sender, EventArgs e)
|
|
{
|
|
this.InitTreeMenu();
|
|
}
|
|
|
|
#region 点击TreeView
|
|
/// <summary>
|
|
/// 点击TreeView
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
|
|
{
|
|
if (e.CommandName == "加载")
|
|
{
|
|
string CommandName = e.Node.ParentNode.CommandName;
|
|
e.Node.ParentNode.CommandName = (int.Parse(CommandName.Split('|')[0]) + 1) + "|" + int.Parse(CommandName.Split('|')[1]);
|
|
TreeNode treeNode = e.Node.ParentNode;
|
|
treeNode.Nodes.Remove(e.Node);
|
|
BindNodes(e.Node.ParentNode);
|
|
}
|
|
else
|
|
{
|
|
if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID))
|
|
{
|
|
|
|
if (tvControlItem.SelectedNode.CommandName == "管线")
|
|
{
|
|
Model.HJGL_Pipeline pipeline = BLL.PipelineService.GetPipelineByPipelineId(this.tvControlItem.SelectedNodeID);
|
|
this.hdUnitWorkId.Text = string.Empty;
|
|
if (pipeline != null)
|
|
{
|
|
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.ParentNode.NodeID;
|
|
this.BindGrid();
|
|
}
|
|
}
|
|
else if (tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
|
|
{
|
|
this.hdUnitWorkId.Text = this.tvControlItem.SelectedNode.NodeID;
|
|
this.BindGrid();
|
|
}
|
|
}
|
|
}
|
|
|
|
}
|
|
#endregion
|
|
|
|
#region 数据绑定
|
|
private void BindGrid()
|
|
{
|
|
string strSql = @"SELECT WeldJointId,WeldJointCode,PipelineId,PipelineCode,JointAttribute,
|
|
IsWelding,IsHotProessStr,Material1Code,Material2Code,WeldTypeCode,
|
|
Specification,HeartNo1,HeartNo2,Size,Dia,DNDia,Thickness,GrooveTypeCode,
|
|
WeldingMethodCode,WeldingWireCode,WeldingRodCode,WeldingDate,WeldingDailyCode,
|
|
BackingWelderCode,CoverWelderCode,MediumCode ,PreTemperature,JointArea,WPQCode,Remark
|
|
FROM View_HJGL_WeldJoint WHERE IsTwoJoint IS NULL ";
|
|
List<SqlParameter> listStr = new List<SqlParameter> { };
|
|
|
|
if (tvControlItem.SelectedNode.CommandName == "管线")
|
|
{
|
|
strSql += " AND PipelineId =@PipelineId";
|
|
listStr.Add(new SqlParameter("@PipelineId", tvControlItem.SelectedNodeID));
|
|
|
|
}
|
|
else if (tvControlItem.SelectedNode.CommandName.Split('|').Count() == 2)
|
|
{
|
|
strSql += " AND UnitWorkId =@UnitWorkId";
|
|
listStr.Add(new SqlParameter("@UnitWorkId", tvControlItem.SelectedNodeID));
|
|
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(this.txtWeldJointCode.Text.Trim()))
|
|
{
|
|
strSql += " AND WeldJointCode LIKE @WeldJointCode";
|
|
listStr.Add(new SqlParameter("@WeldJointCode", "%" + this.txtWeldJointCode.Text.Trim() + "%"));
|
|
}
|
|
|
|
if (rbInput.SelectedValue != "0")
|
|
{
|
|
if (rbInput.SelectedValue == "1") // 示录入
|
|
{
|
|
strSql += " AND WPQId IS NULL";
|
|
}
|
|
else
|
|
{
|
|
strSql += " AND WPQId IS NOT NULL";
|
|
}
|
|
}
|
|
|
|
if (!string.IsNullOrEmpty(drpJointAttribute.SelectedValue))
|
|
{
|
|
strSql += " AND JointAttribute =@JointAttribute";
|
|
|
|
listStr.Add(new SqlParameter("@JointAttribute", drpJointAttribute.SelectedValue));
|
|
}
|
|
SqlParameter[] parameter = listStr.ToArray();
|
|
System.Data.DataTable dt = SQLHelper.GetDataTableRunText(strSql, parameter);
|
|
|
|
// 2.获取当前分页数据
|
|
Grid1.RecordCount = dt.Rows.Count;
|
|
var table = this.GetPagedDataTable(Grid1, dt);
|
|
Grid1.DataSource = table;
|
|
Grid1.DataBind();
|
|
}
|
|
#endregion
|
|
|
|
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
|
|
{
|
|
// DataRowView row = e.DataItem as DataRowView;
|
|
string jotid = Grid1.DataKeys[e.RowIndex][0].ToString();
|
|
var jot = Funs.DB.HJGL_WeldJoint.FirstOrDefault(x => x.WeldJointId == jotid);
|
|
if (jot != null && !string.IsNullOrEmpty(jot.MatchableWPQ))
|
|
{
|
|
int wpqNum = jot.MatchableWPQ.Split(',').Count();
|
|
if (wpqNum > 1)
|
|
{
|
|
e.RowCssClass = "color1";
|
|
}
|
|
}
|
|
}
|
|
|
|
#region 分页排序
|
|
#region 页索引改变事件
|
|
/// <summary>
|
|
/// 页索引改变事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
|
{
|
|
BindGrid();
|
|
}
|
|
#endregion
|
|
|
|
#region 排序
|
|
|
|
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
|
{
|
|
BindGrid();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 分页选择下拉改变事件 暂不用
|
|
/// <summary>
|
|
/// 分页选择下拉改变事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
|
{
|
|
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
|
BindGrid();
|
|
}
|
|
#endregion
|
|
|
|
protected void TextBox_TextChanged(object sender, EventArgs e)
|
|
{
|
|
this.BindGrid();
|
|
}
|
|
|
|
#endregion
|
|
|
|
#region 焊口信息 维护事件
|
|
/// <summary>
|
|
/// Grid双击事件
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
|
|
{
|
|
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.HJGL_WeldJointMenuId, BLL.Const.BtnModify))
|
|
{
|
|
if (BLL.WeldTaskService.GetWeldTaskByWeldJointId(Grid1.SelectedRowID) != null) //已下任务单,不可修改数据
|
|
{
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WeldJointView.aspx?WeldJointId={0}&flag=2", Grid1.SelectedRowID, "编辑 - ")));
|
|
}
|
|
else
|
|
{
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WeldJointEdit.aspx?WeldJointId={0}&flag=2", Grid1.SelectedRowID, "编辑 - ")));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 自动录入
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnAutoInput_Click(object sender, EventArgs e)
|
|
{
|
|
if (this.drpUnit.SelectedValue == BLL.Const._Null)
|
|
{
|
|
ShowNotify("请选择工艺规程编制单位!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
if (!string.IsNullOrEmpty(tvControlItem.SelectedNodeID))
|
|
{
|
|
var jotList = from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == tvControlItem.SelectedNodeID && x.JointAttribute == drpJointAttribute.SelectedValue select x;
|
|
if (jotList.Count() > 0)
|
|
{
|
|
foreach (var jot in jotList)
|
|
{
|
|
List<Model.View_HJGL_WPQ> wpqList = BLL.WPQListServiceService.GetMatchWPQ(jot, this.CurrUser.LoginProjectId, drpUnit.SelectedValue);
|
|
Model.HJGL_WeldJoint newJot = new Model.HJGL_WeldJoint();
|
|
if (wpqList != null)
|
|
{
|
|
Model.WPQ_WPQList wps = new Model.WPQ_WPQList();
|
|
var a = wpqList.FirstOrDefault(x => x.WeldingMethodId == "feb1234c-a538-476f-99ac-7b3ab15997c1"); //优先匹配GTAW+SMAW的焊评
|
|
if (a == null)
|
|
{
|
|
wps = BLL.WPQListServiceService.GetWPQById(wpqList.First().WPQId);
|
|
}
|
|
else
|
|
{
|
|
wps = BLL.WPQListServiceService.GetWPQById(a.WPQId);
|
|
}
|
|
|
|
newJot.WPQId = wps.WPQId;
|
|
newJot.WeldJointId = jot.WeldJointId;
|
|
newJot.WeldingRod = wps.WeldingRod;
|
|
newJot.WeldingWire = wps.WeldingWire;
|
|
newJot.WeldingMethodId = wps.WeldingMethodId;
|
|
newJot.GrooveTypeId = wps.GrooveType;
|
|
newJot.PreTemperature = wps.PreTemperature;
|
|
newJot.IsHotProess = wps.IsHotProess;
|
|
newJot.MatchableWPQ = string.Join(",", wpqList.Select(x => x.WPQCode));
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
newJot.WPQId = null;
|
|
newJot.WeldJointId = jot.WeldJointId;
|
|
newJot.WeldingRod = null;
|
|
newJot.WeldingWire = null;
|
|
newJot.WeldingMethodId = null;
|
|
newJot.GrooveTypeId = null;
|
|
newJot.PreTemperature = null;
|
|
newJot.IsHotProess = null;
|
|
newJot.MatchableWPQ = null;
|
|
}
|
|
BLL.WeldJointService.UpdateConWeldJoint(newJot);
|
|
}
|
|
}
|
|
BindGrid();
|
|
ShowNotify("该管线焊口已完成自动录入!", MessageBoxIcon.Success);
|
|
}
|
|
}
|
|
protected void btnAutoInput2_Click(object sender, EventArgs e)
|
|
{
|
|
if (this.drpUnit.SelectedValue == BLL.Const._Null)
|
|
{
|
|
ShowNotify("请选择工艺规程编制单位!", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
TreeNode[] nodes = tvControlItem.GetCheckedNodes();
|
|
if (nodes.Length > 0)
|
|
{
|
|
foreach (TreeNode node in nodes)
|
|
{
|
|
if (!string.IsNullOrEmpty(node.NodeID))
|
|
{
|
|
var jotList = from x in Funs.DB.HJGL_WeldJoint where x.PipelineId == node.NodeID && x.JointAttribute == drpJointAttribute.SelectedValue select x;
|
|
if (jotList.Count() > 0)
|
|
{
|
|
foreach (var jot in jotList)
|
|
{
|
|
List<Model.View_HJGL_WPQ> wpqList = BLL.WPQListServiceService.GetMatchWPQ(jot, this.CurrUser.LoginProjectId, drpUnit.SelectedValue);
|
|
Model.HJGL_WeldJoint newJot = new Model.HJGL_WeldJoint();
|
|
if (wpqList != null)
|
|
{
|
|
Model.WPQ_WPQList wps = new Model.WPQ_WPQList();
|
|
var a = wpqList.FirstOrDefault(x => x.WeldingMethodId == "feb1234c-a538-476f-99ac-7b3ab15997c1"); //优先匹配GTAW+SMAW的焊评
|
|
if (a == null)
|
|
{
|
|
wps = BLL.WPQListServiceService.GetWPQById(wpqList.First().WPQId);
|
|
}
|
|
else
|
|
{
|
|
wps = BLL.WPQListServiceService.GetWPQById(a.WPQId);
|
|
}
|
|
|
|
newJot.WPQId = wps.WPQId;
|
|
newJot.WeldJointId = jot.WeldJointId;
|
|
newJot.WeldingRod = wps.WeldingRod;
|
|
newJot.WeldingWire = wps.WeldingWire;
|
|
newJot.WeldingMethodId = wps.WeldingMethodId;
|
|
newJot.GrooveTypeId = wps.GrooveType;
|
|
newJot.PreTemperature = wps.PreTemperature;
|
|
newJot.IsHotProess = wps.IsHotProess;
|
|
newJot.MatchableWPQ = string.Join(",", wpqList.Select(x => x.WPQCode));
|
|
|
|
|
|
}
|
|
else
|
|
{
|
|
newJot.WPQId = null;
|
|
newJot.WeldJointId = jot.WeldJointId;
|
|
newJot.WeldingRod = null;
|
|
newJot.WeldingWire = null;
|
|
newJot.WeldingMethodId = null;
|
|
newJot.GrooveTypeId = null;
|
|
newJot.PreTemperature = null;
|
|
newJot.IsHotProess = null;
|
|
newJot.MatchableWPQ = null;
|
|
}
|
|
BLL.WeldJointService.UpdateConWeldJoint(newJot);
|
|
}
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
// BindGrid();
|
|
ShowNotify("该管线焊口已完成自动录入!", MessageBoxIcon.Success);
|
|
}
|
|
else
|
|
{
|
|
ShowNotify("请勾选需要自动录入的管线!", MessageBoxIcon.Warning);
|
|
}
|
|
}
|
|
|
|
protected void btnEdit_Click(object sender, EventArgs e)
|
|
{
|
|
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.HJGL_WeldJointMenuId, BLL.Const.BtnModify))
|
|
{
|
|
if (BLL.WeldTaskService.GetWeldTaskByWeldJointId(Grid1.SelectedRowID) != null) //已下任务单,不可修改数据
|
|
{
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WeldJointView.aspx?WeldJointId={0}&flag=2", Grid1.SelectedRowID, "编辑 - ")));
|
|
}
|
|
else
|
|
{
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WeldJointEdit.aspx?WeldJointId={0}&flag=2", Grid1.SelectedRowID, "编辑 - ")));
|
|
}
|
|
}
|
|
else
|
|
{
|
|
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// 焊口信息编辑
|
|
/// </summary>
|
|
/// <param name="sender"></param>
|
|
/// <param name="e"></param>
|
|
protected void btnMenuEdit_Click(object sender, EventArgs e)
|
|
{
|
|
if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.PersonId, BLL.Const.HJGL_WeldJointMenuId, BLL.Const.BtnModify))
|
|
{
|
|
if (Grid1.SelectedRowIndexArray.Length == 0)
|
|
{
|
|
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
//if (BLL.WeldTaskService.GetWeldTaskByWeldJointId(Grid1.SelectedRowID) != null) //已下任务单,不可修改数据
|
|
//{
|
|
// Alert.ShowInTop("该焊口已生成焊接任务单,不能编辑!", MessageBoxIcon.Warning);
|
|
// return;
|
|
//}
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WeldJointEdit.aspx?WeldJointId={0}&flag=2", Grid1.SelectedRowID, "维护 - ")));
|
|
}
|
|
else
|
|
{
|
|
ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning);
|
|
}
|
|
}
|
|
|
|
protected void btnView_Click(object sender, EventArgs e)
|
|
{
|
|
if (Grid1.SelectedRowIndexArray.Length == 0)
|
|
{
|
|
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
|
|
return;
|
|
}
|
|
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("WeldJointView.aspx?WeldJointId={0}&flag=2", Grid1.SelectedRowID, "维护 - ")));
|
|
}
|
|
|
|
#endregion
|
|
|
|
protected void Window1_Close(object sender, WindowCloseEventArgs e)
|
|
{
|
|
this.BindGrid();
|
|
}
|
|
|
|
}
|
|
} |