试压包导入

This commit is contained in:
jackchenyang
2024-05-24 21:27:14 +08:00
parent abfad3c2af
commit 3d974eead4
16 changed files with 1034 additions and 929 deletions
@@ -0,0 +1,37 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ImportError.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.TestPackageManage.ImportError" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>试压包导入错误日志</title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Grid1" runat="server" />
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="试压包导入错误日志" runat="server" EnableCollapse="false"
DataKeyNames="ID" EnableCheckBoxSelect="true" EnableMultiSelect="true" PageSize="100" AllowPaging="true" >
<Columns>
<f:RowNumberField />
<f:RenderField ColumnID="batchNo" Width="160px" DataField="BatchNo" HeaderText="批次号" />
<f:RenderField ColumnID="TestPackageNo" MinWidth="80" DataField="TestPackageNo" HeaderText="试压包编号" />
<f:RenderField ColumnID="UnitCode" MinWidth="80" DataField="UnitCode" HeaderText="单位代码" />
<f:RenderField ColumnID="InstallCode" MinWidth="80" DataField="InstallCode" HeaderText="装置编号" />
<f:RenderField ColumnID="AreaCode" MinWidth="80" DataField="AreaCode" HeaderText="区域" />
<f:RenderField ColumnID="PiplineCode" MinWidth="160" DataField="PiplineCode" HeaderText="管线号" />
<f:RenderField ColumnID="IsAll" MinWidth="80" DataField="IsAll" HeaderText="是否全部焊口" />
<f:RenderField ColumnID="JointCode" MinWidth="200" DataField="JointCode" HeaderText="焊口编号" />
<f:TemplateField MinWidth="200" HeaderText="错误原因" >
<ItemTemplate>
<asp:Label ID="lablRemark" runat="server" Text='<%#Eval("Remark") %>' ForeColor="Red"></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:RenderField ColumnID="CreatedTime" MinWidth="150" DataField="CreatedTime" HeaderText="导入时间" />
</Columns>
</f:Grid>
</form>
</body>
</html>
@@ -0,0 +1,29 @@
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.WeldingProcess.TestPackageManage
{
public partial class ImportError : PageBase
{
string batchNo = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
this.batchNo = Request.Params["batchNo"];
if (!IsPostBack)
{
BindGrid();
}
}
void BindGrid()
{
var list=Funs.DB.PTP_TestPackage_ImportErrorLog.Where(t=>t.BatchNo == batchNo).OrderBy(t=>t.TestPackageNo).ToList();
this.Grid1.DataSource = list;
this.Grid1.DataBind();
}
}
}
@@ -0,0 +1,53 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TestPackageManage
{
public partial class ImportError
{
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// lablRemark 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lablRemark;
}
}
@@ -217,6 +217,10 @@
Target="Self" EnableResize="true" runat="server" IsModal="true" Width="1024px"
Height="620px">
</f:Window>
<f:Window ID="Window4" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Self" EnableResize="true" runat="server" IsModal="true" Width="1024px"
Height="620px">
</f:Window>
</form>
<script type="text/javascript">
// 返回false,来阻止浏览器右键菜单
@@ -7,6 +7,8 @@ using System.IO;
using System.Web;
using BLL;
using Newtonsoft.Json.Linq;
using Model;
using NPOI.HSSF.EventUserModel;
namespace FineUIPro.Web.WeldingProcess.TestPackageManage
{
@@ -49,10 +51,10 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
this.PTP_ID = string.Empty;
this.txtSearchDate.Text = string.Format("{0:yyyy-MM}", System.DateTime.Now);
this.txtSearchDate.Text = string.Format("{0:yyyy-MM}", System.DateTime.Now);
this.InitTreeMenu();//加载树
}
}
@@ -64,7 +66,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
/// </summary>
private void InitTreeMenu()
{
this.tvControlItem.Nodes.Clear();
this.tvControlItem.Nodes.Clear();
TreeNode rootNode = new TreeNode();
rootNode.Text = "单位-装置-月份";
rootNode.NodeID = "0";
@@ -89,7 +91,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
List<Model.PTP_TestPackage> testPackageLists = (from x in Funs.DB.PTP_TestPackage
where x.ProjectId == this.CurrUser.LoginProjectId && x.TableDate >= startTime && x.TableDate < endTime
select x).ToList();
select x).ToList();
if (units != null)
{
foreach (var unit in units)
@@ -126,8 +128,10 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
select x.InstallationId).Distinct();
if (installId.Count() > 0)
{
var install = from x in Funs.DB.Project_Installation
where installId.Contains(x.InstallationId) orderby x.InstallationCode select x;
var install = from x in Funs.DB.Project_Installation
where installId.Contains(x.InstallationId)
orderby x.InstallationCode
select x;
foreach (var q in install)
{
TreeNode newNode = new TreeNode();
@@ -142,7 +146,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
}
else if (node.ToolTip == "装置")
{
string installationId = Funs.GetStrListByStr(node.NodeID, '|')[0];
string installationId = Funs.GetStrListByStr(node.NodeID, '|')[0];
var pointListMonth = (from x in testPackageUnitList
where x.InstallationId == installationId
select string.Format("{0:yyyy-MM}", x.TableDate)).Distinct();
@@ -177,10 +181,10 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
{
DateTime startTime = Convert.ToDateTime(this.txtSearchDate.Text.Trim() + "-01");
DateTime endTime = startTime.AddMonths(1);
string installationId = Funs.GetStrListByStr(node.ParentNode.NodeID, '|')[0];
string installationId = Funs.GetStrListByStr(node.ParentNode.NodeID, '|')[0];
var dReports = from x in testPackageUnitList
where x.InstallationId == installationId
&& x.TableDate>= startTime && x.TableDate< endTime
&& x.TableDate >= startTime && x.TableDate < endTime
orderby x.TestPackageNo descending
select x;
foreach (var item in dReports)
@@ -516,7 +520,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.TestPackageManageEditMenuId, Const.BtnDelete, this.PTP_ID);
Alert.ShowInTop("删除成功!", MessageBoxIcon.Success);
this.InitTreeMenu();
this.BindGrid();
this.BindGrid();
}
else
{
@@ -545,7 +549,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
this.InitTreeMenu();
this.hdPTP_ID.Text = string.Empty;
}
/// <summary>
/// 查询
/// </summary>
@@ -651,7 +655,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
}
}
var qq = from x in Funs.DB.View_CheckResultSummary where x.PTP_ID==this.PTP_ID select x;
var qq = from x in Funs.DB.View_CheckResultSummary where x.PTP_ID == this.PTP_ID select x;
// 合格
var rt = qq.Where(x => x.DetectionTypeCode == "RT" && x.CheckResult == "合格");
@@ -661,7 +665,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
bRt = rt.Count().ToString() + "/" + rt.Sum(x => x.TotalFilm).ToString();
}
var jpt = qq.Where(x => x.DetectionTypeCode == "PT" && x.CheckResult == "合格" && x.WeldType=="2");
var jpt = qq.Where(x => x.DetectionTypeCode == "PT" && x.CheckResult == "合格" && x.WeldType == "2");
string ptj = "/";
if (jpt.Count() > 0)
{
@@ -719,7 +723,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
if (drpPrintTypeList.SelectedValue == "3")
{
Window2.Title = "管道无损检测比例统计表";
varValue = varValue + "|" + "试压包号:"+pip.TestPackageNo.Trim();
varValue = varValue + "|" + "试压包号:" + pip.TestPackageNo.Trim();
if (!string.IsNullOrEmpty(unitName))
{
varValue = varValue + "|" + unitName;
@@ -812,153 +816,58 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
if (ds.Tables.Count > 0)
{
var units = from x in Funs.DB.Base_Unit
join y in Funs.DB.Project_Unit on x.UnitId equals y.UnitId
where y.ProjectId == this.CurrUser.LoginProjectId
select x;//单位
List<Model.PTP_TestPackage> testPackageList = new List<Model.PTP_TestPackage>();
List<Model.PTP_PipelineList> pipelineList = new List<Model.PTP_PipelineList>();
DataTable dt = ds.Tables[0];
for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
//定义错误集合实体类
var data = ValidateFieldsExcelData(ds.Tables[0]);
Funs.DB.PTP_TestPackage_ImportErrorLog.InsertAllOnSubmit(data.Item2);
Funs.DB.SubmitChanges();
//验证错误集合
if (data.Item1)
{
var isExitTestPage = from x in Funs.DB.PTP_TestPackage
join y in Funs.DB.Project_Installation on x.InstallationId equals y.InstallationId
join z in Funs.DB.Base_Unit on x.UnitId equals z.UnitId
where x.ProjectId == this.CurrUser.LoginProjectId
&& x.TestPackageNo == ds.Tables[0].Rows[i]["试压包编号"].ToString()
&& y.InstallationCode == ds.Tables[0].Rows[i]["装置编号"].ToString()
&& z.UnitCode == ds.Tables[0].Rows[i]["单位代码"].ToString()
select x;
string error = string.Empty;
#region
if (isExitTestPage.Count() == 0)
{
Model.PTP_PipelineList pipeline = new Model.PTP_PipelineList();
string ptpId = string.Empty;
string installationId = string.Empty;
if (ds.Tables[0].Rows[i]["装置编号"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["装置编号"].ToString()))
{
var ins = Funs.DB.Project_Installation.FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId && x.InstallationCode == ds.Tables[0].Rows[i]["装置编号"].ToString());
if (ins == null)
{
error += "装置编号不存在!";
}
else
{
installationId = ins.InstallationId; ;
}
}
else
{
error += "区域编号不能为空!";
}
string unitId = string.Empty;
if (ds.Tables[0].Rows[i]["单位代码"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["单位代码"].ToString()))
{
var unit = units.FirstOrDefault(x => x.UnitCode == ds.Tables[0].Rows[i]["单位代码"].ToString());
if (unit == null)
{
error += "单位代码不存在!";
}
else
{
unitId = unit.UnitId;
}
}
else
{
error += "单位代码不能为空!";
}
string pipelineId = string.Empty;
if (ds.Tables[0].Rows[i]["管线号"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["管线号"].ToString()))
{
var isExitPipeline = Funs.DB.Pipeline_Pipeline.FirstOrDefault(x => x.ProjectId == this.CurrUser.LoginProjectId
&& x.UnitId == unitId
&& x.InstallationId == installationId
&& x.PipelineCode == ds.Tables[0].Rows[i]["管线号"].ToString());
if (isExitPipeline != null)
{
pipeline.PipelineId = isExitPipeline.PipelineId;
}
else
{
error += "管线号不存在!";
}
}
else
{
error += "管线号不能为空!";
}
if (ds.Tables[0].Rows[i]["试压包编号"] != null && !string.IsNullOrEmpty(ds.Tables[0].Rows[i]["试压包编号"].ToString()))
{
var cc = from x in testPackageList where x.TestPackageNo == ds.Tables[0].Rows[i]["试压包编号"].ToString() select x;
if (cc.Count() == 0)
{
Model.PTP_TestPackage package = new Model.PTP_TestPackage();
ptpId = Funs.GetNewID();
package.PTP_ID = ptpId;
package.ProjectId = CurrUser.LoginProjectId;
package.UnitId = unitId;
package.InstallationId = installationId;
package.TestPackageNo = ds.Tables[0].Rows[i]["试压包编号"].ToString();
package.TableDate = DateTime.Now;
package.Tabler = this.CurrUser.UserId;
testPackageList.Add(package);
pipeline.PT_PipeId = Funs.GetNewID();
pipeline.PTP_ID = ptpId;
}
else
{
pipeline.PT_PipeId = Funs.GetNewID();
pipeline.PTP_ID = cc.First().PTP_ID;
}
}
else
{
error += "试压包编号不能为空!";
}
if (!string.IsNullOrEmpty(error))
{
errorInfos += "第" + (i + 2) + "行:" + error + " </br>";
}
pipelineList.Add(pipeline);
}
#endregion
}
// 数据验证错误,返回
if (!string.IsNullOrEmpty(errorInfos))
{
ShowNotify(errorInfos, MessageBoxIcon.Warning, 30000);
string batchNo = data.Item2.Select(t => t.BatchNo).Distinct().First();
PageContext.RegisterStartupScript(Window4.GetShowReference(String.Format("ImportError.aspx?batchNo={0}", batchNo),"试压包导入错误日志"));
return;
}
else
//导入数据
List<PTP_TestPackage> listPtpPackgeData = new List<PTP_TestPackage>();
List<Model.PTP_PipelineList> listDetailData = new List<PTP_PipelineList>();
foreach (var item in data.Item2)
{
// 不更新,新数据插入
if (testPackageList.Count > 0 && pipelineList.Count() > 0)
if (!listPtpPackgeData.Any(t => t.TestPackageNo == item.TestPackageNo))
{
Funs.DB.PTP_TestPackage.InsertAllOnSubmit(testPackageList);
Funs.DB.PTP_PipelineList.InsertAllOnSubmit(pipelineList);
Funs.DB.SubmitChanges();
List<PTP_PipelineList> ptpItemListData = new List<PTP_PipelineList>();
Model.PTP_TestPackage model = new PTP_TestPackage();
model.PTP_ID = SQLHelper.GetNewID(typeof(PTP_TestPackage));
model.TestPackageNo = item.TestPackageNo;
model.UnitId = item.UnitId;
model.ProjectId = item.ProjectId;
model.InstallationId = item.InstallId;
model.TableDate = DateTime.Now;
model.Tabler = this.CurrUser.UserId;
listPtpPackgeData.Add(model);
var itemData=data.Item2.Where(t=>t.TestPackageNo==item.TestPackageNo).ToList();
foreach (var item2 in itemData)
{
var model2=new PTP_PipelineList();
model2.PTP_ID = model.PTP_ID;
model2.PipelineId = item2.PipelineId;
model2.WorkAreaId = item2.WorkAreaId;
model2.WeldJonintCode = item2.JointCode;
model2.PT_PipeId = SQLHelper.GetNewID(typeof(PTP_PipelineList));
model2.IsAll= item2.IsAll == "是" ? true : false;
listDetailData.Add(model2);
}
}
ShowNotify("试压包信息导入成功!", MessageBoxIcon.Success);
this.BindGrid();
}
}
Funs.DB.PTP_TestPackage.InsertAllOnSubmit(listPtpPackgeData);
Funs.DB.PTP_PipelineList.InsertAllOnSubmit(listDetailData);
//绑定表格
Funs.DB.SubmitChanges();
this.BindGrid();
ShowNotify("导入成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(this.PTP_ID)+ ActiveWindow.GetHidePostBackReference());
}
else
{
ShowAlert("没有数据!", MessageBoxIcon.Warning);
@@ -972,5 +881,180 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
}
}
/// <summary>
/// 验证Excle中的数据列是否符合要求
/// </summary>
private (bool, List<PTP_TestPackage_ImportErrorLog>) ValidateFieldsExcelData(DataTable dt)
{
var listData = new List<PTP_TestPackage_ImportErrorLog>();
bool flag = false;
int k = 0;
string batchNo = DateTime.Now.ToString("yyyyMMddHHmmss");
foreach (DataRow dr in dt.Rows)
{
var model = new PTP_TestPackage_ImportErrorLog();
k++;
string testpackNo = dr[0].ToString(); //试压包编号
string untiCode = dr[1].ToString(); //单位编号
string installCode = dr[2].ToString(); //装置编号
string areaCode = dr[3].ToString(); //区域编号
string pipelineCode = dr[4].ToString(); //管线编号
string isALL = dr[5].ToString(); //是否全部焊口
string jointCode = dr[6].ToString(); //焊口列表逗号
model.Id = SQLHelper.GetNewID(typeof(PTP_TestPackage_ImportErrorLog));
model.TestPackageNo = testpackNo;
model.UnitCode = untiCode;
model.InstallCode = installCode;
model.AreaCode = areaCode;
model.PiplineCode = pipelineCode;
model.IsAll = isALL;
model.JointCode = jointCode;
model.CreatedTime = DateTime.Now;
model.RowId = k;
model.BatchNo = batchNo;
string errorMsg = string.Empty;
//验证是否为空
if (string.IsNullOrEmpty(model.TestPackageNo))
{
errorMsg += "试压包编号未填写 |";
}
if (string.IsNullOrEmpty(model.UnitCode))
{
errorMsg += "试单位编号未填写 | ";
}
if (string.IsNullOrEmpty(installCode))
{
errorMsg += "装置编号未填写 | ";
}
if (string.IsNullOrEmpty(areaCode))
{
errorMsg += "区域编号未填写 | ";
}
if (string.IsNullOrEmpty(pipelineCode))
{
errorMsg += "管线号未填写 | ";
}
if (string.IsNullOrEmpty(isALL))
{
errorMsg += "是否全部焊口未填写 | ";
}
//检查单位编号是否存在
var unitInfo = Funs.DB.Base_Unit.FirstOrDefault(t => t.UnitCode == model.UnitCode);
if (unitInfo == null)
{
errorMsg += "未知的单位编号 | ";
}
var installInfo = Funs.DB.Project_Installation.FirstOrDefault(t => t.InstallationCode == model.InstallCode);
if (installInfo == null)
{
errorMsg += "未知的装置编号 | ";
}
var areaInfo = Funs.DB.Project_WorkArea.FirstOrDefault(t => t.WorkAreaCode == model.AreaCode);
if (areaInfo == null)
{
errorMsg += "未知的区域编号 | ";
}
var isAnypipeline = Funs.DB.Pipeline_Pipeline.Any(t => t.PipelineCode == model.PiplineCode);
if (!isAnypipeline)
{
errorMsg += "未知的管线号 | ";
}
if (isALL != "是" && isALL != "否")
{
errorMsg += "是否部分焊口值不正确,只能为是或否 | ";
}
if (isALL == "否" && string.IsNullOrEmpty(model.JointCode))
{
errorMsg += "部分焊口请填写焊口编号 | ";
}
var isPackNoAny = Funs.DB.PTP_TestPackage.Any(t => t.TestPackageCode == model.TestPackageNo);
if (isPackNoAny)
{
errorMsg += "该试压包编号已存在 | ";
}
if (unitInfo != null && installInfo != null && areaInfo != null )
{
model.ProjectId=this.CurrUser.LoginProjectId;
model.UnitId = unitInfo.UnitId;
model.WorkAreaId = areaInfo.WorkAreaId;
model.InstallId = installInfo.InstallationId;
var newPipelineInfo = Funs.DB.Pipeline_Pipeline.FirstOrDefault(t => t.UnitId == unitInfo.UnitId &&
t.InstallationId == installInfo.InstallationId && t.WorkAreaId == areaInfo.WorkAreaId &&
t.PipelineCode==model.PiplineCode);
if (newPipelineInfo != null)
{
model.PipelineId =newPipelineInfo.PipelineId;
var ptpDetailList = Funs.DB.PTP_PipelineList
.Where(t => t.PipelineId == newPipelineInfo.PipelineId);
//查询当前的管线是否被使用了
if (isALL == "是")
{
var isAnyPipeline = ptpDetailList.Where(t => t.IsAll == true).Any();
if (isAnyPipeline)
{
errorMsg += "该管线已被使用 | ";
}
var isExcelPipline= listData.Where(t=>t.PipelineId== newPipelineInfo.PipelineId).Any();
if (isExcelPipline)
{
errorMsg += "该管线已被使用 | ";
}
}
//查询当前的焊口是否被使用了
if (isALL == "否")
{
var dict = GetJointCodeDic(newPipelineInfo.PipelineId);
string[] modelCodes = model.JointCode.Split(',');
for (int i = 0; i < modelCodes.Length; i++)
{
if (dict.ContainsKey(modelCodes[i]))
{
errorMsg += $"焊口【{modelCodes[i]}】已被使用 | ";
}
}
int baseCount = BLL.TestPackageManageEditService.countBaseWeldJointCode(newPipelineInfo.PipelineId);
if (dict.Count == baseCount)
{
errorMsg += $"当前管线【{newPipelineInfo.PipelineId}】已被使用 | ";
}
}
}
model.Remark = errorMsg;
}
if(!string.IsNullOrEmpty(model.Remark))
flag = true;
listData.Add(model);
}
return (flag, listData);
}
private Dictionary<string, int> GetJointCodeDic(string piplineId)
{
var dict = new Dictionary<string, int>();
var dataList = Funs.DB.PTP_PipelineList.Where(t => t.PipelineId == piplineId && t.IsAll == false)
.Select(t => t.WeldJonintCode).ToList();
int k = 0;
foreach (var item in dataList)
{
k++;
if (!string.IsNullOrEmpty(item))
{
string[] arr = item.Split(',');
for (int i = 0; i < arr.Length; i++)
{
if (!dict.ContainsKey(arr[i]))
{
dict.Add(arr[i], k);
}
}
}
}
return dict;
}
}
}
@@ -7,11 +7,13 @@
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
public partial class TestPackageManageEdit {
namespace FineUIPro.Web.WeldingProcess.TestPackageManage
{
public partial class TestPackageManageEdit
{
/// <summary>
/// Head1 控件。
/// </summary>
@@ -20,7 +22,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlHead Head1;
/// <summary>
/// form1 控件。
/// </summary>
@@ -29,7 +31,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
@@ -38,7 +40,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
@@ -47,7 +49,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelLeftRegion 控件。
/// </summary>
@@ -56,7 +58,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// Toolbar1 控件。
/// </summary>
@@ -65,7 +67,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// txtSearchDate 控件。
/// </summary>
@@ -74,7 +76,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtSearchDate;
/// <summary>
/// tvControlItem 控件。
/// </summary>
@@ -83,7 +85,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tree tvControlItem;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
@@ -92,7 +94,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Toolbar2 控件。
/// </summary>
@@ -101,7 +103,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// hidFileName 控件。
/// </summary>
@@ -110,7 +112,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hidFileName;
/// <summary>
/// hdPTP_ID 控件。
/// </summary>
@@ -119,7 +121,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdPTP_ID;
/// <summary>
/// fileUpload 控件。
/// </summary>
@@ -128,7 +130,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FileUpload fileUpload;
/// <summary>
/// btnImport 控件。
/// </summary>
@@ -137,7 +139,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// btnDownLoad 控件。
/// </summary>
@@ -146,7 +148,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDownLoad;
/// <summary>
/// btnNew 控件。
/// </summary>
@@ -155,7 +157,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnNew;
/// <summary>
/// btnEdit 控件。
/// </summary>
@@ -164,7 +166,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnEdit;
/// <summary>
/// btnDelete 控件。
/// </summary>
@@ -173,7 +175,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
@@ -182,7 +184,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// drpPrintTypeList 控件。
/// </summary>
@@ -191,7 +193,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpPrintTypeList;
/// <summary>
/// btnPrint 控件。
/// </summary>
@@ -200,7 +202,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
@@ -209,7 +211,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtTestPackageNo 控件。
/// </summary>
@@ -218,7 +220,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTestPackageNo;
/// <summary>
/// drpInstallation 控件。
/// </summary>
@@ -227,7 +229,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label drpInstallation;
/// <summary>
/// txtTestPackageName 控件。
/// </summary>
@@ -236,7 +238,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTestPackageName;
/// <summary>
/// drpTestType 控件。
/// </summary>
@@ -245,7 +247,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label drpTestType;
/// <summary>
/// txtTestService 控件。
/// </summary>
@@ -254,7 +256,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTestService;
/// <summary>
/// txtTestHeat 控件。
/// </summary>
@@ -263,7 +265,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTestHeat;
/// <summary>
/// txtTestAmbientTemp 控件。
/// </summary>
@@ -272,7 +274,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTestAmbientTemp;
/// <summary>
/// txtTestMediumTemp 控件。
/// </summary>
@@ -281,7 +283,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTestMediumTemp;
/// <summary>
/// txtVacuumTestService 控件。
/// </summary>
@@ -290,7 +292,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtVacuumTestService;
/// <summary>
/// txtVacuumTestPressure 控件。
/// </summary>
@@ -299,7 +301,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtVacuumTestPressure;
/// <summary>
/// txtTightnessTestTime 控件。
/// </summary>
@@ -308,7 +310,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTightnessTestTime;
/// <summary>
/// txtTightnessTestTemp 控件。
/// </summary>
@@ -317,7 +319,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTightnessTestTemp;
/// <summary>
/// txtTightnessTest 控件。
/// </summary>
@@ -326,7 +328,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTightnessTest;
/// <summary>
/// txtTestPressure 控件。
/// </summary>
@@ -335,7 +337,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTestPressure;
/// <summary>
/// txtTestPressureTemp 控件。
/// </summary>
@@ -344,7 +346,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTestPressureTemp;
/// <summary>
/// txtTestPressureTime 控件。
/// </summary>
@@ -353,7 +355,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTestPressureTime;
/// <summary>
/// txtOperationMedium 控件。
/// </summary>
@@ -362,7 +364,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtOperationMedium;
/// <summary>
/// txtPurgingMedium 控件。
/// </summary>
@@ -371,7 +373,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtPurgingMedium;
/// <summary>
/// txtCleaningMedium 控件。
/// </summary>
@@ -380,7 +382,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtCleaningMedium;
/// <summary>
/// txtLeakageTestService 控件。
/// </summary>
@@ -389,7 +391,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtLeakageTestService;
/// <summary>
/// txtLeakageTestPressure 控件。
/// </summary>
@@ -398,7 +400,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtLeakageTestPressure;
/// <summary>
/// txtAllowSeepage 控件。
/// </summary>
@@ -407,7 +409,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtAllowSeepage;
/// <summary>
/// txtFactSeepage 控件。
/// </summary>
@@ -416,7 +418,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtFactSeepage;
/// <summary>
/// drpModifier 控件。
/// </summary>
@@ -425,7 +427,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label drpModifier;
/// <summary>
/// txtModifyDate 控件。
/// </summary>
@@ -434,7 +436,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtModifyDate;
/// <summary>
/// drpTabler 控件。
/// </summary>
@@ -443,7 +445,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label drpTabler;
/// <summary>
/// txtTableDate 控件。
/// </summary>
@@ -452,7 +454,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTableDate;
/// <summary>
/// txtRemark 控件。
/// </summary>
@@ -461,7 +463,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtRemark;
/// <summary>
/// drpAuditer 控件。
/// </summary>
@@ -470,7 +472,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label drpAuditer;
/// <summary>
/// txtAduditDate 控件。
/// </summary>
@@ -479,7 +481,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtAduditDate;
/// <summary>
/// Grid1 控件。
/// </summary>
@@ -488,7 +490,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
@@ -497,7 +499,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
@@ -506,7 +508,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
@@ -515,7 +517,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
@@ -524,7 +526,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
@@ -533,7 +535,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Window3 控件。
/// </summary>
@@ -542,5 +544,14 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage {
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window3;
/// <summary>
/// Window4 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window4;
}
}
@@ -324,8 +324,8 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
{
string pipelineId = dr["PipelineId"].ToString();
string joinCodeList = dr["WeldJointCode"].ToString();
int count = countWeldJointCode(pipelineId);
int baseCount = countBaseWeldJointCode(pipelineId);
int count =BLL.TestPackageManageEditService.countWeldJointCode(pipelineId);
int baseCount = BLL.TestPackageManageEditService.countBaseWeldJointCode(pipelineId);
if (count == baseCount)
{
dr.Delete();
@@ -341,32 +341,7 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
Grid1.DataBind();
}
private int countBaseWeldJointCode(string pipelineId)
{
string sql = "select count(1) from Pipeline_WeldJoint where PipelineId=@PipelineId";
SqlParameter[] parameters = new SqlParameter[] {
new SqlParameter("@PipelineId",pipelineId)
};
int count = SQLHelper.getIntValue(sql, parameters);
return count;
}
private int countWeldJointCode(string pipelineId)
{
string sql = @"select WeldJointCode=(stuff((select ','+ WeldJonintCode from PTP_PipelineList where PipelineId=@PipelineId and isALL=0 for xml path('')),1,1,''))";
SqlParameter[] parameters = new SqlParameter[] {
new SqlParameter("@PipelineId",pipelineId)
};
string strCode = SQLHelper.GetStr(sql, parameters);
if(!string.IsNullOrEmpty(strCode) )
{
string[] arr=strCode.Split(',');
return arr==null?0:arr.Length;
}
else
{
return 0;
}
}
/// <summary>
/// 对GV 赋值
/// </summary>