initproject

This commit is contained in:
2024-05-08 10:02:08 +08:00
commit 98f03b1780
3859 changed files with 348243 additions and 0 deletions
@@ -0,0 +1,149 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NDECheckWarn.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.TrustManage.NDECheckWarn" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>委托单查询</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<style type="text/css">
.f-grid-row.color1,
.f-grid-row.color1 .f-icon,
.f-grid-row.color1 a {
background-color: red;
color: #fff;
}
.f-grid-row.color2,
.f-grid-row.color2 .f-icon,
.f-grid-row.color2 a {
background-color: yellow;
color: #000;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,NDTTestRequest %>"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="TrustBatchItemId"
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2"
DataIDField="TrustBatchItemId" AllowSorting="true" SortField="TrustDate"
SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="25" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True"
OnRowDataBound="Grid1_RowDataBound">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:RadioButtonList ID="rbWarn" runat="server" Width="200px">
<f:RadioItem Text="全部" Value="0" Selected="true" />
<f:RadioItem Text="预警" Value="1" />
<f:RadioItem Text="报警" Value="2" />
</f:RadioButtonList>
<f:DropDownList ID="drpInstallation" runat="server" Label="<%$ Resources:Lan,InstallationCode %>"
LabelAlign="Right" EnableEdit="true" Width="220" LabelWidth="90px">
</f:DropDownList>
<f:TextBox ID="txtTrustBatchCode" runat="server" Label="<%$ Resources:Lan,RequestSheetNumber %>"
LabelAlign="Right" Width="240px" LabelWidth="90">
</f:TextBox>
<f:DatePicker runat="server" ID="txtTrustDate" LabelAlign="Right" LabelWidth="90px"
Label="<%$ Resources:Lan,TrustDate %>" Width="200px">
</f:DatePicker>
<f:TextBox ID="txtPipeLineCode" runat="server" Label="管线号"
LabelAlign="Right" Width="240px" LabelWidth="90">
</f:TextBox>
<f:TextBox ID="txtWeldJointCode" runat="server" Label="焊口号"
LabelAlign="Right" Width="150px" LabelWidth="80">
</f:TextBox>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="BtnAnalyse" Text="<%$ Resources:Lan,Statistics %>" Icon="ChartPie"
runat="server" OnClick="BtnAnalyse_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="<%$ Resources:Lan,Export %>"
Icon="TableGo" EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField Width="220px" ColumnID="TrustBatchCode" DataField="TrustBatchCode" FieldType="String"
HeaderText="<%$ Resources:Lan,RequestSheetNumber %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="TrustBatchCode">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="InstallationCode" DataField="InstallationCode" FieldType="String"
HeaderText="<%$ Resources:Lan,InstallationCode %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="InstallationCode">
</f:RenderField>
<f:RenderField Width="220px" ColumnID="PipelineCode" DataField="PipelineCode" FieldType="String"
HeaderText="<%$ Resources:Lan,PipelineCode %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="PipelineCode">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="WeldJointCode" DataField="WeldJointCode" FieldType="String"
HeaderText="<%$ Resources:Lan,WeldingJointNumber %>" HeaderTextAlign="Center"
TextAlign="Left" SortField="WeldJointCode">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="JointArea" DataField="JointArea" FieldType="String"
HeaderText="<%$ Resources:Lan,WeldingArea %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="JointArea">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="MaterialCode" DataField="MaterialCode" FieldType="String"
HeaderText="<%$ Resources:Lan,MaterialSpecification %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="MaterialCode">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Size" DataField="Size" FieldType="Double"
HeaderText="<%$ Resources:Lan,InchDiameter %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="Size">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="Thickness" DataField="Thickness" FieldType="Double"
HeaderText="<%$ Resources:Lan,WallThickness %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="Thickness">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="WeldTypeCode" DataField="WeldTypeCode" FieldType="String"
HeaderText="<%$ Resources:Lan,WeldingJointType %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="WeldTypeCode">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="WelderCode" DataField="WelderCode" FieldType="String"
HeaderText="<%$ Resources:Lan,WelderCode %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="WelderCode">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="WeldingMethodCode" DataField="WeldingMethodCode"
HeaderText="<%$ Resources:Lan,WeldingMethod %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="WeldingMethodCode" FieldType="String">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="DetectionRateCode" DataField="DetectionRateCode"
HeaderText="<%$ Resources:Lan,TestPercentage %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="DetectionRateCode" FieldType="String">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="AcceptLevel" DataField="AcceptLevel" FieldType="String" HeaderText="合格等级"
HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="TrustDate" DataField="TrustDate"
HeaderText="<%$ Resources:Lan,TrustDate %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="TrustDate" FieldType="String">
</f:RenderField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="<%$ Resources:Lan,NumberOfRecordsPerPage %>">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="30" Value="30" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="<%$ Resources:Lan,AllLines %>" Value="10000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>
@@ -0,0 +1,226 @@
using System;
using System.Collections.Generic;
using AspNet = System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using NPOI.HSSF.Util;
using NPOI.SS.UserModel;
using NPOI.SS.Util;
using NPOI.XSSF.UserModel;
using System.Linq;
using System.IO;
using BLL;
using System.Text;
namespace FineUIPro.Web.WeldingProcess.TrustManage
{
public partial class NDECheckWarn : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
BLL.Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, true, this.CurrUser.LoginProjectId, Resources.Lan.PleaseSelect);
}
}
private void BindGrid()
{
string strSql = @"SELECT BatchTrustItem.TrustBatchItemId, BatchTrust.TrustType,BatchTrust.TrustBatchCode,
BatchTrust.ProjectId, CONVERT(varchar(10),BatchTrust.TrustDate,120) AS TrustDate,
BatchTrust.InstallationId,ins.InstallationCode,pipe.PipelineCode,
(CASE WHEN PointBatchItem.PointState='2' then (CASE WHEN jot.JointAttribute='固定F' AND RIGHT(jot.WeldJointCode,1)<>'G' THEN jot.WeldJointCode+'G' ELSE jot.WeldJointCode END)+'K'
ELSE (CASE WHEN jot.JointAttribute='固定F' AND RIGHT(jot.WeldJointCode,1)<>'G' THEN jot.WeldJointCode+'G' ELSE jot.WeldJointCode END) END) AS WeldJointCode,
mat.MaterialCode,jot.JointArea,welder.WelderCode AS WelderCode,weldType.WeldTypeCode,
convert(float,jot.Dia) AS Dia,convert(float,jot.Size) AS Size,convert(float,jot.Thickness) AS Thickness,
method.WeldingMethodCode, jot.Specification,cast(rate.DetectionRateValue as varchar(10))+'%' AS DetectionRateCode,
PointBatchItem.PointDate,(CASE WHEN dtype.SysType !='射线检测' THEN 'Ⅰ' ELSE PointBatchItem.AcceptLevel END) AS AcceptLevel
FROM Batch_BatchTrustItem AS BatchTrustItem
LEFT JOIN dbo.Batch_BatchTrust AS BatchTrust ON BatchTrust.TrustBatchId=BatchTrustItem.TrustBatchId
LEFT JOIN dbo.Base_DetectionType dtype ON dtype.DetectionTypeId = BatchTrust.DetectionTypeId
LEFT JOIN Batch_PointBatchItem AS PointBatchItem ON PointBatchItem.PointBatchItemId=BatchTrustItem.PointBatchItemId
LEFT JOIN dbo.Batch_PointBatch point ON point.PointBatchId = PointBatchItem.PointBatchId
LEFT JOIN dbo.Base_DetectionRate rate ON rate.DetectionRateId = point.DetectionRateId
LEFT JOIN dbo.Pipeline_WeldJoint jot ON jot.WeldJointId = BatchTrustItem.WeldJointId
LEFT JOIN dbo.Pipeline_Pipeline pipe ON pipe.PipelineId = jot.PipelineId
LEFT JOIN dbo.Project_Installation ins ON ins.InstallationId = BatchTrust.InstallationId
LEFT JOIN dbo.Base_WeldType weldType ON weldType.WeldTypeId = jot.WeldTypeId
LEFT JOIN dbo.Welder_Welder welder ON welder.WelderId = jot.BackingWelderId
LEFT JOIN dbo.Base_Material mat ON mat.MaterialId = jot.Material1Id
LEFT JOIN dbo.Base_WeldingMethod method ON method.WeldingMethodId = jot.WeldingMethodId
LEFT JOIN dbo.Batch_NDEItem ndeItem ON ndeItem.TrustBatchItemId = BatchTrustItem.TrustBatchItemId
WHERE BatchTrust.ProjectId=@ProjectId AND ndeItem.NDEItemID IS NULL
AND (jot.IsCancel IS NULL OR jot.IsCancel=0)
AND (BatchTrustItem.IsCancelTrust is null OR BatchTrustItem.IsCancelTrust=0) ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (drpInstallation.SelectedValue != Const._Null)
{
strSql += " AND BatchTrust.InstallationId = @InstallationId";
listStr.Add(new SqlParameter("@InstallationId", drpInstallation.SelectedValue));
}
if (!string.IsNullOrEmpty(this.txtTrustBatchCode.Text))
{
strSql += " AND BatchTrust.TrustBatchCode LIKE @TrustBatchCode";
listStr.Add(new SqlParameter("@TrustBatchCode", "%" + this.txtTrustBatchCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtTrustDate.Text))
{
strSql += " AND BatchTrust.TrustDate = @TrustDate";
listStr.Add(new SqlParameter("@TrustDate", this.txtTrustDate.Text));
}
if (!string.IsNullOrEmpty(txtPipeLineCode.Text))
{
strSql += " AND pipe.PipelineCode LIKE @PipelineCode";
listStr.Add(new SqlParameter("@PipelineCode", "%" + this.txtPipeLineCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtWeldJointCode.Text))
{
strSql += " AND jot.WeldJointCode = @WeldJointCode";
listStr.Add(new SqlParameter("@WeldJointCode", this.txtWeldJointCode.Text));
}
if (rbWarn.SelectedValue != "0")
{
if (rbWarn.SelectedValue == "1")
{
strSql += " AND DateDiff (d,BatchTrust.TrustDate,GETDATE()) >=3 AND DateDiff (d,BatchTrust.TrustDate,GETDATE()) <=5 ";
}
else
{
strSql += " AND DateDiff(d, BatchTrust.TrustDate, GETDATE()) > 5 ";
}
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
this.Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
protected void Grid1_RowDataBound(object sender, GridRowEventArgs e)
{
DataRowView row = e.DataItem as DataRowView;
if (row["TrustDate"].ToString() != "")
{
DateTime trustDate = Convert.ToDateTime(row["TrustDate"]);
if (DateTime.Now.AddDays(-6).Date > trustDate.Date)
{
e.RowCssClass = "color1";
}
else if (DateTime.Now.AddDays(-4) >= trustDate.Date && DateTime.Now.AddDays(-6).Date <= trustDate.Date)
{
e.RowCssClass = "color2";
}
}
}
/// <summary>
/// 改变索引事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <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();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
this.BindGrid();
}
#region 统计按钮事件
/// <summary>
/// 统计
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region 导出
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode(Resources.Lan.RequestSheetNumber + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
private string GetGridTableHtml(Grid grid)
{
StringBuilder sb = new StringBuilder();
grid.PageSize = 1000000;
BindGrid();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
}
sb.Append("</tr>");
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
string jot = row.Values[column.ColumnIndex].ToString();
string html = string.Empty;
if (column.ColumnID == "WeldJointCode" && jot.Split('-').Length > 1)
{
html = "'" + row.Values[column.ColumnIndex].ToString();
}
else
{
html = row.Values[column.ColumnIndex].ToString();
}
if (column.ColumnID == "tfNumber")
{
html = (row.FindControl("labNumber") as AspNet.Label).Text;
}
sb.AppendFormat("<td>{0}</td>", html);
}
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}
#endregion
}
}
@@ -0,0 +1,168 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class NDECheckWarn {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// rbWarn 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.RadioButtonList rbWarn;
/// <summary>
/// drpInstallation 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpInstallation;
/// <summary>
/// txtTrustBatchCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtTrustBatchCode;
/// <summary>
/// txtTrustDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtTrustDate;
/// <summary>
/// txtPipeLineCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipeLineCode;
/// <summary>
/// txtWeldJointCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtWeldJointCode;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// BtnAnalyse 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button BtnAnalyse;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
}
}
@@ -0,0 +1,133 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NDTTrustPrint.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.TrustManage.NDTTrustPrint" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>委托单打印</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<style>
/*定义父容器*/
.content {
width: 550px;
height: 30px;
background: #E4F1FB;
margin: 0 auto;
}
/*定义进度条*/
.box {
width: 0px;
height: 30px;
line-height: 30px;
text-align: center;
background: #3BAAE3;
color: #fff;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="委托单打印"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="TrustBatchId,DetectionTypeCode"
AllowColumnLocking="true" EnableColumnLines="true"
DataIDField="TrustBatchId" AllowSorting="true" SortField="TrustDate"
SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="25" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True"
EnableCheckBoxSelect="true">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="drpInstallation" runat="server" Label="<%$ Resources:Lan,InstallationCode %>"
LabelAlign="Right" EnableEdit="true" Width="220" LabelWidth="90px" >
</f:DropDownList>
<f:DropDownList ID="drpNDEType" runat="server" Label="检测方法"
LabelAlign="Right" EnableEdit="true" Width="180" LabelWidth="90px" >
</f:DropDownList>
<f:TextBox ID="txtTrustBatchCode" runat="server" Label="<%$ Resources:Lan,RequestSheetNumber %>"
LabelAlign="Right" Width="240px" LabelWidth="90">
</f:TextBox>
<f:DatePicker runat="server" ID="txtTrustStartDate" LabelAlign="Right" LabelWidth="90px"
Label="委托时间" Width="200px" >
</f:DatePicker>
<f:DatePicker runat="server" ID="txtTrustEndDate" LabelAlign="Right" LabelWidth="40px"
Label="至" Width="150px" >
</f:DatePicker>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="BtnAnalyse" Text="<%$ Resources:Lan,Statistics %>" Icon="ChartPie"
runat="server" OnClick="BtnAnalyse_Click">
</f:Button>
<f:Button ID="btnPrint" BoxConfigAlign="Center" Icon="Printer" runat="server" Text="委托单连打" ToolTip="委托单连印" OnClick="btnPrint_Click" ></f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField Width="220px" ColumnID="TrustBatchCode" DataField="TrustBatchCode" FieldType="String"
HeaderText="<%$ Resources:Lan,RequestSheetNumber %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="TrustBatchCode">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="InstallationCode" DataField="InstallationCode" FieldType="String"
HeaderText="<%$ Resources:Lan,InstallationCode %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="InstallationCode">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="UnitCode" DataField="UnitCode" FieldType="String"
HeaderText="委托单位" HeaderTextAlign="Center" TextAlign="Left"
SortField="UnitCode">
</f:RenderField>
<f:RenderField Width="220px" ColumnID="PipelineCode" DataField="PipelineCode" FieldType="String"
HeaderText="<%$ Resources:Lan,PipelineCode %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="PipelineCode">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="DetectionTypeCode" DataField="DetectionTypeCode"
HeaderText="检测类型" HeaderTextAlign="Center" TextAlign="Left"
SortField="DetectionTypeCode" FieldType="String" >
</f:RenderField>
<f:RenderField Width="120px" ColumnID="TrustDate" DataField="TrustDate"
HeaderText="<%$ Resources:Lan,TrustDate %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="TrustDate" FieldType="Date" Renderer="Date">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="TrustIsCheck" DataField="TrustIsCheck"
HeaderText="是否已检测" HeaderTextAlign="Center" TextAlign="Left"
SortField="TrustIsCheck" FieldType="String" >
</f:RenderField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="<%$ Resources:Lan,NumberOfRecordsPerPage %>">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="30" Value="30" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="<%$ Resources:Lan,AllLines %>" Value="10000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="WindowExport" Hidden="true" runat="server" MinHeight="30px"
Target="Parent" ShowHeader="false" BodyPadding="0" Margin="0"
IsModal="true" Width="550px" Height="30px">
<Items>
<f:ContentPanel ShowBorder="false" Height="30px" ShowHeader="false" ID="ContentPanel3" runat="server">
<div class="content" id="content">
<div class="box" id="box"></div>
</div>
</f:ContentPanel>
</Items>
</f:Window>
<asp:ScriptManager ID="ScriptManager2" runat="server" EnablePageMethods="true">
<Scripts>
<asp:ScriptReference Path="~/res/ProcessBar.js" />
</Scripts>
</asp:ScriptManager>
</form>
</body>
</html>
@@ -0,0 +1,992 @@
using System;
using System.Collections.Generic;
using AspNet = System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using NPOI.HSSF.Util;
using NPOI.SS.UserModel;
using NPOI.SS.Util;
using NPOI.XSSF.UserModel;
using System.Linq;
using System.IO;
using BLL;
using System.Threading;
namespace FineUIPro.Web.WeldingProcess.TrustManage
{
public partial class NDTTrustPrint : PageBase
{
public static int percent { get; set; }
public static string url { get; set; }
[System.Web.Services.WebMethod]
public static int getPercent()
{
return percent;
}
[System.Web.Services.WebMethod]
public static string getUrl()
{
return url;
}
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
BLL.Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, true, this.CurrUser.LoginProjectId, Resources.Lan.PleaseSelect);
BLL.Base_DetectionTypeService.InitDetectionTypeDropDownList(this.drpNDEType, Resources.Lan.PleaseSelect, true, string.Empty);//探伤类型
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT TrustBatchId,TrustBatchCode,InstallationCode, PipelineCode,UnitCode,TrustDate,DetectionTypeCode,
(case when CheckTrustBatchId is null then '未检测' else '已检测' end ) as TrustIsCheck
FROM dbo.View_Batch_BatchTrust WHERE ProjectId=@ProjectId ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (drpInstallation.SelectedValue != Const._Null)
{
strSql += " AND InstallationId = @InstallationId";
listStr.Add(new SqlParameter("@InstallationId", drpInstallation.SelectedValue));
}
if (drpNDEType.SelectedValue != Const._Null)
{
strSql += " AND DetectionTypeId = @DetectionTypeId";
listStr.Add(new SqlParameter("@DetectionTypeId", drpNDEType.SelectedValue));
}
if (!string.IsNullOrEmpty(this.txtTrustBatchCode.Text))
{
strSql += " AND TrustBatchCode LIKE @TrustBatchCode";
listStr.Add(new SqlParameter("@TrustBatchCode", "%" + this.txtTrustBatchCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtTrustStartDate.Text))
{
strSql += " AND TrustDate >= @TrustStartDate";
listStr.Add(new SqlParameter("@TrustStartDate", Convert.ToDateTime(this.txtTrustStartDate.Text)));
}
if (!string.IsNullOrEmpty(this.txtTrustEndDate.Text))
{
strSql += " AND TrustDate < @TrustEndDate";
listStr.Add(new SqlParameter("@TrustEndDate", Convert.ToDateTime(this.txtTrustEndDate.Text).AddDays(1)));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
this.Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#region
/// <summary>
/// 改变索引事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <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();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
this.BindGrid();
}
#endregion
#region 统计按钮事件
/// <summary>
/// 统计
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region 检测委托单打印
/// <summary>
/// 检测委托单打印
/// </summary>
protected void btnPrint_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_NDTTrustPrintMenuId, Const.BtnPrint))
{
percent = 0;
url = "";
Thread t = new Thread(new ThreadStart(() => { Print(); }));
t.Start();
PageContext.RegisterStartupScript("showProcessBar()");
}
else
{
Alert.ShowInTop(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
}
}
private void Print()
{
if (Grid1.SelectedRowIndexArray.Length <= 0)
{
Alert.ShowInTop("最少选中一行!", MessageBoxIcon.Warning);
return;
}
string rootPath = Server.MapPath("~/") + Const.ExcelUrl;
//导出文件
string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\";
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
string ReportFileName = filePath + "无损检测委托单" + DateTime.Now.ToString("yyyyMMddhhmmss") + ".xlsx";
//string ReportFileName = filePath + "out1.xlsx";
int totalNum = Grid1.SelectedRowIDArray.Length;
int num = 1;
int rowIndex = 0;
XSSFWorkbook hssfworkbook = new XSSFWorkbook();
XSSFSheet ws = new XSSFSheet();
//for (int gi = 0; gi < Grid1.SelectedRowIDArray.Length; gi++)
foreach(string trustId in Grid1.SelectedRowIDArray)
{
var trust = BLL.Batch_BatchTrustService.GetBatchTrustViewById(trustId);
string trustBatchId = trust.TrustBatchId.ToString();
string detectionTypeCode = trust.DetectionTypeCode.ToString();
//头部
var listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@TrustBatchId", trustBatchId));
SqlParameter[] parameter = listStr.ToArray();
var tbTitle = SQLHelper.GetDataTableRunProc("sp_TrustReport", parameter);
//列表
var listTitleStr = new List<SqlParameter>();
listTitleStr.Add(new SqlParameter("@TrustBatchId", trustBatchId));
SqlParameter[] titleparameter = listTitleStr.ToArray();
var tb = SQLHelper.GetDataTableRunProc("TrustItemReport", titleparameter);
DateTime? trustDate = Funs.GetNewDateTime(tbTitle.Rows[0]["TrustDate"].ToString());
var style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10, true, false);
var styleButton = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 10, true, false);
var styleTop = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Center, 10, true, false);
var styleNone = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Center, 10, true, false);
if (detectionTypeCode.Trim() == "PMI")
{
if (hssfworkbook.GetSheet("材料及配件检测委托单") != null)
{
ws = (XSSFSheet)hssfworkbook.GetSheet("材料及配件检测委托单");
}
else
{
rowIndex = 0;
ws = (XSSFSheet)hssfworkbook.CreateSheet("材料及配件检测委托单");
#region 列宽
ws.SetColumnWidth(0, 5 * 256);
ws.SetColumnWidth(1, 7 * 256);
ws.SetColumnWidth(2, 9 * 256);
ws.SetColumnWidth(3, 5 * 256);
ws.SetColumnWidth(4, 5 * 256);
ws.SetColumnWidth(5, 5 * 256);
ws.SetColumnWidth(6, 5 * 256);
ws.SetColumnWidth(7, 6 * 256);
ws.SetColumnWidth(8, 6 * 256);
ws.SetColumnWidth(9, 9 * 256);
ws.SetColumnWidth(10, 8 * 256);
ws.SetColumnWidth(11, 8 * 256);
ws.SetColumnWidth(12, 5 * 256);
ws.SetColumnWidth(13, 9 * 256);
ws.SetColumnWidth(14, 4 * 256);
ws.SetColumnWidth(15, 4 * 256);
ws.SetColumnWidth(16, 4 * 256);
ws.SetColumnWidth(17, 5 * 256);
ws.SetColumnWidth(18, 10 * 256);
ws.SetColumnWidth(19, 8 * 256);
ws.SetColumnWidth(20, 8 * 256);
#endregion
}
if (tb.Rows.Count > 0 && tbTitle.Rows.Count > 0)
{
var tbNum = tb.Rows.Count;
var pageNum =
tbNum < 17 ? 1
: Math.Ceiling((float)(tbNum - 16) / 16) + 1;
//循环页
for (int i = 1; i <= pageNum; i++)
{
#region 头部
ws = ClExcelCreateRow(ws, hssfworkbook, rowIndex, rowIndex + 5, style, 0, 20, true);
//行0
CellRangeAddress region = new CellRangeAddress(rowIndex, rowIndex + 3, 0, 4);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex).GetCell(0).SetCellValue(tbTitle.Rows[0]["PipelineCode"].ToString());
region = new CellRangeAddress(rowIndex, rowIndex + 3, 5, 15);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex).GetCell(5).SetCellValue("材料及配件检测委托单");
ws.GetRow(rowIndex).GetCell(5).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 16, true, true);
region = new CellRangeAddress(rowIndex, rowIndex, 16, 20);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex).GetCell(16).SetCellValue(tbTitle.Rows[0]["ProjectName"].ToString());
ws.GetRow(rowIndex).GetCell(16).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Justify, 10, true, false);
//行1
region = new CellRangeAddress(rowIndex + 1, rowIndex + 1, 16, 20);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 1).GetCell(16).SetCellValue("");
ws.GetRow(rowIndex + 1).GetCell(16).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Justify, 9, true, false);
//行2
region = new CellRangeAddress(rowIndex + 2, rowIndex + 2, 16, 20);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 2).GetCell(16).SetCellValue(tbTitle.Rows[0]["InstallationName"].ToString());
ws.GetRow(rowIndex + 2).GetCell(16).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Justify, 10, true, false);
//行3
region = new CellRangeAddress(rowIndex + 3, rowIndex + 3, 16, 20);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 3).GetCell(16).SetCellValue("");
ws.GetRow(rowIndex + 3).GetCell(16).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Justify, 10, true, false);
//行4
region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 0, 1);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 4).GetCell(0).SetCellValue("检测方法");
region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 2, 3);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 4).GetCell(2).SetCellValue(tbTitle.Rows[0]["DetectionTypeCode"].ToString());
region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 4, 6);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 4).GetCell(4).SetCellValue("检测标准");
region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 7, 9);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 4).GetCell(7).SetCellValue("GB 50184-2011");
//ws.GetRow(rowIndex + 4).GetCell(7).SetCellValue(tbTitle.Rows[0]["ExecStandard"].ToString());
region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 10, 11);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 4).GetCell(10).SetCellValue("检测比列");
region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 12, 14);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 4).GetCell(12).SetCellValue(tbTitle.Rows[0]["DetectionRateCode"].ToString());
region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 15, 17);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 4).GetCell(15).SetCellValue("委托编号");
region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 18, 20);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 4).GetCell(18).SetCellValue(tbTitle.Rows[0]["TrustBatchCode"].ToString());
//行5
ws.GetRow(rowIndex + 5).GetCell(0).SetCellValue("序号");
region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 1, 2);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 5).GetCell(1).SetCellValue("检件编号");
region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 3, 5);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 5).GetCell(3).SetCellValue("检件名称");
region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 6, 7);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 5).GetCell(6).SetCellValue("质量证明文件编号");
region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 8, 10);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 5).GetCell(8).SetCellValue("炉/批号");
region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 11, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 5).GetCell(11).SetCellValue("检件规格");
ws.GetRow(rowIndex + 5).GetCell(13).SetCellValue("检件材质");
region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 14, 16);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 5).GetCell(14).SetCellValue("热处理状态");
region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 17, 18);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 5).GetCell(17).SetCellValue("制造/验收标准");
ws.GetRow(rowIndex + 5).GetCell(19).SetCellValue("总数量(道)");
ws.GetRow(rowIndex + 5).GetCell(20).SetCellValue("抽检数量");
#endregion
#region 表格
ws = ClExcelCreateRow(ws, hssfworkbook, rowIndex + 6, rowIndex + 20, style, 0, 20);
var dataTit = rowIndex + 6;
var tIndex = 5 + 15;
var dStart = 0;
var dEnd = 0;
if (i == 1)
{
dStart = 0;
dEnd = 15;
}
else
{
dStart = i == 2 ? 15 : ((i - 2) * 15) + 15;
dEnd = ((i - 1) * 15) + 15;
}
//合并单元格
for (int hb = dataTit; hb <= rowIndex + tIndex; hb++)
{
region = new CellRangeAddress(hb, hb, 1, 2);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 3, 5);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 6, 7);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 8, 10);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 11, 12);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 14, 16);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 17, 18);
ws.AddMergedRegion(region);
}
//获取当前页数据
var pageTb = GetPageToTable(tb, dStart, dEnd);
for (int j = 0; j < pageTb.Rows.Count; j++)
{
int dataIndex = dataTit + j;
//序号
ws.GetRow(dataIndex).GetCell(0).SetCellValue(pageTb.Rows[j]["Number"].ToString());
//检件编号
ws.GetRow(dataIndex).GetCell(1).SetCellValue(pageTb.Rows[j]["PipelineCode"].ToString() + " " + pageTb.Rows[j]["WeldJointCode"].ToString());
//检件名称
ws.GetRow(dataIndex).GetCell(3).SetCellValue("焊缝");
//质量证明文件编号
ws.GetRow(dataIndex).GetCell(6).SetCellValue(tbTitle.Rows[0]["QuaCertFile"].ToString());
//炉/批号
List<string> lpls = new List<string>();
if (!string.IsNullOrWhiteSpace(pageTb.Rows[0]["HeartNo1"].ToString())) lpls.Add(pageTb.Rows[0]["HeartNo1"].ToString());
if (!string.IsNullOrWhiteSpace(pageTb.Rows[0]["HeartNo2"].ToString())) lpls.Add(pageTb.Rows[0]["HeartNo2"].ToString());
if (lpls.Count > 0) lpls = lpls.GroupBy(x => x).Select(x => x.Key).ToList();
ws.GetRow(dataIndex).GetCell(8).SetCellValue(string.Join("/", lpls));
//检件规格
ws.GetRow(dataIndex).GetCell(11).SetCellValue(pageTb.Rows[j]["Specification"].ToString());
//检件材质
ws.GetRow(dataIndex).GetCell(13).SetCellValue(pageTb.Rows[j]["MaterialCode"].ToString());
//热处理状态
ws.GetRow(dataIndex).GetCell(14).SetCellValue(pageTb.Rows[j]["IsHotProessName"].ToString());
//制造/验收标准
ws.GetRow(dataIndex).GetCell(17).SetCellValue(tbTitle.Rows[0]["AcceptStandard"].ToString());
//总数量(道)
ws.GetRow(dataIndex).GetCell(19).SetCellValue("");
//抽检数量
ws.GetRow(dataIndex).GetCell(20).SetCellValue("");
}
rowIndex += tIndex;
#endregion
#region 尾部
ws = ClExcelCreateRow(ws, hssfworkbook, rowIndex + 1, rowIndex + 8, style, 0, 20);
//合并单元格
for (int hb = rowIndex + 1; hb <= rowIndex + 8; hb++)
{
for (int c = 0; c <= 20; c++)
{
if (hb >= rowIndex + 2 && hb < rowIndex + 8)
{
ws.GetRow(hb).GetCell(c).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Left, 10, true, false);
}
if (hb == rowIndex + 8)
{
ws.GetRow(hb).GetCell(c).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Right, 10, true, false);
}
}
region = new CellRangeAddress(hb, hb, 0, 3);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 4, 8);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 9, 11);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 12, 17);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 18, 20);
ws.AddMergedRegion(region);
}
//尾部行1
ws.GetRow(rowIndex + 1).GetCell(0).SetCellValue("检测单位");
ws.GetRow(rowIndex + 1).GetCell(4).SetCellValue("监理单位");
ws.GetRow(rowIndex + 1).GetCell(9).SetCellValue("管理公司");
ws.GetRow(rowIndex + 1).GetCell(12).SetCellValue("建设单位");
ws.GetRow(rowIndex + 1).GetCell(18).SetCellValue("检测单位");
//尾部行2
ws.GetRow(rowIndex + 2).GetCell(0).SetCellValue("质量检测员:");
ws.GetRow(rowIndex + 2).GetCell(4).SetCellValue("专业工程师:");
ws.GetRow(rowIndex + 2).GetCell(9).SetCellValue("专业/质量工程师:");
ws.GetRow(rowIndex + 2).GetCell(12).SetCellValue("业主代表:");
ws.GetRow(rowIndex + 2).GetCell(18).SetCellValue("接收人:");
//尾部行4
ws.GetRow(rowIndex + 4).GetCell(0).SetCellValue("专业工程师:");
//尾部行8
ws.GetRow(rowIndex + 8).GetCell(0).SetCellValue("年 月 日");
ws.GetRow(rowIndex + 8).GetCell(4).SetCellValue("年 月 日");
ws.GetRow(rowIndex + 8).GetCell(9).SetCellValue("年 月 日");
ws.GetRow(rowIndex + 8).GetCell(12).SetCellValue("年 月 日");
ws.GetRow(rowIndex + 8).GetCell(18).SetCellValue("年 月 日");
#endregion
ws = ClExcelCreateRow(ws, hssfworkbook, rowIndex + 9, rowIndex + 9, style, 0, 20, false, true);
rowIndex += 10;
}
}
}
else
{
if (hssfworkbook.GetSheet("无损检测委托单") != null)
{
ws = (XSSFSheet)hssfworkbook.GetSheet("无损检测委托单");
}
else
{
rowIndex = 0;
ws = (XSSFSheet)hssfworkbook.CreateSheet("无损检测委托单");
#region 列宽
ws.SetColumnWidth(0, 9 * 256);
ws.SetColumnWidth(1, 6 * 256);
ws.SetColumnWidth(2, 6 * 256);
ws.SetColumnWidth(3, 6 * 256);
ws.SetColumnWidth(4, 6 * 256);
ws.SetColumnWidth(5, 9 * 256);
ws.SetColumnWidth(6, 9 * 256);
ws.SetColumnWidth(7, 5 * 256);
ws.SetColumnWidth(8, 5 * 256);
ws.SetColumnWidth(9, 5 * 256);
ws.SetColumnWidth(10, 8 * 256);
ws.SetColumnWidth(11, 9 * 256);
ws.SetColumnWidth(12, 11 * 256);
#endregion
}
if (tb.Rows.Count > 0 && tbTitle.Rows.Count > 0)
{
var tbNum = tb.Rows.Count;
var pageNum =
tbNum < 15 ? 1
: Math.Ceiling((float)(tbNum - 14) / 14) + 1;
//循环页
for (int i = 1; i <= pageNum; i++)
{
#region 头部
ws = WsExcelCreateRow(ws, hssfworkbook, rowIndex, rowIndex + 12, style, 0, 12, 1);
//行0
CellRangeAddress region = new CellRangeAddress(rowIndex, rowIndex + 3, 0, 2);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex).GetCell(0).SetCellValue(tbTitle.Rows[0]["PipelineCode"].ToString());
ws.GetRow(rowIndex).GetCell(0).CellStyle = style;
ws.GetRow(rowIndex).GetCell(1).CellStyle = style;
ws.GetRow(rowIndex).GetCell(2).CellStyle = style;
region = new CellRangeAddress(rowIndex, rowIndex + 3, 3, 9);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex).GetCell(3).SetCellValue("无损检测委托单");
ws.GetRow(rowIndex).GetCell(3).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Center, 16, true, true);
ws.GetRow(rowIndex).GetCell(4).CellStyle = style;
ws.GetRow(rowIndex).GetCell(5).CellStyle = style;
ws.GetRow(rowIndex).GetCell(6).CellStyle = style;
ws.GetRow(rowIndex).GetCell(7).CellStyle = style;
ws.GetRow(rowIndex).GetCell(8).CellStyle = style;
ws.GetRow(rowIndex).GetCell(9).CellStyle = style;
region = new CellRangeAddress(rowIndex, rowIndex, 10, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex).GetCell(10).SetCellValue(tbTitle.Rows[0]["ProjectName"].ToString());
ws.GetRow(rowIndex).GetCell(10).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Justify, 10.5, true, false);
ws.GetRow(rowIndex).GetCell(11).CellStyle = styleButton;
ws.GetRow(rowIndex).GetCell(12).CellStyle = styleButton;
//行1
region = new CellRangeAddress(rowIndex + 1, rowIndex + 1, 10, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 1).GetCell(10).SetCellValue("EnProjectName");
ws.GetRow(rowIndex + 1).GetCell(10).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Justify, 10.5, true, false);
ws.GetRow(rowIndex + 1).GetCell(11).CellStyle = styleNone;
ws.GetRow(rowIndex + 1).GetCell(12).CellStyle = styleNone;
//行2
region = new CellRangeAddress(rowIndex + 2, rowIndex + 2, 10, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 2).GetCell(10).SetCellValue(tbTitle.Rows[0]["WorkAreaName"].ToString());
ws.GetRow(rowIndex + 2).GetCell(10).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Justify, 10.5, true, false);
ws.GetRow(rowIndex + 2).GetCell(11).CellStyle = styleNone;
ws.GetRow(rowIndex + 2).GetCell(12).CellStyle = styleNone;
//行3
region = new CellRangeAddress(rowIndex + 3, rowIndex + 3, 10, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 3).GetCell(10).SetCellValue("EnWorkAreaName");
ws.GetRow(rowIndex + 3).GetCell(10).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Justify, 10.5, true, false);
ws.GetRow(rowIndex + 3).GetCell(11).CellStyle = styleTop;
ws.GetRow(rowIndex + 3).GetCell(12).CellStyle = styleTop;
//行4
ws.GetRow(rowIndex + 4).GetCell(0).SetCellValue("委托单位");
region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 1, 5);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 4).GetCell(1).SetCellValue(tbTitle.Rows[0]["TrustUnit"].ToString());
region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 6, 7);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 4).GetCell(6).SetCellValue("委托编号");
region = new CellRangeAddress(rowIndex + 4, rowIndex + 4, 8, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 4).GetCell(8).SetCellValue(tbTitle.Rows[0]["TrustBatchCode"].ToString());
//行5,
ws.GetRow(rowIndex + 5).GetCell(0).SetCellValue("检测单位");
region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 1, 5);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 5).GetCell(1).SetCellValue(tbTitle.Rows[0]["NDEUnit"].ToString());
region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 6, 7);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 5).GetCell(6).SetCellValue("检测方法");
region = new CellRangeAddress(rowIndex + 5, rowIndex + 5, 8, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 5).GetCell(8).SetCellValue(detectionTypeCode);
//行6
ws.GetRow(rowIndex + 6).GetCell(0).SetCellValue("检件名称");
region = new CellRangeAddress(rowIndex + 6, rowIndex + 6, 1, 5);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 6).GetCell(1).SetCellValue("管道焊缝");
region = new CellRangeAddress(rowIndex + 6, rowIndex + 6, 6, 7);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 6).GetCell(6).SetCellValue("表面状态");
region = new CellRangeAddress(rowIndex + 6, rowIndex + 6, 8, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 6).GetCell(8).SetCellValue(tbTitle.Rows[0]["SurfaceState"].ToString());
//行7
ws.GetRow(rowIndex + 7).GetCell(0).SetCellValue("检测标准");
region = new CellRangeAddress(rowIndex + 7, rowIndex + 7, 1, 5);
ws.AddMergedRegion(region);
//ws.GetRow(rowIndex + 8).GetCell(1).SetCellValue(tbTitle.Rows[0]["ExecStandard"].ToString());
ws.GetRow(rowIndex + 7).GetCell(1).SetCellValue(tbTitle.Rows[0]["TestStandard"].ToString());
region = new CellRangeAddress(rowIndex + 7, rowIndex + 7, 6, 7);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 7).GetCell(6).SetCellValue("检测比例");
region = new CellRangeAddress(rowIndex + 7, rowIndex + 7, 8, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 7).GetCell(8).SetCellValue(tbTitle.Rows[0]["DetectionRateCode"].ToString());
//行8
ws.GetRow(rowIndex + 8).GetCell(0).SetCellValue("技术等级");
region = new CellRangeAddress(rowIndex + 8, rowIndex + 8, 1, 5);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 8).GetCell(1).SetCellValue(tbTitle.Rows[0]["TechLevel"].ToString());
region = new CellRangeAddress(rowIndex + 8, rowIndex + 8, 6, 7);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 8).GetCell(6).SetCellValue("合格级别");
region = new CellRangeAddress(rowIndex + 8, rowIndex + 8, 8, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 8).GetCell(8).SetCellValue(tbTitle.Rows[0]["QueClass"].ToString());
//行9
ws.GetRow(rowIndex + 9).GetCell(0).SetCellValue("焊接方法");
region = new CellRangeAddress(rowIndex + 9, rowIndex + 9, 1, 5);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 9).GetCell(1).SetCellValue(tbTitle.Rows[0]["WeldingMethodCode"].ToString());
region = new CellRangeAddress(rowIndex + 9, rowIndex + 9, 6, 7);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 9).GetCell(6).SetCellValue("压力管道分级");
region = new CellRangeAddress(rowIndex + 9, rowIndex + 9, 8, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 9).GetCell(8).SetCellValue(tbTitle.Rows[0]["PIPClassCode"].ToString());
//ws.GetRow(rowIndex + 9).GetCell(1).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Justify, 10.5, true, false);
//行10
ws.GetRow(rowIndex + 10).GetCell(0).SetCellValue("坡口形式");
region = new CellRangeAddress(rowIndex + 10, rowIndex + 10, 1, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 10).GetCell(1).SetCellValue(tbTitle.Rows[0]["GrooveTypeCode"].ToString());
ws.GetRow(rowIndex + 10).GetCell(1).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Justify, 10.5, true, false);
//行11
ws.GetRow(rowIndex + 11).GetCell(0).SetCellValue("检测时机");
region = new CellRangeAddress(rowIndex + 11, rowIndex + 11, 1, 12);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 11).GetCell(1).SetCellValue(tbTitle.Rows[0]["DetectionTiming"].ToString());
ws.GetRow(rowIndex + 11).GetCell(1).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, HorizontalAlignment.Justify, 10.5, true, false);
//行12
region = new CellRangeAddress(rowIndex + 12, rowIndex + 12, 0, 1);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 12).GetCell(0).SetCellValue("检件编号");
region = new CellRangeAddress(rowIndex + 12, rowIndex + 12, 2, 3);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 12).GetCell(2).SetCellValue("焊口号");
region = new CellRangeAddress(rowIndex + 12, rowIndex + 12, 4, 5);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 12).GetCell(4).SetCellValue("焊工代号");
region = new CellRangeAddress(rowIndex + 12, rowIndex + 12, 6, 9);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 12).GetCell(6).SetCellValue("检件材质");
region = new CellRangeAddress(rowIndex + 12, rowIndex + 12, 10, 11);
ws.AddMergedRegion(region);
ws.GetRow(rowIndex + 12).GetCell(10).SetCellValue("检件规格(mm)");
ws.GetRow(rowIndex + 12).GetCell(12).SetCellValue("备注");
#endregion
#region 表格
ws = WsExcelCreateRow(ws, hssfworkbook, rowIndex + 13, rowIndex + 26, style, 0, 12, 2);
var dataTit = rowIndex + 13;
var tIndex = 12 + 14;
var dStart = 0;
var dEnd = 0;
if (i == 1)
{
dStart = 0;
dEnd = 14;
}
else
{
dStart = i == 2 ? 14 : ((i - 2) * 14) + 14;
dEnd = ((i - 1) * 14) + 14;
}
//合并单元格
for (int hb = dataTit; hb <= rowIndex + tIndex; hb++)
{
region = new CellRangeAddress(hb, hb, 0, 1);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 2, 3);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 4, 5);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 6, 9);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 10, 11);
ws.AddMergedRegion(region);
}
//获取当前页数据
var pageTb = GetPageToTable(tb, dStart, dEnd);
for (int j = 0; j < pageTb.Rows.Count; j++)
{
int dataIndex = dataTit + j;
//检件编号
ws.GetRow(dataIndex).GetCell(0).SetCellValue(pageTb.Rows[j]["PipelineCode"].ToString());
//焊口号
ws.GetRow(dataIndex).GetCell(2).SetCellValue(pageTb.Rows[j]["WeldJointCode"].ToString());
//焊工代号
ws.GetRow(dataIndex).GetCell(4).SetCellValue(pageTb.Rows[j]["WelderCode"].ToString());
//检件材质
ws.GetRow(dataIndex).GetCell(6).SetCellValue(pageTb.Rows[j]["MaterialCode"].ToString());
//检件规格(mm)
ws.GetRow(dataIndex).GetCell(10).SetCellValue(pageTb.Rows[j]["Specification"].ToString());
//备注
ws.GetRow(dataIndex).GetCell(12).SetCellValue(pageTb.Rows[j]["Remark"].ToString());
}
if (dataTit + pageTb.Rows.Count < 26)
{
ws.GetRow(dataTit + pageTb.Rows.Count).GetCell(0).SetCellValue("以下空白");
}
rowIndex += tIndex;
#endregion
#region 尾部
string JLAudit = tb.Rows[0]["JLAudit"].ToString();
string GLGSAudit = tb.Rows[0]["GLGSAudit"].ToString();
ws = WsExcelCreateRow(ws, hssfworkbook, rowIndex + 1, rowIndex + 9, style, 0, 12, 3);
//合并单元格
for (int hb = rowIndex + 1; hb <= rowIndex + 10; hb++)
{
for (int c = 0; c <= 12; c++)
{
if (hb >= rowIndex + 2 && hb <= rowIndex + 3)
{
ws.GetRow(hb).GetCell(c).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Left, 10.5, true, false);
}
if (hb >= rowIndex + 4 && hb <= rowIndex + 8)
{
ws.GetRow(hb).GetCell(c).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Right, 10.5, true, false);
}
if (hb == rowIndex + 9)
{
ws.GetRow(hb).GetCell(c).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true, false);
}
}
region = new CellRangeAddress(hb, hb, 0, 1);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 2, 4);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 5, 6);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 7, 10);
ws.AddMergedRegion(region);
region = new CellRangeAddress(hb, hb, 11, 12);
ws.AddMergedRegion(region);
}
//尾部行1
ws.GetRow(rowIndex + 1).GetCell(0).SetCellValue("施工单位");
ws.GetRow(rowIndex + 1).GetCell(2).SetCellValue("监理单位");
ws.GetRow(rowIndex + 1).GetCell(5).SetCellValue("管理公司");
ws.GetRow(rowIndex + 1).GetCell(7).SetCellValue("建设单位");
ws.GetRow(rowIndex + 1).GetCell(11).SetCellValue("检测单位");
//尾部行3
ws.GetRow(rowIndex + 3).GetCell(0).SetCellValue("质量检测员:");
ws.GetRow(rowIndex + 3).GetCell(2).SetCellValue("专业工程师:");
ws.GetRow(rowIndex + 3).GetCell(5).SetCellValue("专业/质量工程师:");
ws.GetRow(rowIndex + 3).GetCell(7).SetCellValue("业主代表:");
ws.GetRow(rowIndex + 3).GetCell(11).SetCellValue("接收人:");
//尾部行4
ws.GetRow(rowIndex + 4).GetCell(2).SetCellValue(JLAudit);
ws.GetRow(rowIndex + 4).GetCell(3).SetCellValue(GLGSAudit);
//尾部行6
ws.GetRow(rowIndex + 6).GetCell(0).SetCellValue("专业工程师:");
//尾部行8
ws.GetRow(rowIndex + 8).GetCell(0).SetCellValue(" 年 月 日");
if (trustDate != null)
{
string tdate = trustDate.Value.Year + "年" + trustDate.Value.Month + "月" + trustDate.Value.Day + "日";
ws.GetRow(rowIndex + 8).GetCell(2).SetCellValue(tdate);
ws.GetRow(rowIndex + 8).GetCell(5).SetCellValue(tdate);
}
ws.GetRow(rowIndex + 8).GetCell(7).SetCellValue(" 年 月 日");
ws.GetRow(rowIndex + 8).GetCell(11).SetCellValue(" 年 月 日");
//尾部行9
#endregion
ws = WsExcelCreateRow(ws, hssfworkbook, rowIndex + 11, rowIndex + 11, style, 0, 12, 3, true);
rowIndex += 11;
}
}
}
if ((int)(90 * (num) / totalNum) > percent)
{
percent = (int)(100 * (num) / totalNum);
}
num++;
}
ws.SetMargin(MarginType.LeftMargin, 0.3);
ws.SetMargin(MarginType.RightMargin, 0.2);
ws.SetMargin(MarginType.BottomMargin, 0.4);
ws.PrintSetup.Landscape = false;
ws.PrintSetup.PaperSize = 9;
ws.ForceFormulaRecalculation = true;
using (FileStream filess = System.IO.File.OpenWrite(ReportFileName))
{
hssfworkbook.Write(filess);
//hssfworkbook.Close();
//filess.Flush();
//filess.Close();
}
percent = 100;
url = ReportFileName.Replace(Server.MapPath("~/"), "");
//FileInfo filet = new FileInfo(ReportFileName);
//Response.Clear();
//Response.Charset = "GB2312";
//Response.ContentEncoding = System.Text.Encoding.UTF8;
//// 添加头信息,为"文件下载/另存为"对话框指定默认文件名
//Response.AddHeader("Content-Disposition", "attachment; filename=" + Server.UrlEncode("无损检测委托单.xlsx"));
//// 添加头信息,指定文件大小,让浏览器能够显示下载进度
//Response.AddHeader("Content-Length", filet.Length.ToString());
//// 指定返回的是一个不能被客户端读取的流,必须被下载
//Response.ContentType = "application/ms-excel";
//// 把文件流发送到客户端
//Response.WriteFile(filet.FullName);
//// 停止页面的执行
//Response.End();
}
#endregion
#region 私有方法
/// <summary>
/// 获取某一列的所有值
/// </summary>
/// <typeparam name="T">列数据类型</typeparam>
/// <param name="dtSource">数据表</param>
/// <param name="filedName">列名</param>
/// <returns></returns>
public static List<T> GetColumnValues<T>(DataTable dtSource, string filedName)
{
return (from r in dtSource.AsEnumerable() select r.Field<T>(filedName)).ToList<T>();
}
/// <summary>
/// 无损检测委托单行和列
/// </summary>
/// <returns></returns>
private XSSFSheet WsExcelCreateRow(XSSFSheet ws, XSSFWorkbook hssfworkbook, int sRows, int eRows, ICellStyle style, int cStart, int cEnd, int excelpart, bool isnobk = false)
{
for (int i = sRows; i <= eRows; i++)
{
ws.CreateRow(i);
if (excelpart == 1)
{
ws.GetRow(i).HeightInPoints =
i == sRows ? 27.75f :
i == (sRows + 1) ? 25.5f :
i == (sRows + 2) ? 25.5f :
i == (sRows + 3) ? 25.5f :
i == (sRows + 4) ? 23.25f :
i == (sRows + 5) ? 23.25f :
i == (sRows + 6) ? 23.25f :
i == (sRows + 7) ? 23.25f :
i == (sRows + 8) ? 23.25f :
i == (sRows + 9) ? 23.25f :
i == (sRows + 10) ? 23.25f :
i == (sRows + 11) ? 23.25f :
i == (sRows + 12) ? 23.25f :
17f;
}
else if (excelpart == 2)
{
ws.GetRow(i).HeightInPoints = 25.5f;
}
else
{
ws.GetRow(i).HeightInPoints = 15.5f;
}
for (int j = cStart; j <= cEnd; j++)
{
ws.GetRow(i).CreateCell(j);
if (isnobk)
{
ws.GetRow(i).GetCell(j).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Center, 10.5, true, false);
}
else
{
ws.GetRow(i).GetCell(j).CellStyle = style;
}
}
}
return ws;
}
/// <summary>
/// 材料及配件检测委托单行和列
/// </summary>
/// <returns></returns>
private XSSFSheet ClExcelCreateRow(XSSFSheet ws, XSSFWorkbook hssfworkbook, int sRows, int eRows, ICellStyle style, int cStart, int cEnd, bool istitle = false, bool isnobk = false)
{
for (int i = sRows; i <= eRows; i++)
{
ws.CreateRow(i);
if (istitle)
{
ws.GetRow(i).HeightInPoints =
i == sRows ? 27.75f :
i == (sRows + 1) ? 25f :
i == (sRows + 2) ? 21.75f :
i == (sRows + 3) ? 21.75f :
i == (sRows + 5) ? 28f :
14.75f;
}
else
{
ws.GetRow(i).HeightInPoints = 14.75f;
}
for (int j = cStart; j <= cEnd; j++)
{
ws.GetRow(i).CreateCell(j);
if (isnobk)
{
ws.GetRow(i).GetCell(j).CellStyle = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, HorizontalAlignment.Center, 10, true, false);
}
else
{
ws.GetRow(i).GetCell(j).CellStyle = style;
}
}
}
return ws;
}
/// <summary>
/// 查询指定条数分页
/// </summary>
/// <returns></returns>
public static DataTable GetPageToTable(DataTable dt, int StartNum, int EndNum)
{
//0页代表每页数据,直接返回
if (EndNum == 0) return dt;
//数据源为空返回空DataTable
if (dt == null) return new DataTable();
DataTable newdt = dt.Copy();
newdt.Clear();//copy dt的框架
if (StartNum >= dt.Rows.Count)
return newdt;//源数据记录数小于等于要显示的记录,直接返回dt
if (EndNum > dt.Rows.Count)
EndNum = dt.Rows.Count;
for (int i = StartNum; i <= EndNum - 1; i++)
{
DataRow newdr = newdt.NewRow();
DataRow dr = dt.Rows[i];
foreach (DataColumn column in dt.Columns)
{
newdr[column.ColumnName] = dr[column.ColumnName];
}
newdt.Rows.Add(newdr);
}
return newdt;
}
#endregion
}
}
@@ -0,0 +1,186 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class NDTTrustPrint {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// drpInstallation 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpInstallation;
/// <summary>
/// drpNDEType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpNDEType;
/// <summary>
/// txtTrustBatchCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtTrustBatchCode;
/// <summary>
/// txtTrustStartDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtTrustStartDate;
/// <summary>
/// txtTrustEndDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtTrustEndDate;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// BtnAnalyse 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button BtnAnalyse;
/// <summary>
/// btnPrint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// WindowExport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowExport;
/// <summary>
/// ContentPanel3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ContentPanel ContentPanel3;
/// <summary>
/// ScriptManager2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.ScriptManager ScriptManager2;
}
}
@@ -0,0 +1,74 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OpenResetPoint.aspx.cs"
Inherits="FineUIPro.Web.WeldingProcess.TrustManage.OpenResetPoint" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>重新点口</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
<style>
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="<%$ Resources:Lan,WeldingJointInfo %>"
TitleToolTip="<%$ Resources:Lan,WeldingJointInfo %>" AutoScroll="true">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,WeldingJointInfo %>"
EnableCollapse="true" KeepCurrentSelection="true" runat="server" BoxFlex="1"
DataKeyNames="PointBatchItemId" AllowColumnLocking="true" EnableColumnLines="true"
DataIDField="PointBatchItemId" EnableTextSelection="True" AllowSorting="true" SortField="WeldJointCode"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="false" IsDatabasePaging="true"
PageSize="10000" EnableCheckBoxSelect="true">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnAccept" Icon="Accept" runat="server" Text="点口确定" ToolTip="点口确定"
OnClick="btnAccept_Click">
</f:Button>
<f:Button ID="取消点口" Icon="ArrowUndo" Text="取消点口" runat="server" ToolTip="取消点口"
OnClick="btnCancelAccept_Click" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField HeaderText="批编号" ColumnID="PointBatchCode"
DataField="PointBatchCode" SortField="PointBatchCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="180px" ExpandUnusedSpace="true">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,WeldingJointNumber %>" ColumnID="WeldJointCode"
DataField="WeldJointCode" SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,Area %>" ColumnID="JointArea" DataField="JointArea"
SortField="JointArea" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Width="100px">
</f:RenderField>
<f:RenderField HeaderText="焊工号" ColumnID="WelderCode" DataField="WelderCode"
SortField="WelderCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Width="100px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,WeldingDate %>" ColumnID="WeldingDate"
DataField="WeldingDate" SortField="WeldingDate" FieldType="Date" Renderer="Date"
HeaderTextAlign="Center" TextAlign="Left" Width="120px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,PipingClass %>" ColumnID="PipingClassName"
DataField="PipingClassName" SortField="PipingClassName" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="180px">
</f:RenderField>
</Columns>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
</form>
</body>
</html>
@@ -0,0 +1,171 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using BLL;
namespace FineUIPro.Web.WeldingProcess.TrustManage
{
public partial class OpenResetPoint : PageBase
{
#region 定义项
/// <summary>
/// 批主键
/// </summary>
public string PointBatchId
{
get
{
return (string)ViewState["PointBatchId"];
}
set
{
ViewState["PointBatchId"] = value;
}
}
#endregion
#region 加载页面
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.PointBatchId = Request.Params["PointBatchId"];
this.BindGrid();
}
}
#endregion
#region 数据绑定
/// <summary>
/// 数据绑定
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT PointBatchItem.PointBatchItemId,PointBatch.PointBatchCode, jot.WeldJointCode,
ins.InstallationCode, WorkArea.WorkAreaCode,unit.UnitCode,
(CASE PointBatchItem.IsAudit WHEN 1 THEN '是' ELSE '否' END) AS PointIsAudit,
jot.JointArea,WeldingDaily.WeldingDate,PipingClass.PipingClassName,
(CASE WHEN jot.BackingWelderId!=jot.CoverWelderId THEN backingWelder.WelderCode+'/'+coverWelder.WelderCode ELSE backingWelder.WelderCode END) AS WelderCode--焊工号
FROM Batch_PointBatchItem AS PointBatchItem
LEFT JOIN Batch_PointBatch AS PointBatch ON PointBatch.PointBatchId=PointBatchItem.PointBatchId
LEFT JOIN Pipeline_WeldJoint AS jot ON jot.WeldJointId=PointBatchItem.WeldJointId
LEFT JOIN Pipeline_Pipeline AS Pipeline ON Pipeline.PipelineId=jot.PipelineId
LEFT JOIN dbo.Welder_Welder backingWelder ON backingWelder.WelderId = jot.BackingWelderId
LEFT JOIN dbo.Welder_Welder coverWelder ON coverWelder.WelderId = jot.CoverWelderId
LEFT JOIN Project_WorkArea AS WorkArea ON WorkArea.WorkAreaId=Pipeline.WorkAreaId
LEFT JOIN Pipeline_WeldingDaily AS WeldingDaily ON WeldingDaily.WeldingDailyId=jot.WeldingDailyId
LEFT JOIN Base_PipingClass AS PipingClass ON PipingClass.PipingClassId=Pipeline.PipingClassId
LEFT JOIN dbo.Project_Installation ins ON ins.InstallationId = PointBatch.InstallationId
LEFT JOIN dbo.Base_Unit unit ON unit.UnitId = PointBatch.UnitId
WHERE PointBatchItem.PointState IS NULL
AND PointBatch.ProjectId=@ProjectId AND PointBatchItem.PointBatchId=@PointBatchId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
listStr.Add(new SqlParameter("@PointBatchId", this.PointBatchId));
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
// tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
//string ids = string.Empty;
//for (int i = 0; i < this.Grid1.Rows.Count; i++)
//{
// var pointItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(this.Grid1.Rows[i].DataKeys[0].ToString());
// if (pointItem != null && pointItem.PointState == "1")
// {
// ids += pointItem.PointBatchItemId + ",";
// }
//}
//if (!string.IsNullOrEmpty(ids))
//{
// ids = ids.Substring(0, ids.Length - 1);
// this.Grid1.SelectedRowIDArray = ids.Split(',');
//}
}
#endregion
#region 排序
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
this.BindGrid();
}
#endregion
#region 确定按钮
/// <summary>
/// 确定按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAccept_Click(object sender, EventArgs e)
{
Model.HJGLDB db = Funs.DB;
string[] selectRowId = Grid1.SelectedRowIDArray;
if (selectRowId.Count() > 0)
{
foreach (var item in selectRowId)
{
BLL.Batch_PointBatchItemService.UpdatePointBatchItem(item, "1", DateTime.Now, null);
var pWelder = from x in db.Batch_PointBatchItem
join y in db.Pipeline_WeldJoint on x.WeldJointId equals y.WeldJointId
where x.PointBatchItemId == item
select new { x.PointBatchId, y.BackingWelderId };
if (pWelder.Count() > 0)
{
// 查找该焊工所在批所有未关闭的焊口
var pItem = (from x in db.Batch_PointBatchItem
join y in db.Pipeline_WeldJoint on x.WeldJointId equals y.WeldJointId
where x.IsCompletedPoint == false && x.PointBatchId == pWelder.First().PointBatchId
&& y.BackingWelderId == pWelder.First().BackingWelderId
select x).ToList();
if (pItem.Count() > 0)
{
foreach (var q in pItem)
{
q.IsCompletedPoint = true;
db.SubmitChanges();
}
}
}
}
}
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnOpenResetPoint, this.PointBatchId);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
protected void btnCancelAccept_Click(object sender, EventArgs e)
{
Model.HJGLDB db = Funs.DB;
string[] selectRowId = Grid1.SelectedRowIDArray;
if (selectRowId.Count() > 0)
{
foreach (var item in selectRowId)
{
BLL.Batch_PointBatchItemService.UpdatePointBatchItem(item, null, null, null);
}
}
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnOpenResetPoint, this.PointBatchId);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
}
}
@@ -0,0 +1,96 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class OpenResetPoint {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnAccept 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAccept;
/// <summary>
/// 取消点口 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button 取消点口;
}
}
@@ -0,0 +1,101 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PointAudit.aspx.cs"
Inherits="FineUIPro.Web.WeldingProcess.TrustManage.PointAudit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>点口审核</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="<%$ Resources:Lan,WeldingJointInfo %>"
TitleToolTip="<%$ Resources:Lan,WeldingJointInfo %>" AutoScroll="true">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,WeldingJointInfo %>"
EnableCollapse="true" KeepCurrentSelection="true" runat="server" BoxFlex="1"
DataKeyNames="PointBatchItemId" AllowColumnLocking="true" EnableColumnLines="true"
DataIDField="PointBatchItemId" EnableTextSelection="True" AllowSorting="true" SortField="PointBatchCode,WeldJointCode"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="false" IsDatabasePaging="true"
PageSize="1000" EnableCheckBoxSelect="true">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:TextBox ID="txtPipelineCode" runat="server"
EmptyText="输入管线号查询" Width="190px" LabelAlign="Right">
</f:TextBox>
<f:Button ID="btnQuery" ToolTip="<%$ Resources:Lan,Inquiry %>" Icon="SystemSearch"
EnablePostBack="true" OnClick="btnQuery_Click" runat="server">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnAccept" Icon="Accept" Text="审核" runat="server" ToolTip="审核"
OnClick="btnAccept_Click">
</f:Button>
<f:Button ID="取消审核" Icon="ArrowUndo" Text="取消审核" runat="server" ToolTip="取消审核"
OnClick="btnCancelAccept_Click">
</f:Button>
<f:Button ID="btnGenerate" Text="生成" ToolTip="生成" Icon="TableEdit" runat="server"
OnClick="btnGenerate_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField HeaderText="装置" ColumnID="InstallationCode"
DataField="InstallationCode" SortField="InstallationCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="100px">
</f:RenderField>
<f:RenderField HeaderText="工区号" ColumnID="WorkAreaCode"
DataField="WorkAreaCode" SortField="WorkAreaCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="90px">
</f:RenderField>
<f:RenderField HeaderText="单位" ColumnID="UnitCode"
DataField="UnitCode" SortField="UnitCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="90px" >
</f:RenderField>
<f:RenderField HeaderText="批号" ColumnID="PointBatchCode"
DataField="PointBatchCode" SortField="PointBatchCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="240px" >
</f:RenderField>
<f:RenderField HeaderText="管线号" ColumnID="PipelineCode"
DataField="PipelineCode" SortField="PipelineCode" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="170px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,WeldingJointNumber %>" ColumnID="WeldJointCode"
DataField="WeldJointCode" SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="90px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,Area %>" ColumnID="JointArea" DataField="JointArea"
SortField="JointArea" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Width="100px">
</f:RenderField>
<f:RenderField HeaderText="焊工号" ColumnID="WelderCode" DataField="WelderCode"
SortField="WelderCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Width="110px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,WeldingDate %>" ColumnID="WeldingDate"
DataField="WeldingDate" SortField="WeldingDate" FieldType="Date" Renderer="Date"
HeaderTextAlign="Center" TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,PipingClass %>" ColumnID="PipingClassName"
DataField="PipingClassName" SortField="PipingClassName" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="点口审核" ColumnID="PointIsAudit" DataField="PointIsAudit"
SortField="PointIsAudit" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Width="90px">
</f:RenderField>
</Columns>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
</form>
</body>
</html>
@@ -0,0 +1,392 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using BLL;
namespace FineUIPro.Web.WeldingProcess.TrustManage
{
public partial class PointAudit : PageBase
{
#region 加载页面
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.BindGrid();
}
}
#endregion
#region 数据绑定
/// <summary>
/// 数据绑定
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT PointBatchItem.PointBatchItemId,PointBatch.PointBatchCode, jot.WeldJointCode,
ins.InstallationCode, WorkArea.WorkAreaCode,unit.UnitCode, Pipeline.PipelineCode,
(CASE PointBatchItem.IsAudit WHEN 1 THEN '是' ELSE '否' END) AS PointIsAudit,
jot.JointArea,WeldingDaily.WeldingDate,PipingClass.PipingClassName,
trustItem.TrustBatchItemId,
(CASE WHEN jot.BackingWelderId!=jot.CoverWelderId THEN backingWelder.WelderCode+'/'+coverWelder.WelderCode ELSE backingWelder.WelderCode END) AS WelderCode--焊工号
FROM Batch_PointBatchItem AS PointBatchItem
LEFT JOIN Batch_PointBatch AS PointBatch ON PointBatch.PointBatchId=PointBatchItem.PointBatchId
LEFT JOIN Pipeline_WeldJoint AS jot ON jot.WeldJointId=PointBatchItem.WeldJointId
LEFT JOIN Pipeline_Pipeline AS Pipeline ON Pipeline.PipelineId=jot.PipelineId
LEFT JOIN dbo.Welder_Welder backingWelder ON backingWelder.WelderId = jot.BackingWelderId
LEFT JOIN dbo.Welder_Welder coverWelder ON coverWelder.WelderId = jot.CoverWelderId
LEFT JOIN Project_WorkArea AS WorkArea ON WorkArea.WorkAreaId=Pipeline.WorkAreaId
LEFT JOIN Pipeline_WeldingDaily AS WeldingDaily ON WeldingDaily.WeldingDailyId=jot.WeldingDailyId
LEFT JOIN Base_PipingClass AS PipingClass ON PipingClass.PipingClassId=Pipeline.PipingClassId
LEFT JOIN dbo.Project_Installation ins ON ins.InstallationId = PointBatch.InstallationId
LEFT JOIN dbo.Base_Unit unit ON unit.UnitId = PointBatch.UnitId
LEFT JOIN dbo.Batch_BatchTrustItem trustItem ON trustItem.PointBatchItemId = PointBatchItem.PointBatchItemId
WHERE PointBatchItem.PointState IS NOT NULL AND trustItem.TrustBatchItemId IS NULL
AND PointBatch.ProjectId=@ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (!string.IsNullOrEmpty(this.txtPipelineCode.Text.Trim()))
{
strSql += " AND Pipeline.PipelineCode LIKE @PipelineCode";
listStr.Add(new SqlParameter("@PipelineCode", "%" + this.txtPipelineCode.Text.Trim() + "%"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
// tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#endregion
protected void btnQuery_Click(object sender, EventArgs e)
{
this.BindGrid();
}
#region 排序
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, GridSortEventArgs e)
{
this.BindGrid();
}
#endregion
#region 确定按钮
/// <summary>
/// 确定按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAccept_Click(object sender, EventArgs e)
{
string[] selectRowId = Grid1.SelectedRowIDArray;
if (selectRowId.Count() > 0)
{
foreach (var item in selectRowId)
{
BLL.Batch_PointBatchItemService.PointAudit(item, true);
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnJLAudit, item);
}
this.BindGrid();
Alert.ShowInTop("勾选的焊口已审核!");
}
else
{
Alert.ShowInTop("请勾选要审核的焊口!", MessageBoxIcon.Warning);
}
}
protected void btnCancelAccept_Click(object sender, EventArgs e)
{
string[] selectRowId = Grid1.SelectedRowIDArray;
if (selectRowId.Count() > 0)
{
foreach (var item in selectRowId)
{
BLL.Batch_PointBatchItemService.PointAudit(item, false);
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnJLAudit, item);
}
this.BindGrid();
Alert.ShowInTop("勾选的焊口已取消审核!");
}
else
{
Alert.ShowInTop("请勾选要取消审核的焊口!", MessageBoxIcon.Warning);
}
}
#endregion
#region 生成委托单
/// <summary>
/// 生成委托单
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnGenerate_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnGenerate))
{
var project = BLL.Base_ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
if (project.ProjectArea == "1" || project.ProjectArea == "2")
{
var getViewGenerateTrustLists = (from x in Funs.DB.View_GenerateTrust where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
if (getViewGenerateTrustLists.Count() > 0)
{
var getUnit = BLL.Base_UnitService.GetUnit(this.CurrUser.UnitId);
if (getUnit == null || getUnit.UnitTypeId == "1" || getUnit.UnitTypeId == "2" || getUnit.UnitTypeId == "3")
{
GenerateTrust(getViewGenerateTrustLists);
}
else
{
var getUnitViewGenerateTrustLists = getViewGenerateTrustLists.Where(x => x.UnitId == this.CurrUser.UnitId);
if (getUnitViewGenerateTrustLists.Count() > 0)
{
// 当前单位未委托批
GenerateTrust(getUnitViewGenerateTrustLists.ToList());
}
else
{
Alert.ShowInTop("所属单位审核的点口已全部生成委托单!", MessageBoxIcon.Warning);
}
}
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnGenerate, null);
this.BindGrid();
}
else
{
Alert.ShowInTop("已全部生成委托单!", MessageBoxIcon.Warning);
}
}
else
{
var getViewGenerateTrustLists = (from x in Funs.DB.View_GenerateTrust_FJ where x.ProjectId == this.CurrUser.LoginProjectId select x).ToList();
if (getViewGenerateTrustLists.Count() > 0)
{
var getUnit = BLL.Base_UnitService.GetUnit(this.CurrUser.UnitId);
if (getUnit == null || getUnit.UnitTypeId == "1" || getUnit.UnitTypeId == "2" || getUnit.UnitTypeId == "3")
{
GenerateTrust_FJ(getViewGenerateTrustLists);
}
else
{
var getUnitViewGenerateTrustLists = getViewGenerateTrustLists.Where(x => x.UnitId == this.CurrUser.UnitId);
if (getUnitViewGenerateTrustLists.Count() > 0)
{
// 当前单位未委托批
GenerateTrust_FJ(getUnitViewGenerateTrustLists.ToList());
}
else
{
Alert.ShowInTop("所属单位审核的点口已全部生成委托单!", MessageBoxIcon.Warning);
}
}
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnGenerate, null);
this.BindGrid();
}
else
{
Alert.ShowInTop("已全部生成委托单!", MessageBoxIcon.Warning);
}
}
}
else
{
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
return;
}
}
/// <summary>
/// 生成委托单-宁波
/// </summary>
/// <param name="unitId"></param>
private void GenerateTrust(List<Model.View_GenerateTrust> GenerateTrustLists)
{
Model.HJGLDB db = Funs.DB;
foreach (var trust in GenerateTrustLists)
{
Model.Batch_BatchTrust newBatchTrust = new Model.Batch_BatchTrust();
var project = BLL.Base_ProjectService.GetProjectByProjectId(trust.ProjectId);
var unit = BLL.Base_UnitService.GetUnit(trust.UnitId);
var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(trust.DetectionTypeId);
var area = BLL.Project_WorkAreaService.GetProject_WorkAreaByWorkAreaId(trust.WorkAreaId);
string perfix = string.Empty;
perfix = project.ProjectCode + "-" + unit.UnitCode + "-" + ndt.DetectionTypeCode + "-" + area.WorkAreaCode + "-";
newBatchTrust.TrustBatchCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode", "dbo.Batch_BatchTrust", "TrustBatchCode", project.ProjectId, perfix);
string trustBatchId = SQLHelper.GetNewID(typeof(Model.Batch_BatchTrust));
newBatchTrust.TrustBatchId = trustBatchId;
newBatchTrust.TrustDate = DateTime.Now;
newBatchTrust.ProjectId = trust.ProjectId;
newBatchTrust.UnitId = trust.UnitId;
newBatchTrust.InstallationId = trust.InstallationId;
newBatchTrust.WorkAreaId = trust.WorkAreaId;
newBatchTrust.DetectionTypeId = trust.DetectionTypeId;
BLL.Batch_BatchTrustService.AddBatchTrust(newBatchTrust); // 新增委托单
// 生成委托条件对比
var generateTrustItem = from x in db.View_GenerateTrustItem
where x.ProjectId == trust.ProjectId && x.InstallationId == trust.InstallationId
&& x.WorkAreaId == trust.WorkAreaId && x.UnitId == trust.UnitId
&& x.DetectionTypeId == trust.DetectionTypeId
select x;
string toPointBatch = string.Empty;
// 生成委托明细,并回写点口明细信息
foreach (var item in generateTrustItem)
{
if (BLL.Batch_PointBatchService.GetIsGenerateTrust(item.PointBatchItemId)) ////生成委托单的条件判断
{
toPointBatch = toPointBatch + item.PointBatchId + ",";
Model.Batch_BatchTrustItem trustItem = new Model.Batch_BatchTrustItem
{
TrustBatchItemId = SQLHelper.GetNewID(typeof(Model.Batch_BatchTrustItem)),
TrustBatchId = trustBatchId,
PointBatchItemId = item.PointBatchItemId,
WeldJointId = item.WeldJointId,
CreateDate = DateTime.Now
};
Batch_BatchTrustItemService.AddBatchTrustItem(trustItem);
}
Model.Batch_PointBatchItem pointBatchItem = db.Batch_PointBatchItem.FirstOrDefault(e => e.PointBatchItemId == item.PointBatchItemId);
pointBatchItem.IsBuildTrust = true;
db.SubmitChanges();
}
// 回写委托批对应点口信息
if (!string.IsNullOrEmpty(toPointBatch))
{
List<string> pointBatchList = Funs.GetStrListByStr(toPointBatch, ',');
toPointBatch = toPointBatch.Substring(0, toPointBatch.Length - 1);
var updateTrut = BLL.Batch_BatchTrustService.GetBatchTrustById(trustBatchId);
if (updateTrut != null)
{
updateTrut.TopointBatch = toPointBatch;
BLL.Batch_BatchTrustService.UpdateBatchTrust(updateTrut);
}
}
}
Alert.ShowInTop("已成功生成委托单!", MessageBoxIcon.Success);
}
/// <summary>
/// 生成委托单-福建
/// </summary>
/// <param name="unitId"></param>
private void GenerateTrust_FJ(List<Model.View_GenerateTrust_FJ> GenerateTrustLists)
{
Model.HJGLDB db = Funs.DB;
foreach (var trust in GenerateTrustLists)
{
Model.Batch_BatchTrust newBatchTrust = new Model.Batch_BatchTrust();
var project = BLL.Base_ProjectService.GetProjectByProjectId(trust.ProjectId);
var unit = BLL.Base_UnitService.GetUnit(trust.UnitId);
var ndt = BLL.Base_DetectionTypeService.GetDetectionTypeByDetectionTypeId(trust.DetectionTypeId);
var ins = BLL.Project_InstallationService.GetProject_InstallationByInstallationId(trust.InstallationId);
string perfix = string.Empty;
perfix = unit.UnitCode + "-" + ins.InstallationCode + "-GD-" + ndt.DetectionTypeCode + "-";
newBatchTrust.TrustBatchCode = BLL.SQLHelper.RunProcNewId("SpGetNewCode", "dbo.Batch_BatchTrust", "TrustBatchCode", project.ProjectId, perfix);
string trustBatchId = SQLHelper.GetNewID(typeof(Model.Batch_BatchTrust));
newBatchTrust.TrustBatchId = trustBatchId;
newBatchTrust.TrustDate = DateTime.Now;
newBatchTrust.ProjectId = trust.ProjectId;
newBatchTrust.UnitId = trust.UnitId;
newBatchTrust.InstallationId = trust.InstallationId;
newBatchTrust.WorkAreaId = trust.WorkAreaId;
newBatchTrust.DetectionTypeId = trust.DetectionTypeId;
newBatchTrust.PipelineId = trust.PipelineId;
BLL.Batch_BatchTrustService.AddBatchTrust(newBatchTrust); // 新增委托单
// 生成委托条件对比
var generateTrustItem = from x in db.View_GenerateTrustItem_FJ
where x.ProjectId == trust.ProjectId && x.InstallationId == trust.InstallationId
&& x.WorkAreaId == trust.WorkAreaId && x.UnitId == trust.UnitId
&& x.DetectionTypeId == trust.DetectionTypeId && x.PipelineId == trust.PipelineId
select x;
string toPointBatch = string.Empty;
// 生成委托明细,并回写点口明细信息
foreach (var item in generateTrustItem)
{
if (BLL.Batch_PointBatchService.GetIsGenerateTrust(item.PointBatchItemId)) ////生成委托单的条件判断
{
toPointBatch = toPointBatch + item.PointBatchId + ",";
int? fileNum = null;
if (item.Dia >= 500)
{
fileNum = Batch_BatchTrustItemService.GetFilmNumByRateAndDia(item.DetectionRateValue, item.Dia);
}
Model.Batch_BatchTrustItem trustItem = new Model.Batch_BatchTrustItem
{
TrustBatchItemId = SQLHelper.GetNewID(typeof(Model.Batch_BatchTrustItem)),
TrustBatchId = trustBatchId,
PointBatchItemId = item.PointBatchItemId,
WeldJointId = item.WeldJointId,
FilmNum = fileNum,
CreateDate = DateTime.Now
};
Batch_BatchTrustItemService.AddBatchTrustItem(trustItem);
}
Model.Batch_PointBatchItem pointBatchItem = db.Batch_PointBatchItem.FirstOrDefault(e => e.PointBatchItemId == item.PointBatchItemId);
pointBatchItem.IsBuildTrust = true;
db.SubmitChanges();
}
// 回写批变为已委托状态
if (generateTrustItem.Count() > 0)
{
var batch = BLL.Batch_PointBatchService.GetPointBatchById(generateTrustItem.First().PointBatchId);
batch.IsTrust = true;
Funs.DB.SubmitChanges();
}
// 回写委托批对应点口信息
if (!string.IsNullOrEmpty(toPointBatch))
{
List<string> pointBatchList = Funs.GetStrListByStr(toPointBatch, ',');
toPointBatch = toPointBatch.Substring(0, toPointBatch.Length - 1);
var updateTrut = BLL.Batch_BatchTrustService.GetBatchTrustById(trustBatchId);
if (updateTrut != null)
{
updateTrut.TopointBatch = toPointBatch;
BLL.Batch_BatchTrustService.UpdateBatchTrust(updateTrut);
}
}
}
Alert.ShowInTop("已成功生成委托单!", MessageBoxIcon.Success);
}
#endregion
}
}
@@ -0,0 +1,123 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class PointAudit {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// txtPipelineCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipelineCode;
/// <summary>
/// btnQuery 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnQuery;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnAccept 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAccept;
/// <summary>
/// 取消审核 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button 取消审核;
/// <summary>
/// btnGenerate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnGenerate;
}
}
@@ -0,0 +1,134 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PointForAudit.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.TrustManage.PointForAudit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>委托单打印</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="点口待审核"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="PointBatchItemId"
AllowColumnLocking="true" EnableColumnLines="true" DataIDField="PointBatchItemId"
AllowSorting="true" SortField="PointDate,PipelineCode,WeldJointCode"
SortDirection="DESC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="25" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True"
EnableCheckBoxSelect="true">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="drpNoAudit" runat="server" Label="未审核" LabelAlign="Right" Width="170" LabelWidth="80px">
<f:ListItem Text="-请选择-" Value="0" />
<f:ListItem Text="监理" Value="1" />
<f:ListItem Text="管理公司" Value="2" />
<f:ListItem Text="其它" Value="3" />
</f:DropDownList>
<f:DropDownList ID="drpNde" runat="server" Label="检测方法"
LabelAlign="Right" EnableEdit="true" Width="180" LabelWidth="90px">
</f:DropDownList>
<f:DatePicker runat="server" ID="txtPointStartDate" LabelAlign="Right" LabelWidth="90px"
Label="点口日期" Width="200px">
</f:DatePicker>
<f:DatePicker runat="server" ID="txtPointEndDate" LabelAlign="Right" LabelWidth="40px"
Label="至" Width="150px">
</f:DatePicker>
<f:Button ID="BtnAnalyse" Icon="Find"
runat="server" OnClick="BtnAnalyse_Click">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnJLAudit" Text="监理审核"
runat="server" OnClick="btnJLAudit_Click">
</f:Button>
<f:Button ID="btnGLGSAudit" Text="管理公司审核" Icon="ChartPie"
runat="server" OnClick="btnGLGSAudit_Click">
</f:Button>
<f:Button ID="btnOtherAudit" Text="其它审核" Icon="ChartPie"
runat="server" OnClick="btnOtherAudit_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField HeaderText="批次号" ColumnID="PointBatchCode" DataField="PointBatchCode"
SortField="PointBatchCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="220px" Locked="true">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,ConstructionArea %>" ColumnID="WorkAreaCode" DataField="WorkAreaCode"
SortField="WorkAreaCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="80px" Locked="true">
</f:RenderField>
<f:RenderField HeaderText="管线号" ColumnID="PipelineCode" DataField="PipelineCode"
SortField="PipelineCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="160px" Locked="true">
</f:RenderField>
<f:RenderField HeaderText="焊口代号" ColumnID="WeldJointCode" DataField="WeldJointCode"
SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="80px" Locked="true">
</f:RenderField>
<f:RenderField HeaderText="焊工号" ColumnID="WelderCode" DataField="WelderCode"
SortField="WelderCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Width="100px">
</f:RenderField>
<f:RenderField HeaderText="焊接日期" ColumnID="WeldingDate" DataField="WeldingDate" SortField="WeldingDate"
FieldType="Date" Renderer="Date" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="点口类型" ColumnID="PointState" DataField="PointState" SortField="PointState"
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="80px">
</f:RenderField>
<f:RenderField HeaderText="是否首三口" ColumnID="IsWelderFirst" DataField="IsWelderFirst"
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="95px">
</f:RenderField>
<f:RenderField HeaderText="点口日期" ColumnID="PointDate" DataField="PointDate" SortField="PointDate"
FieldType="Date" Renderer="Date" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="实际寸径" ColumnID="Size" DataField="Size" SortField="Size"
FieldType="Double" HeaderTextAlign="Center" TextAlign="Left" Width="80px">
</f:RenderField>
<f:RenderField HeaderText="管道等级" ColumnID="PipingClassName" DataField="PipingClassName"
SortField="PipingClassName" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="80px">
</f:RenderField>
<f:RenderField HeaderText="监理审核" ColumnID="JLAudit" DataField="JLAudit"
SortField="JLAudit" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="80px">
</f:RenderField>
<f:RenderField HeaderText="管理公司审核" ColumnID="GLGSAudit" DataField="GLGSAudit"
SortField="GLGSAudit" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="110px">
</f:RenderField>
<f:RenderField HeaderText="其他审核" ColumnID="QTAudit" DataField="QTAudit"
SortField="QTAudit" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="80px">
</f:RenderField>
<f:RenderField ColumnID="IsPointAudit" DataField="IsPointAudit"
FieldType="String" Hidden="true">
</f:RenderField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="<%$ Resources:Lan,NumberOfRecordsPerPage %>">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="500" Value="500" />
<f:ListItem Text="<%$ Resources:Lan,AllLines %>" Value="10000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>
@@ -0,0 +1,204 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Reflection;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.WeldingProcess.TrustManage
{
public partial class PointForAudit : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
BLL.Base_DetectionTypeService.InitDetectionTypeDropDownList(drpNde, "", false, "");
drpNde.SelectedValue = "32617d42-24cb-4390-b115-d53c9c9e2c81"; // 默认RT
BindGrid();
}
}
private void BindGrid()
{
string strSql = @"SELECT PointBatchItemId,PointBatchId,PointBatchCode,WeldJointId,PointState,PointDate,WorkAreaCode,
WeldJointCode,JointArea,Size,WelderCode,WeldingDate,PipelineCode,PipingClassName,
(CASE WHEN IsWelderFirst=1 THEN '是' ELSE '否' END) AS IsWelderFirst,
JLAudit,GLGSAudit,QTAudit,IsPointAudit
FROM dbo.View_Batch_PointBatchItem
WHERE PointState IS NOT NULL";
List<SqlParameter> listStr = new List<SqlParameter>();
if (!string.IsNullOrEmpty(this.txtPointStartDate.Text))
{
strSql += " AND PointDate >= @PointStartDate";
listStr.Add(new SqlParameter("@PointStartDate", Convert.ToDateTime(this.txtPointStartDate.Text)));
}
if (!string.IsNullOrEmpty(this.txtPointEndDate.Text))
{
strSql += " AND PointDate < @PointEndDate";
listStr.Add(new SqlParameter("@PointEndDate", Convert.ToDateTime(this.txtPointEndDate.Text).AddDays(1)));
}
if (drpNoAudit.SelectedValue != "0")
{
if (drpNoAudit.SelectedValue == "1")
{
strSql += " AND JLAudit='未审核'";
}
if (drpNoAudit.SelectedValue == "2")
{
strSql += " AND GLGSAudit='未审核'";
}
if (drpNoAudit.SelectedValue == "3")
{
strSql += " AND QTAudit='未审核'";
}
}
else
{
strSql += " AND (JLAudit='未审核' OR GLGSAudit='未审核' OR QTAudit='未审核')";
}
if (drpNde.SelectedValue != null)
{
strSql += " AND DetectionTypeId=@DetectionTypeId";
listStr.Add(new SqlParameter("@DetectionTypeId", drpNde.SelectedValue));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
// tb = GetFilteredTable(Grid1.FilteredData, tb);
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#region
/// <summary>
/// 改变索引事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <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();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
this.BindGrid();
}
#endregion
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
BindGrid();
}
protected void Window2_Close(object sender, WindowCloseEventArgs e)
{
this.BindGrid();
}
protected void btnJLAudit_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointForAuditMenuId, Const.BtnJLAudit))
{
if (Grid1.SelectedRowIndexArray.Length <= 0)
{
Alert.ShowInTop("最少选中一行!", MessageBoxIcon.Warning);
return;
}
string userId = CurrUser.UserId;
foreach (string pointBatchItemId in Grid1.SelectedRowIDArray)
{
var pointBatchItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointBatchItemId);
pointBatchItem.JLAudit = userId;
BLL.Funs.DB.SubmitChanges();
}
Alert.ShowInTop("所选项审核完成!", MessageBoxIcon.Warning);
BindGrid();
}
else
{
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
return;
}
}
protected void btnGLGSAudit_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointForAuditMenuId, Const.BtnGLGSAudit))
{
if (Grid1.SelectedRowIndexArray.Length <= 0)
{
Alert.ShowInTop("最少选中一行!", MessageBoxIcon.Warning);
return;
}
string userId = CurrUser.UserId;
foreach (string pointBatchItemId in Grid1.SelectedRowIDArray)
{
var pointBatchItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointBatchItemId);
pointBatchItem.GLGSAudit = userId;
BLL.Funs.DB.SubmitChanges();
}
Alert.ShowInTop("所选项审核完成!", MessageBoxIcon.Warning);
BindGrid();
}
else
{
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
return;
}
}
protected void btnOtherAudit_Click(object sender, EventArgs e)
{
if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointForAuditMenuId, Const.BtnQTAudit))
{
if (Grid1.SelectedRowIndexArray.Length <= 0)
{
Alert.ShowInTop("最少选中一行!", MessageBoxIcon.Warning);
return;
}
string userId = CurrUser.UserId;
foreach (string pointBatchItemId in Grid1.SelectedRowIDArray)
{
var pointBatchItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointBatchItemId);
pointBatchItem.QTAudit = userId;
BLL.Funs.DB.SubmitChanges();
}
Alert.ShowInTop("所选项审核完成!", MessageBoxIcon.Warning);
BindGrid();
}
else
{
ShowNotify(Resources.Lan.NoPrivilegePrompt, MessageBoxIcon.Warning);
return;
}
}
}
}
@@ -0,0 +1,168 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class PointForAudit {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// drpNoAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpNoAudit;
/// <summary>
/// drpNde 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpNde;
/// <summary>
/// txtPointStartDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtPointStartDate;
/// <summary>
/// txtPointEndDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtPointEndDate;
/// <summary>
/// BtnAnalyse 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button BtnAnalyse;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnJLAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnJLAudit;
/// <summary>
/// btnGLGSAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnGLGSAudit;
/// <summary>
/// btnOtherAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOtherAudit;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
}
}
@@ -0,0 +1,52 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PointItemAudit.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.TrustManage.PointItemAudit" %>
<!DOCTYPE html>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="VBox">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:Label ID="lbAuditMan" runat="server" Label="审核人" LabelAlign="Right"></f:Label>
<f:ToolbarFill ID="ToolbarFill1" runat="server"></f:ToolbarFill>
<f:Button ID="btnSave" Text="提交审核" Icon="SystemSave" runat="server" OnClick="btnSave_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Form ID="SimpleForm1" ShowBorder="true" ShowHeader="false" AutoScroll="true" BodyPadding="10px"
runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:CheckBox ID="IsBatch" runat="server" Label="是否批量审核" LabelAlign="Right" LabelWidth="120"></f:CheckBox>
</Items>
</f:FormRow>
</Rows>
<Rows>
<f:FormRow>
<Items>
<f:CheckBox ID="IsPass" runat="server" Label="是否通过审核" LabelAlign="Right" LabelWidth="120"></f:CheckBox>
</Items>
</f:FormRow>
</Rows>
<Rows>
<f:FormRow>
<Items>
<f:Label runat="server" Text="如批量审核,则这个批里所有点的口都完成审核" LabelWidth="10px"></f:Label>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
</f:Panel>
</form>
</body>
</html>
@@ -0,0 +1,127 @@
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.TrustManage
{
public partial class PointItemAudit : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
lbAuditMan.Text = CurrUser.UserName;
string auditMan = Request.Params["auditMan"];
string pointBatchItemId = Request.Params["PointBatchItemId"];
var pointBatchItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointBatchItemId);
if (pointBatchItem != null)
{
if (auditMan == "JLAudit")
{
if (!string.IsNullOrEmpty(pointBatchItem.JLAudit))
{
IsPass.Checked = true;
}
}
if (auditMan == "GLGSAudit")
{
if (!string.IsNullOrEmpty(pointBatchItem.GLGSAudit))
{
IsPass.Checked = true;
}
}
if (auditMan == "QTAudit")
{
if (!string.IsNullOrEmpty(pointBatchItem.QTAudit))
{
IsPass.Checked = true;
}
}
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
string auditMan = Request.Params["auditMan"];
string pointBatchItemId = Request.Params["PointBatchItemId"];
string userId = CurrUser.UserId;
string auditstr = string.Empty;
var pointBatchItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(pointBatchItemId);
if (IsPass.Checked)
{
if (IsBatch.Checked)
{
if (pointBatchItem != null)
{
var Itemlist = BLL.Batch_PointBatchItemService.GetPointByPointBatchId(pointBatchItem.PointBatchId);
foreach (var item in Itemlist)
{
if (auditMan == "JLAudit")
{
item.JLAudit = userId;
}
if (auditMan == "GLGSAudit")
{
item.GLGSAudit = userId;
}
if (auditMan == "QTAudit")
{
item.QTAudit = userId;
}
BLL.Funs.DB.SubmitChanges();
}
}
}
else
{
if (auditMan == "JLAudit")
{
pointBatchItem.JLAudit = userId;
}
if (auditMan == "GLGSAudit")
{
pointBatchItem.GLGSAudit = userId;
}
if (auditMan == "QTAudit")
{
pointBatchItem.QTAudit = userId;
}
BLL.Funs.DB.SubmitChanges();
}
auditstr = "审核完成!";
}
else
{
if (auditMan == "JLAudit")
{
pointBatchItem.JLAudit = null;
}
if (auditMan == "GLGSAudit")
{
pointBatchItem.GLGSAudit = null;
}
if (auditMan == "QTAudit")
{
pointBatchItem.QTAudit = null;
}
BLL.Funs.DB.SubmitChanges();
auditstr = "取消审核!";
}
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
Alert.ShowInTop(auditstr, MessageBoxIcon.Success);
}
}
}
@@ -0,0 +1,105 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class PointItemAudit {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// lbAuditMan 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbAuditMan;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// IsBatch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox IsBatch;
/// <summary>
/// IsPass 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox IsPass;
}
}
@@ -0,0 +1,285 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PointManage.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.TrustManage.PointManage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>点口管理</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
<style>
.colorredRed {
font-weight: bold;
color: red;
}
.colorredBlue {
font-weight: bold;
color: blue;
}
.f-grid-colheader.f-grid-checkselectionfield .f-grid-checkbox {
display: none;
}
.f-grid-cell.hidethis .f-grid-checkbox {
display: none;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
EnableCollapse="true" Width="320px" Title="<%$ Resources:Lan,PointManage %>" ShowBorder="true" Layout="VBox"
ShowHeader="false" AutoScroll="true" BodyPadding="5px" IconFont="ArrowCircleLeft">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<%-- <f:DropDownList ID="drpState" runat="server" Label="状态" AutoPostBack="true" OnSelectedIndexChanged="Tree_TextChanged"
Width="150px" LabelWidth="75px" LabelAlign="Right">
<f:ListItem Value="1" Text="所有" Selected="true" />
<f:ListItem Value="2" Text="未闭合" />
<f:ListItem Value="3" Text="闭合" />
</f:DropDownList>--%>
<f:DropDownList ID="drpTrust" runat="server" Label="处理状态" AutoPostBack="true" OnSelectedIndexChanged="Tree_TextChanged"
Width="300px" LabelWidth="90px" LabelAlign="Right">
<f:ListItem Value="0" Text="全部"/>
<f:ListItem Value="1" Text="待处理" Selected="true"/>
<f:ListItem Value="2" Text="已处理" />
</f:DropDownList>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="drpNde" runat="server" Label="检测类型" LabelWidth="100px" Width="265px" LabelAlign="Right"
AutoPostBack="true" OnSelectedIndexChanged="Tree_TextChanged">
</f:DropDownList>
</Items>
</f:Toolbar>
<%-- <f:Toolbar ID="Toolbar4" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtWelderCode" runat="server" EmptyText="<%$ Resources:Lan,EnterQueryConditions %>"
AutoPostBack="true" Label="<%$ Resources:Lan,WelderCode %>" LabelWidth="90px"
OnTextChanged="Tree_TextChanged" Width="300px" LabelAlign="Right">
</f:TextBox>
</Items>
</f:Toolbar>--%>
<f:Toolbar ID="Toolbar6" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtPipeCode" runat="server" EmptyText="按管线号查询"
AutoPostBack="true" Label="管线号" LabelWidth="90px"
OnTextChanged="Tree_TextChanged" Width="300px" LabelAlign="Right">
</f:TextBox>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar5" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DatePicker runat="server" DateFormatString="yyyy-MM" Label="焊接月份" ID="txtJotDate"
DisplayType="Month" ShowTodayButton="false" AutoPostBack="true"
OnTextChanged="Tree_TextChanged" LabelWidth="90px" LabelAlign="Right" Width="300px">
</f:DatePicker>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Tree ID="tvControlItem" ShowHeader="false" Title="点口管理节点树" OnNodeCommand="tvControlItem_NodeCommand"
Height="600px" runat="server" ShowBorder="false" EnableCollapse="true" EnableSingleClickExpand="true"
EnableSingleExpand="true" AutoLeafIdentification="true"
EnableTextSelection="true" OnNodeExpand="tvControlItem_TreeNodeExpanded">
</f:Tree>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="<%$ Resources:Lan,PointManage %>"
TitleToolTip="<%$ Resources:Lan,PointManage %>" AutoScroll="true">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:DropDownList ID="drpIsTrust" runat="server" Label="是否委托" AutoPostBack="true" OnSelectedIndexChanged="drpIsTrust_OnSelectedIndexChanged" LabelWidth="85" Width="180px" LabelAlign="Right">
<f:ListItem Text="" Value="0" />
<f:ListItem Text="未委托" Value="1" />
<f:ListItem Text="已委托" Value="2" />
</f:DropDownList>
<f:DropDownList ID="drpIsCompletedPoint" runat="server" Label="处理状态" AutoPostBack="true" OnSelectedIndexChanged="drpIsTrust_OnSelectedIndexChanged" LabelWidth="85" Width="180px" LabelAlign="Right">
<f:ListItem Text="" Value="0" />
<f:ListItem Text="待处理" Value="1" />
<f:ListItem Text="已处理" Value="2" />
</f:DropDownList>
<f:DropDownList ID="drpWelder" runat="server" Label="焊工" AutoPostBack="true" OnSelectedIndexChanged="drpIsTrust_OnSelectedIndexChanged" LabelWidth="65" Width="180px" LabelAlign="Right">
</f:DropDownList>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnGenerate" Text="生成委托单" ToolTip="当前批点口未委托的焊口生成委托单" Icon="TableEdit" runat="server"
OnClick="btnGenerate_Click" >
</f:Button>
<f:Button ID="btnHandGenerate" Text="手动生成委托单" ToolTip="勾选需要生成委托单的焊口手动生成委托单" Icon="TableEdit" runat="server"
OnClick="btnHandGenerate_Click" >
</f:Button>
<f:Button ID="btnbtnOpenResetPoint" Text="打开重新点口" ToolTip="打开重新点口" Icon="ArrowUndo"
runat="server" OnClick="btnbtnOpenResetPoint_Click">
</f:Button>
<f:Button ID="btnClear" Text="手动关闭批" ToolTip="手动关闭批" Icon="ArrowOutLonger" runat="server"
ConfirmText="确定要手动关闭批吗?" OnClick="btnbtnClear_Click">
</f:Button>
<f:Button ID="btnSelectExpandPoint" Text="重新选择扩口" ToolTip="重新选择扩口" Icon="ArrowRefresh"
runat="server" OnClick="btnSelectExpandPoint_Click" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Form ID="SimpleForm1" ShowBorder="true" ShowHeader="false" AutoScroll="true" BodyPadding="10px"
runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:Label ID="txtStartDate" Label="批次开始时间" runat="server" LabelAlign="Right" LabelWidth="110px">
</f:Label>
<f:Label ID="txtEndDate" Label="批次关闭日期" runat="server" LabelAlign="Right" LabelWidth="110px">
</f:Label>
<f:Label ID="txtState" Label="关闭状态" runat="server" LabelAlign="Right" LabelWidth="110px">
</f:Label>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="点口管理" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="PointBatchItemId" AllowCellEditing="true"
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="PointBatchItemId"
AllowSorting="true" SortField="PipelineCode,ConvertJoint" SortDirection="ASC"
OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="100"
OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True" OnRowCommand="Grid1_RowCommand"
OnRowDataBound="Grid1_RowDataBound" KeepCurrentSelection="true">
<Columns>
<f:RowNumberField EnablePagingNumber="true" HeaderText="<%$ Resources:Lan,SerialNumber %>"
Width="45px" HeaderTextAlign="Center" TextAlign="Center" />
<f:CheckBoxField ColumnID="ckbSelect" Width="50px" RenderAsStaticField="false" HeaderText="选择"
TextAlign="Center" Locked="true"/>
<f:RenderField HeaderText="委托状态" ColumnID="IsTrust" DataField="IsTrust"
SortField="IsTrust" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Width="80px" Locked="true">
</f:RenderField>
<f:RenderField HeaderText="处理状态" ColumnID="CompletedState" DataField="CompletedState"
FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Width="80px" Locked="true">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,ConstructionArea %>" ColumnID="WorkAreaCode" DataField="WorkAreaCode"
SortField="WorkAreaCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="90px" Locked="true">
</f:RenderField>
<f:RenderField HeaderText="管线号" ColumnID="PipelineCode" DataField="PipelineCode"
SortField="PipelineCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="200px" Locked="true">
</f:RenderField>
<f:RenderField HeaderText="焊口代号" ColumnID="WeldJointCode" DataField="WeldJointCode"
SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="80px" Locked="true">
</f:RenderField>
<f:RenderField HeaderText="焊工号" ColumnID="WelderCode" DataField="WelderCode"
SortField="WelderCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Width="100px">
</f:RenderField>
<f:RenderField HeaderText="焊接日期" ColumnID="WeldingDate" DataField="WeldingDate" SortField="WeldingDate"
FieldType="Date" Renderer="Date" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
</f:RenderField>
<%-- <f:RenderField HeaderText="焊接区域" ColumnID="JointArea" DataField="JointArea" SortField="JointArea"
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="80px">
</f:RenderField>--%>
<f:RenderField HeaderText="点口类型" ColumnID="PointState" DataField="PointState" SortField="PointState"
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="80px">
</f:RenderField>
<f:RenderField HeaderText="是否首三口" ColumnID="IsWelderFirst" DataField="IsWelderFirst"
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="95px">
</f:RenderField>
<f:RenderField HeaderText="点口日期" ColumnID="PointDate" DataField="PointDate" SortField="PointDate"
FieldType="Date" Renderer="Date" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="返修日期" ColumnID="RepairDate" DataField="RepairDate" SortField="RepairDate"
FieldType="Date" Renderer="Date" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="切除日期" ColumnID="CutDate" DataField="CutDate" SortField="CutDate"
FieldType="Date" Renderer="Date" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="实际寸径" ColumnID="Size" DataField="Size" SortField="Size"
FieldType="Double" HeaderTextAlign="Center" TextAlign="Left" Width="80px">
</f:RenderField>
<f:RenderField HeaderText="管道等级" ColumnID="PipingClassName" DataField="PipingClassName"
SortField="PipingClassName" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="80px">
</f:RenderField>
<%-- <f:RenderField HeaderText="点口审核" ColumnID="PointIsAudit" DataField="PointIsAudit"
SortField="PointIsAudit" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Width="90px">
</f:RenderField> --%>
<f:RenderField HeaderText="备注" ColumnID="Remark" DataField="Remark" SortField="Remark"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="60px">
</f:RenderField>
<f:LinkButtonField Width="90px" ColumnID="JLAudit" DataTextField="JLAudit" HeaderText="监理审核" TextAlign="Center" CommandName="JLAudit"/>
<f:LinkButtonField Width="120px" ColumnID="GLGSAudit" DataTextField="GLGSAudit" HeaderText="管理公司审核" TextAlign="Center" CommandName="GLGSAudit" />
<f:LinkButtonField Width="90px" ColumnID="QTAudit" DataTextField="QTAudit" HeaderText="其他审核" TextAlign="Center" CommandName="QTAudit" />
<f:RenderField ColumnID="IsPointAudit" DataField="IsPointAudit"
FieldType="String" Hidden="true">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="<%$ Resources:Lan,NumberOfRecordsPerPage %>">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="500" Value="500" />
<f:ListItem Text="<%$ Resources:Lan,AllLines %>" Value="10000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="<%$ Resources:Lan,PopForm %>" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" EnableResize="true" runat="server" OnClose="Window1_Close"
IsModal="true" Width="1360px" Height="680px">
</f:Window>
<f:Window ID="Window2" Title="审核" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" EnableResize="true" runat="server" OnClose="Window2_Close"
IsModal="true" Width="480px" Height="320px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnCancelPoint" OnClick="btnCancelPoint_Click" Icon="ArrowRedo" EnablePostBack="true"
runat="server" Text="取消点口" ConfirmText="确认取消当前点口?" ConfirmTarget="Top">
</f:MenuButton>
<f:MenuButton ID="btnCancel" OnClick="btnCancel_Click" Icon="ArrowRedo" EnablePostBack="true"
runat="server" Text="取消扩透" ConfirmText="确认取消当前扩透口?" ConfirmTarget="Top">
</f:MenuButton>
<f:MenuButton ID="btnModefyFristWeld" OnClick="btnModefyFristWeld_Click" Icon="ArrowRedo" EnablePostBack="true"
runat="server" Text="修改首焊" ConfirmText="确认修改当前焊工的首焊?" ConfirmTarget="Top">
</f:MenuButton>
<f:MenuButton ID="btnCut" OnClick="btnCut_Click" EnablePostBack="true"
Icon="Cross" ConfirmText="确认切除当前口?" ConfirmTarget="Top"
runat="server" Text="切除">
</f:MenuButton>
</f:Menu>
</form>
<script>
var menuID = '<%= Menu1.ClientID %>';
// 返回false,来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show();
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,366 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class PointManage {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelLeftRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// drpTrust 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpTrust;
/// <summary>
/// Toolbar3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// drpNde 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpNde;
/// <summary>
/// Toolbar6 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar6;
/// <summary>
/// txtPipeCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipeCode;
/// <summary>
/// Toolbar5 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar5;
/// <summary>
/// txtJotDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtJotDate;
/// <summary>
/// tvControlItem 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tree tvControlItem;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// drpIsTrust 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpIsTrust;
/// <summary>
/// drpIsCompletedPoint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpIsCompletedPoint;
/// <summary>
/// drpWelder 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpWelder;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnGenerate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnGenerate;
/// <summary>
/// btnHandGenerate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnHandGenerate;
/// <summary>
/// btnbtnOpenResetPoint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnbtnOpenResetPoint;
/// <summary>
/// btnClear 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClear;
/// <summary>
/// btnSelectExpandPoint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSelectExpandPoint;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtStartDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtStartDate;
/// <summary>
/// txtEndDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtEndDate;
/// <summary>
/// txtState 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtState;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnCancelPoint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnCancelPoint;
/// <summary>
/// btnCancel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnCancel;
/// <summary>
/// btnModefyFristWeld 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnModefyFristWeld;
/// <summary>
/// btnCut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnCut;
}
}
@@ -0,0 +1,51 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RTTrustReplace.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.TrustManage.RTTrustReplace" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>RT委托替换</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:Label ID="txtReplaceJoint" runat="server" Label="所替换焊口信息" LabelAlign="Right" LabelWidth="150px" Width="550px"></f:Label>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpRtReplace" runat="server" Label="RT检测替换为" LabelWidth="150px" Width="550px" AutoPostBack="true" OnSelectedIndexChanged="drpRtReplace_SelectedIndexChanged" ></f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtTrustCode" runat="server" Label="委托单编号" Enabled="false" LabelWidth="150px" Width="550px"></f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtAcceptLevel" runat="server" Label="合格级别" Enabled="false" LabelWidth="150px" Width="550px"></f:TextBox>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Button ID="btnSave" Icon="SystemSave" runat="server" Text="保存数据" ValidateForms="SimpleForm1"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnClose" EnablePostBack="false" Text="关闭" runat="server" Icon="SystemClose">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</form>
</body>
</html>
@@ -0,0 +1,135 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BLL;
namespace FineUIPro.Web.WeldingProcess.TrustManage
{
public partial class RTTrustReplace : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
LoadData();
BLL.Base_DetectionTypeService.InitDetectionType(drpRtReplace, Resources.Lan.PleaseSelect, true);
string batchTrustItemId = Request.Params["BatchTrustItemId"];
if (!string.IsNullOrEmpty(batchTrustItemId))
{
var tItem = BLL.Batch_BatchTrustItemService.GetBatchTrustItemById(batchTrustItemId);
var jot = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(tItem.WeldJointId);
if (jot != null)
{
var pipe = BLL.Pipeline_PipelineService.GetPipelineByPipelineId(jot.PipelineId);
var rate = BLL.Base_DetectionRateService.GetDetectionRateByDetectionRateId(pipe.DetectionRateId);
txtReplaceJoint.Text = "管线号:" + pipe.PipelineCode + " 焊口号:" + jot.WeldJointCode + " 检测比例:" + rate.DetectionRateCode;
}
}
}
}
protected void drpRtReplace_SelectedIndexChanged(object sender, EventArgs e)
{
if (drpRtReplace.SelectedValue != Const._Null)
{
string batchTrustItemId = Request.Params["BatchTrustItemId"];
string batchCode = string.Empty;
string acceptLevel = string.Empty;
if (!string.IsNullOrEmpty(batchTrustItemId))
{
var tItem = BLL.Batch_BatchTrustItemService.GetBatchTrustItemById(batchTrustItemId);
var batch = BLL.Batch_BatchTrustService.GetBatchTrustById(tItem.TrustBatchId);
batchCode = batch.TrustBatchCode;
var pointItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(tItem.PointBatchItemId);
if (pointItem != null)
{
acceptLevel = pointItem.AcceptLevel;
}
}
// PAUT
if (batchCode != string.Empty)
{
if (drpRtReplace.SelectedValue == "53fafe61-cb36-45d3-aa25-0815ba556604")
{
txtTrustCode.Text = batchCode.Replace("RT", "PAUT");
txtAcceptLevel.Text = "Ⅱ";
}
else
{
txtTrustCode.Text = batchCode.Replace("RT", "PT");
txtAcceptLevel.Text = "Ⅰ";
}
}
}
}
protected void btnSave_Click(object sender, EventArgs e)
{
string batchTrustItemId = Request.Params["BatchTrustItemId"];
if (!string.IsNullOrEmpty(batchTrustItemId) && drpRtReplace.SelectedValue!=Const._Null)
{
var tItem = BLL.Batch_BatchTrustItemService.GetBatchTrustItemById(batchTrustItemId);
var batch = BLL.Batch_BatchTrustService.GetBatchTrustById(tItem.TrustBatchId);
var pointItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(tItem.PointBatchItemId);
Model.Batch_BatchTrust newBatchTrust = new Model.Batch_BatchTrust();
newBatchTrust.TrustBatchCode = txtTrustCode.Text.Trim();
string trustBatchId = SQLHelper.GetNewID(typeof(Model.Batch_BatchTrust));
newBatchTrust.TrustBatchId = trustBatchId;
newBatchTrust.TrustDate = DateTime.Now;
newBatchTrust.ProjectId = batch.ProjectId;
newBatchTrust.UnitId = batch.UnitId;
newBatchTrust.InstallationId = batch.InstallationId;
newBatchTrust.WorkAreaId = batch.WorkAreaId;
newBatchTrust.DetectionTypeId = drpRtReplace.SelectedValue;
newBatchTrust.PipelineId = batch.PipelineId;
newBatchTrust.TopointBatch = pointItem.PointBatchId;
BLL.Batch_BatchTrustService.AddBatchTrust(newBatchTrust); // 新增委托单
// 更新替换焊口委托明细
tItem.TrustBatchId = trustBatchId;
tItem.CreateDate = DateTime.Now;
// 更新原委托单对应的点口批
string[] strArray = batch.TopointBatch.Split(',');
if (strArray.Distinct().Count() > 1)
{
batch.TopointBatch = batch.TopointBatch.Replace(pointItem.PointBatchId, "").Replace(",,", ",");
}
else
{
batch.TopointBatch = strArray.FirstOrDefault();
}
// 更新替换焊口点口明细的合格等级
pointItem.AcceptLevel = txtAcceptLevel.Text;
Funs.DB.SubmitChanges();
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_BatchTrustMenuId, Const.BtnRTTrustReplace, tItem.WeldJointId);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
ShowNotify(Resources.Lan.SaveSuccessfully, MessageBoxIcon.Success);
}
else
{
Alert.ShowInTop("请选择替换的委托类型!", MessageBoxIcon.Warning);
return;
}
}
private void LoadData()
{
btnClose.OnClientClick = ActiveWindow.GetHideReference();
}
}
}
@@ -0,0 +1,105 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class RTTrustReplace {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// txtReplaceJoint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtReplaceJoint;
/// <summary>
/// drpRtReplace 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpRtReplace;
/// <summary>
/// txtTrustCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtTrustCode;
/// <summary>
/// txtAcceptLevel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtAcceptLevel;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnClose 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnClose;
}
}
@@ -0,0 +1,80 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectExpandPoint.aspx.cs"
Inherits="FineUIPro.Web.WeldingProcess.TrustManage.SelectExpandPoint" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>选择扩口</title>
<link href="../res/css/common.css" rel="stylesheet" type="text/css" />
<style>
.colorredRed {
font-weight: bold;
color: red;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="<%$ Resources:Lan,WeldingJointInfo %>"
TitleToolTip="<%$ Resources:Lan,WeldingJointInfo %>" AutoScroll="true">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,WeldingJointInfo %>"
EnableCollapse="true" KeepCurrentSelection="true" runat="server" BoxFlex="1"
DataKeyNames="PointBatchItemId" AllowColumnLocking="true" EnableColumnLines="true"
DataIDField="PointBatchItemId" EnableTextSelection="True" AllowSorting="true" SortField="PipelineCode,WeldJointCode"
SortDirection="ASC" AllowPaging="false" IsDatabasePaging="true" PageSize="10000" EnableCheckBoxSelect="true">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:Label runat="server" ID="lbTitle" CssClass="colorredRed"></f:Label>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:Button ID="btnAccept" Icon="Accept" runat="server" ToolTip="<%$ Resources:Lan,Sure %>"
OnClick="btnAccept_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField HeaderText="<%$ Resources:Lan,PipelineCode %>" ColumnID="PipelineCode"
DataField="PipelineCode" SortField="PipelineCode" FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="180px" ExpandUnusedSpace="true">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,WeldingJointNumber %>" ColumnID="WeldJointCode"
DataField="WeldJointCode" SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="90px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,WeldingDate %>" ColumnID="WeldingDate"
DataField="WeldingDate" SortField="WeldingDate" FieldType="Date" Renderer="Date"
HeaderTextAlign="Center" TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,Area %>" ColumnID="JointArea" DataField="JointArea"
SortField="JointArea" FieldType="String" HeaderTextAlign="Center" TextAlign="Center"
Width="80px">
</f:RenderField>
<f:RenderField HeaderText="点口类型" ColumnID="PointState" DataField="PointState" SortField="PointState"
FieldType="String" HeaderTextAlign="Center" TextAlign="Center" Width="80px">
</f:RenderField>
<f:RenderField HeaderText="点口日期" ColumnID="PointDate" DataField="PointDate" SortField="PointDate"
FieldType="Date" Renderer="Date" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField HeaderText="实际寸径" ColumnID="Size" DataField="Size" SortField="Size"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="80px">
</f:RenderField>
<f:RenderField HeaderText="<%$ Resources:Lan,PipingClass %>" ColumnID="PipingClassName"
DataField="PipingClassName" SortField="PipingClassName" FieldType="String" HeaderTextAlign="Center"
TextAlign="Left" Width="100px">
</f:RenderField>
</Columns>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
</form>
</body>
</html>
@@ -0,0 +1,257 @@
using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using BLL;
namespace FineUIPro.Web.WeldingProcess.TrustManage
{
public partial class SelectExpandPoint : PageBase
{
#region 定义项
/// <summary>
/// 批主键
/// </summary>
public string PointBatchId
{
get
{
return (string)ViewState["PointBatchId"];
}
set
{
ViewState["PointBatchId"] = value;
}
}
#endregion
#region 加载页面
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.PointBatchId = Request.Params["PointBatchId"];
var pointBatch = Batch_PointBatchService.GetPointBatchById(PointBatchId);
if (pointBatch != null)
{
this.lbTitle.Text = "当前批号:" + pointBatch.PointBatchCode;
var pointBatchItemRepairs = (from x in Funs.DB.View_Batch_PointBatchItem
where x.PointBatchId == this.PointBatchId && !x.CutDate.HasValue
&& !x.RepairDate.HasValue && x.PointState == null
select x).ToList();
var pointBatchItem = (from x in Funs.DB.View_Batch_PointBatchItem
where x.PointBatchId == this.PointBatchId && !x.CutDate.HasValue
&& !x.RepairDate.HasValue && x.PointState != null
select x).ToList();
foreach (var ext in pointBatchItem)
{
var trustItem = from x in Funs.DB.Batch_BatchTrustItem
where x.PointBatchItemId == ext.PointBatchItemId
select x;
if (trustItem.Count() == 1) // 如大于1,则表示这个口之前已进过委托单,不能再选了
{
var firstBatchTrustItem = trustItem.FirstOrDefault();
if (firstBatchTrustItem != null)
{
var checkItems = from x in Funs.DB.Batch_NDEItem
where x.NDEItemID == firstBatchTrustItem.TrustBatchItemId
select x;
if (checkItems.Count() == 0) // 还未进检测单
{
pointBatchItemRepairs.Add(ext);
}
else
{
var checkItem = checkItems.FirstOrDefault(x => !x.SubmitDate.HasValue);
if (checkItem != null)
{
pointBatchItemRepairs.Add(ext);
}
}
}
}
if (trustItem.Count() == 0) // 还未进委托单
{
pointBatchItemRepairs.Add(ext);
}
}
if (pointBatchItemRepairs.Count() > 0)
{
BindGrid(pointBatchItemRepairs);
}
}
}
}
#endregion
#region 数据绑定
/// <summary>
/// 数据绑定
/// </summary>
private void BindGrid(List<Model.View_Batch_PointBatchItem> pointBatchItemRepairs)
{
Grid1.DataSource = pointBatchItemRepairs.OrderBy(x=>x.PipelineCode).OrderBy(x=>x.WeldJointCode);
Grid1.DataBind();
string ids = string.Empty;
for (int i = 0; i < this.Grid1.Rows.Count; i++)
{
var pointItem = BLL.Batch_PointBatchItemService.GetPointBatchItemByPointBatchItemId(this.Grid1.Rows[i].DataKeys[0].ToString());
if (pointItem != null)
{
if (pointItem.PointState == "2")
{
ids += pointItem.PointBatchItemId + ",";
}
else if (pointItem.PointState == "1")
{
this.Grid1.Rows[i].RowSelectable = false;
}
}
}
if (!string.IsNullOrEmpty(ids))
{
ids = ids.Substring(0, ids.Length - 1);
this.Grid1.SelectedRowIDArray = ids.Split(',');
}
}
#endregion
#region 确定按钮
/// <summary>
/// 确定按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAccept_Click(object sender, EventArgs e)
{
Model.HJGLDB db = Funs.DB;
string[] selectRowId = Grid1.SelectedRowIDArray;
string weldJointId = string.Empty;
// 找最近一个返修口
var pointItem = db.Batch_PointBatchItem.Where(x => x.PointBatchId == this.PointBatchId && x.PointState != null && x.IsCheckRepair.HasValue);
foreach (var p in pointItem)
{
var j = BLL.Pipeline_WeldJointService.GetWeldJointByWeldJointId(p.WeldJointId);
if (j.WeldJointCode.Contains("K"))
{
weldJointId = p.WeldJointId;
break;
}
}
for (int i = 0; i < this.Grid1.Rows.Count; i++)
{
string pointBatchItemId = this.Grid1.Rows[i].DataKeys[0].ToString();
var pointBatchItem = Funs.DB.Batch_PointBatchItem.FirstOrDefault(x => x.PointBatchItemId == pointBatchItemId);
if (pointBatchItem != null)
{
if (selectRowId.Contains(pointBatchItemId))
{
if (pointItem.Count() > 0 && pointBatchItem.PointState == null)
{
pointBatchItem.PointDate = DateTime.Now;
pointBatchItem.PointState = "2";
db.SubmitChanges(); ////更新批明细 返修日期 状态
int k_num = 0;
string jot = "K1";
Model.Pipeline_WeldJoint jointInfo = null;
if (!String.IsNullOrEmpty(weldJointId))
{
jointInfo = db.Pipeline_WeldJoint.FirstOrDefault(x => x.WeldJointId == weldJointId);
}
else
{
var first = pointItem.FirstOrDefault();
if (first != null)
{
jointInfo = db.Pipeline_WeldJoint.FirstOrDefault(x => x.WeldJointId == first.WeldJointId);
}
}
int indexK = jointInfo.WeldJointCode.LastIndexOf("K");
if (indexK > 0)
{
try
{
k_num = Convert.ToInt32(jointInfo.WeldJointCode.Substring(indexK + 1, 1)) + 1;
jot = "K" + k_num.ToString();
}
catch { }
}
BLL.Batch_PointBatchService.UpdateNewKuoOrCutJointNo(pointBatchItem.PointBatchItemId, jot);
}
}
else
{
// 找到已扩透的明细ID; 找到委托单里的明细.
if (pointBatchItem.PointState == "2")
{
var trust = db.Batch_BatchTrustItem.FirstOrDefault(p => p.PointBatchItemId == pointBatchItem.PointBatchItemId);
if (trust != null)
{
string trustBatchId = trust.TrustBatchId;
var checkItem = db.Batch_NDEItem.FirstOrDefault(x => x.NDEItemID == trust.TrustBatchItemId);
if (checkItem != null)
{
string checkId = checkItem.NDEID;
if (checkItem.SubmitDate == null)
{
// 删除检测单里明细
Batch_NDEItemService.DeleteNDEItemByNDEItemID(checkItem.NDEItemID);
var c = BLL.Batch_NDEItemService.GetNDEItemByNDEID(checkId);
if (c.Count() == 0)
{
// 当没有明细时删除对应主表
BLL.Batch_NDEService.DeleteNDEById(checkId);
}
}
}
if (checkItem == null || (checkItem != null && checkItem.SubmitDate == null))
{
// 删除委托单里明细
Batch_BatchTrustItemService.DeleteTrustItemByTrustBatchItemId(trust.TrustBatchItemId);
var t = BLL.Batch_BatchTrustItemService.GetBatchTrustItemByTrustBatchId(trustBatchId);
if (t.Count() == 0)
{
// 当没有明细时删除对应主表
BLL.Batch_BatchTrustService.DeleteBatchTrustById(trustBatchId);
}
}
}
pointBatchItem.PointDate = null;
pointBatchItem.PointState = null;
pointBatchItem.IsBuildTrust = null;
db.SubmitChanges(); //更新批明细 返修日期 状态
// 更新焊口号
Batch_PointBatchService.CancellationJointNo(pointBatchItem.WeldJointId);
}
}
}
}
// 更新批 是否委托:否
var updatePointBatch = BLL.Batch_PointBatchService.GetPointBatchById(this.PointBatchId);
if (updatePointBatch != null)
{
updatePointBatch.IsTrust = false;
BLL.Batch_PointBatchService.UpdatePointBatch(updatePointBatch);
}
BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.HJGL_PointManageMenuId, Const.BtnSelectResetExpand, this.PointBatchId);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
#endregion
}
}
@@ -0,0 +1,96 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class SelectExpandPoint {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// lbTitle 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbTitle;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// btnAccept 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAccept;
}
}
@@ -0,0 +1,242 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrustBatchManage.aspx.cs"
Inherits="FineUIPro.Web.WeldingProcess.TrustManage.TrustBatchManage" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>无损委托单</title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" ShowBorder="false" ShowHeader="false" Layout="Region">
<Items>
<f:Panel runat="server" ID="panelLeftRegion" RegionPosition="Left" RegionSplit="true"
EnableCollapse="true" Width="300px" Title="<%$ Resources:Lan,NDTTestRequest %>"
ShowBorder="true" Layout="VBox" ShowHeader="false" AutoScroll="true" BodyPadding="5px"
IconFont="ArrowCircleLeft">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DatePicker ID="txtTrustDateMonth" runat="server" Label="<%$ Resources:Lan,Month %>"
EmptyText="<%$ Resources:Lan,EnterQueryConditions %>" AutoPostBack="true" OnTextChanged="Tree_TextChanged"
Width="265px" LabelWidth="100px" DisplayType="Month" DateFormatString="yyyy-MM" LabelAlign="Right">
</f:DatePicker>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar6" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtPipeCode" runat="server" EmptyText="按管线号查询"
AutoPostBack="true" Label="管线号" LabelWidth="100px"
OnTextChanged="Tree_TextChanged" Width="265px" LabelAlign="Right">
</f:TextBox>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar5" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtSearchCode" runat="server" EmptyText="<%$ Resources:Lan,EnterQueryConditions %>"
AutoPostBack="true" Label="<%$ Resources:Lan,RequestSheetNumber %>" LabelWidth="100px"
OnTextChanged="Tree_TextChanged" Width="265px" LabelAlign="Right">
</f:TextBox>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Tree ID="tvControlItem" ShowHeader="false" Height="640px" Title="<%$ Resources:Lan,NDTTestRequest %>"
OnNodeCommand="tvControlItem_NodeCommand" runat="server" ShowBorder="false" EnableCollapse="true"
EnableSingleClickExpand="true" OnNodeExpand="tvControlItem_TreeNodeExpanded" AutoLeafIdentification="true"
EnableTextSelection="true" >
</f:Tree>
</Items>
</f:Panel>
<f:Panel runat="server" ID="panelCenterRegion" RegionPosition="Center" ShowBorder="true"
Layout="VBox" ShowHeader="false" BodyPadding="5px" IconFont="PlusCircle" Title="<%$ Resources:Lan,NDTTestRequest %>"
TitleToolTip="<%$ Resources:Lan,NDTTestRequest %>" AutoScroll="true">
<Toolbars>
<f:Toolbar ID="Toolbar3" Position="Top" runat="server" ToolbarAlign="Right">
<Items>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
<f:TextBox ID="txtTrustCode" runat="server" EmptyText="录入要修改的委托单号" Width="200px"
ShowRedStar="true" Required="true"></f:TextBox>
<f:DropDownList ID="drpNDEUnit" EmptyText="请选择检测单位" runat="server"
ShowRedStar="true" Required="true" EnableEdit="true" Width="210px" >
</f:DropDownList>
<f:DatePicker ID="txtTrustDate" EmptyText="修改委托日期" runat="server" DateFormatString="yyyy-MM-dd"
ShowRedStar="true" Required="true" Width="130px" LabelAlign="Right">
</f:DatePicker>
<f:DropDownList ID="drpSurfaceState" runat="server" EmptyText="请选择表面状态" Hidden="true" Width="135px">
<f:ListItem Value="打磨" Text="打磨"/>
<f:ListItem Value="机加工" Text="机加工"/>
<f:ListItem Value="喷砂" Text="喷砂"/>
<f:ListItem Value="漆面" Text="漆面"/>
</f:DropDownList>
<f:DropDownList ID="drpDetectionTiming" runat="server" EmptyText="请选择检测时机" Hidden="true" Width="135px">
<f:ListItem Value="焊后" Text="焊后"/>
<f:ListItem Value="打磨后" Text="打磨后"/>
<f:ListItem Value="热处理后" Text="热处理后"/>
<f:ListItem Value="坡口准备" Text="坡口准备"/>
<f:ListItem Value="清根后" Text="清根后"/>
<f:ListItem Value="压力试验后" Text="压力试验后"/>
<f:ListItem Value="其他" Text="其他"/>
</f:DropDownList>
<f:TextBox ID="txtQuaCertFile" runat="server" EmptyText="请录入质量证明文件编号" Width="180px" Hidden="true"></f:TextBox>
<f:TextBox ID="txtAcceptStandard" runat="server" EmptyText="请录入制造/验收标准" Width="180px" Hidden="true"></f:TextBox>
<f:Button ID="btnSave" Text="<%$ Resources:Lan,Save %>" ToolTip="<%$ Resources:Lan,Save %>" Icon="SystemSave" runat="server"
OnClick="btnSave_Click">
</f:Button>
<f:Button ID="btnPrint" Text="<%$ Resources:Lan,Print %>" Icon="Printer" runat="server"
OnClick="btnPrint_Click" Hidden="true">
</f:Button>
<f:Button ID="btnExport" Text="打印" ToolTip="导出" EnableAjax="false" DisableControlBeforePostBack="false" Icon="ApplicationGet" runat="server"
OnClick="btnExport_Click">
</f:Button>
<f:Button ID="btnDelete" Text="<%$ Resources:Lan,Delete %>" Icon="Delete" runat="server"
OnClick="btnDelete_Click">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Items>
<f:Form ID="SimpleForm1" ShowBorder="true" ShowHeader="false" AutoScroll="true" BodyPadding="10px"
runat="server" RedStarPosition="BeforeText" LabelAlign="Left">
<Rows>
<f:FormRow ColumnWidths="40% 35% 25%">
<Items>
<f:Label ID="lbTrustUnit" Label="委托单位" runat="server"
LabelWidth="90px" LabelAlign="Right">
</f:Label>
<f:Label ID="txtTrustBatchCode" Label="<%$ Resources:Lan,RequestSheetNumber %>" runat="server"
LabelWidth="90px" LabelAlign="Right">
</f:Label>
<f:Label ID="txtDetectionTypeCode" Label="<%$ Resources:Lan,NDEType %>" runat="server"
LabelWidth="100px" LabelAlign="Right">
</f:Label>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="40% 35% 25%">
<Items>
<f:Label ID="txtname" Label="检件名称" runat="server" Text="管道焊缝"
LabelWidth="90px" LabelAlign="Right">
</f:Label>
<f:Label ID="txtTestStandard" Label="检测标准" runat="server"
LabelWidth="90px" LabelAlign="Right">
</f:Label>
<f:Label ID="txtTestRate" Label="检测比例" runat="server"
LabelWidth="100px" LabelAlign="Right">
</f:Label>
</Items>
</f:FormRow>
<f:FormRow ColumnWidths="25% 25% 25% 25%">
<Items>
<f:Label ID="txtTechLevel" Label="技术等级" runat="server"
LabelWidth="90px" LabelAlign="Right">
</f:Label>
<f:Label ID="txtWeldMothed" Label="焊接方法" runat="server"
LabelWidth="90px" LabelAlign="Right">
</f:Label>
<f:Label ID="txtGrooveType" Label="坡口形式" runat="server"
LabelWidth="90px" LabelAlign="Right">
</f:Label>
<f:Label ID="txtPipClass" Label="压力管道分级" runat="server"
LabelWidth="110px" LabelAlign="Right">
</f:Label>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</Items>
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,NDTTestRequest %>"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="TrustBatchItemId"
AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2"
DataIDField="TrustBatchItemId" AllowSorting="true" SortField="PipelineCode,WeldJointCode"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="25" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True">
<Columns>
<f:RenderField Width="200px" ColumnID="PipelineCode" DataField="PipelineCode" FieldType="String"
HeaderText="<%$ Resources:Lan,PipelineCode %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="PipelineCode">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="WeldJointCode" DataField="WeldJointCode" FieldType="String"
HeaderText="<%$ Resources:Lan,WeldingJointNumber %>" HeaderTextAlign="Center"
TextAlign="Left" SortField="WeldJointCode">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="WelderCode" DataField="WelderCode" FieldType="String"
HeaderText="<%$ Resources:Lan,WelderCode %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="WelderCode">
</f:RenderField>
<f:RenderField Width="180px" ColumnID="MaterialCode" DataField="MaterialCode" FieldType="String" HeaderText="检件材质"
HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="160px" ColumnID="Specification" DataField="Specification" FieldType="String" HeaderText="检件规格(mm)"
HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField HeaderText="备注" ColumnID="IsWelderFirst" DataField="IsWelderFirst"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left"
Width="120px">
</f:RenderField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="<%$ Resources:Lan,NumberOfRecordsPerPage %>">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="10" Value="10" />
<f:ListItem Text="15" Value="15" />
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="25" Value="25" />
<f:ListItem Text="<%$ Resources:Lan,AllLines %>" Value="10000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="<%$ Resources:Lan,PopForm %>" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" EnableResize="true" runat="server" OnClose="Window1_Close"
IsModal="true" Width="1050px" Height="650px">
</f:Window>
<f:Window ID="Window2" Title="<%$ Resources:Lan,PopForm %>" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" EnableResize="true" runat="server"
IsModal="true" Width="900px" Height="560px">
</f:Window>
<f:Window ID="Window3" Title="RT委托替换" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Top" EnableResize="true" runat="server" OnClose="Window1_Close"
IsModal="true" Width="720px" Height="400px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<f:MenuButton ID="btnMenuCancel" OnClick="btnMenuCancel_Click" EnablePostBack="true"
ConfirmText="确定要取消此焊口的委托吗?" ConfirmTarget="Top" runat="server"
Text="取消委托" Icon="Delete">
</f:MenuButton>
<f:MenuButton ID="btnMenuReTrust" OnClick="btnMenuReTrust_Click" EnablePostBack="true"
ConfirmText="确定要恢复此焊口的委托吗?" ConfirmTarget="Top" runat="server"
Text="恢复委托" Icon="ApplicationEdit">
</f:MenuButton>
<f:MenuButton ID="btnMenuRtReplace" OnClick="btnMenuRtReplace_Click" EnablePostBack="true"
runat="server" Text="RT委托替换" Icon="ArrowRefresh" Hidden="true">
</f:MenuButton>
</f:Menu>
</form>
<script type="text/javascript">
var menuID = '<%= Menu1.ClientID %>';
// 返回false,来阻止浏览器右键菜单
function onRowContextMenu(event, rowId) {
F(menuID).show(); //showAt(event.pageX, event.pageY);
return false;
}
function reloadGrid() {
__doPostBack(null, 'reloadGrid');
}
</script>
</body>
</html>
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,438 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class TrustBatchManage {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// panelLeftRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelLeftRegion;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// txtTrustDateMonth 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtTrustDateMonth;
/// <summary>
/// Toolbar6 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar6;
/// <summary>
/// txtPipeCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipeCode;
/// <summary>
/// Toolbar5 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar5;
/// <summary>
/// txtSearchCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtSearchCode;
/// <summary>
/// tvControlItem 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Tree tvControlItem;
/// <summary>
/// panelCenterRegion 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel panelCenterRegion;
/// <summary>
/// Toolbar3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar3;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// txtTrustCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtTrustCode;
/// <summary>
/// drpNDEUnit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpNDEUnit;
/// <summary>
/// txtTrustDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtTrustDate;
/// <summary>
/// drpSurfaceState 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpSurfaceState;
/// <summary>
/// drpDetectionTiming 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpDetectionTiming;
/// <summary>
/// txtQuaCertFile 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtQuaCertFile;
/// <summary>
/// txtAcceptStandard 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtAcceptStandard;
/// <summary>
/// btnSave 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSave;
/// <summary>
/// btnPrint 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnPrint;
/// <summary>
/// btnExport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnExport;
/// <summary>
/// btnDelete 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDelete;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// lbTrustUnit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label lbTrustUnit;
/// <summary>
/// txtTrustBatchCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTrustBatchCode;
/// <summary>
/// txtDetectionTypeCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtDetectionTypeCode;
/// <summary>
/// txtname 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtname;
/// <summary>
/// txtTestStandard 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTestStandard;
/// <summary>
/// txtTestRate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTestRate;
/// <summary>
/// txtTechLevel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtTechLevel;
/// <summary>
/// txtWeldMothed 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtWeldMothed;
/// <summary>
/// txtGrooveType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtGrooveType;
/// <summary>
/// txtPipClass 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label txtPipClass;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
/// <summary>
/// Window1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window1;
/// <summary>
/// Window2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window2;
/// <summary>
/// Window3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window Window3;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuCancel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuCancel;
/// <summary>
/// btnMenuReTrust 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuReTrust;
/// <summary>
/// btnMenuRtReplace 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuRtReplace;
}
}
@@ -0,0 +1,67 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrustBatchOut.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.TrustManage.TrustBatchOut" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>委托单导出</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Rows>
<f:FormRow>
<Items>
<f:DropDownList ID="drpUnit" Label="<%$ Resources:Lan,UnitName %>" runat="server"
ShowRedStar="true" Required="true" EnableEdit="true" LabelWidth="130px" AutoPostBack="true"
OnSelectedIndexChanged="drpUnit_SelectedIndexChanged">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpInstallation" runat="server" Label="<%$ Resources:Lan,InstallationName %>"
LabelAlign="Right" EnableEdit="true" ShowRedStar="true" Required="true" AutoPostBack="true"
OnSelectedIndexChanged="drpInstallation_SelectedIndexChanged" LabelWidth="130px">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpDetectionType" Label="<%$ Resources:Lan,NDEType %>" runat="server"
EnableEdit="true" LabelWidth="130px" ShowRedStar="true" Required="true" AutoPostBack="true"
OnSelectedIndexChanged="drpDetectionType_SelectedIndexChanged">
</f:DropDownList>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:TextBox ID="txtPipelineCode" Label="<%$ Resources:Lan,PipelineCode %>" runat="server"
LabelWidth="130px" AutoPostBack="true" OnTextChanged="txtPipelineCode_TextChanged">
</f:TextBox>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:DropDownList ID="drpBatchTrust" Label="<%$ Resources:Lan,RequestSheetNumber %>"
runat="server" EnableEdit="true" LabelWidth="130px" EnableCheckBoxSelect="true" EnableMultiSelect="true">
</f:DropDownList>
</Items>
</f:FormRow>
</Rows>
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Bottom" ToolbarAlign="Right" runat="server">
<Items>
<f:Button ID="btnExport" OnClick="btnExport_Click" runat="server" Text="导出" ToolTip="Export"
Icon="DoorOut" EnableAjax="false" EnablePress="true" Pressed="false" >
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
</f:Form>
</form>
</body>
</html>
@@ -0,0 +1,175 @@
using BLL;
using NPOI.XSSF.UserModel;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.IO;
using System.Linq;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.WeldingProcess.TrustManage
{
public partial class TrustBatchOut : PageBase
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
BLL.Base_UnitService.InitProjectUnitDropDownList(this.drpUnit, true, this.CurrUser.LoginProjectId, BLL.Const.UnitType_5, Resources.Lan.PleaseSelect);
BLL.Base_DetectionTypeService.InitDetectionTypeDropDownList(this.drpDetectionType, Resources.Lan.PleaseSelect, true, string.Empty);
Funs.FineUIPleaseSelect(this.drpInstallation, Resources.Lan.PleaseSelect);
}
}
#region 单位下拉框变化加载对应的委托单信息
/// <summary>
/// 单位下拉框变化加载对应的委托单信息
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpUnit_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpBatchTrust.Items.Clear();
this.drpInstallation.Items.Clear();
BLL.Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, true, this.CurrUser.LoginProjectId, drpUnit.SelectedValue, Resources.Lan.PleaseSelect);
drpInstallation.SelectedValue = Const._Null;
if (this.drpUnit.SelectedValue != BLL.Const._Null && this.drpInstallation.SelectedValue != BLL.Const._Null && this.drpDetectionType.SelectedValue != BLL.Const._Null)
{
BLL.Batch_BatchTrustService.InitTrustBatchDropDownList(this.drpBatchTrust, true, this.drpUnit.SelectedValue, this.drpInstallation.SelectedValue, this.drpDetectionType.SelectedValue, this.txtPipelineCode.Text.Trim(), Resources.Lan.PleaseSelect);
}
}
#endregion
#region 装置下拉框变化加载对应的委托单信息
/// <summary>
/// 装置下拉框变化加载对应的委托单信息
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpInstallation_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpBatchTrust.Items.Clear();
if (this.drpUnit.SelectedValue != BLL.Const._Null && this.drpInstallation.SelectedValue != BLL.Const._Null && this.drpDetectionType.SelectedValue != BLL.Const._Null)
{
BLL.Batch_BatchTrustService.InitTrustBatchDropDownList(this.drpBatchTrust, true, this.drpUnit.SelectedValue, this.drpInstallation.SelectedValue, this.drpDetectionType.SelectedValue, this.txtPipelineCode.Text.Trim(), Resources.Lan.PleaseSelect);
}
}
#endregion
#region 探伤类型下拉框变化加载对应的委托单信息
/// <summary>
/// 装置下拉框变化加载对应的委托单信息
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void drpDetectionType_SelectedIndexChanged(object sender, EventArgs e)
{
this.drpBatchTrust.Items.Clear();
if (this.drpUnit.SelectedValue != BLL.Const._Null && this.drpInstallation.SelectedValue != BLL.Const._Null && this.drpDetectionType.SelectedValue != BLL.Const._Null)
{
BLL.Batch_BatchTrustService.InitTrustBatchDropDownList(this.drpBatchTrust, true, this.drpUnit.SelectedValue, this.drpInstallation.SelectedValue, this.drpDetectionType.SelectedValue, this.txtPipelineCode.Text.Trim(), Resources.Lan.PleaseSelect);
}
}
#endregion
#region 管线号变化加载对应的委托单信息
/// <summary>
/// 管线号变化加载对应的委托单信息
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void txtPipelineCode_TextChanged(object sender, EventArgs e)
{
this.drpBatchTrust.Items.Clear();
if (this.drpUnit.SelectedValue != BLL.Const._Null && this.drpInstallation.SelectedValue != BLL.Const._Null && this.drpDetectionType.SelectedValue != BLL.Const._Null)
{
BLL.Batch_BatchTrustService.InitTrustBatchDropDownList(this.drpBatchTrust, true, this.drpUnit.SelectedValue, this.drpInstallation.SelectedValue, this.drpDetectionType.SelectedValue, this.txtPipelineCode.Text.Trim(), Resources.Lan.PleaseSelect);
}
}
#endregion
protected void btnExport_Click(object sender, EventArgs e)
{
string rootPath = Server.MapPath("~/") + Const.ExcelUrl;
//模板文件
string TempletFileName = rootPath + "委托单导出.xlsx";
//导出文件
string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\";
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
string ReportFileName = filePath + "out.xlsx";
FileStream file = new FileStream(TempletFileName, FileMode.Open, FileAccess.Read);
XSSFWorkbook hssfworkbook = new XSSFWorkbook(file);
//HSSFWorkbook hssfworkbook = new HSSFWorkbook(file);
#region
XSSFSheet reportModel = (XSSFSheet)hssfworkbook.GetSheet("Sheet1");
//XSSFFont cs_content_Font = (XSSFFont)hssfworkbook.CreateFont(); //创建字体
//cs_content_Font.FontName = "sans-serif";//字体
//cs_content_Font.FontHeightInPoints = 10; //字体大小
string[] trustList = drpBatchTrust.SelectedValueArray;
if (trustList.Count() > 0)
{
var rowIndex = 1;
foreach (var trust in trustList)
{
var trustItemList = from x in Funs.DB.Batch_BatchTrustItem
join y in Funs.DB.Batch_BatchTrust on x.TrustBatchId equals y.TrustBatchId
join z in Funs.DB.Pipeline_WeldJoint on x.WeldJointId equals z.WeldJointId
join p in Funs.DB.Pipeline_Pipeline on z.PipelineId equals p.PipelineId
join u in Funs.DB.Base_Unit on y.NDEUuit equals u.UnitId
where x.TrustBatchId == trust && x.IsCancelTrust == null
select new { y.TrustBatchCode, u.UnitName, p.PipelineCode, z.WeldJointCode };
foreach (var item in trustItemList)
{
if (reportModel.GetRow(rowIndex) == null) reportModel.CreateRow(rowIndex);
#region 列赋值
//TrustBatchCode
if (reportModel.GetRow(rowIndex).GetCell(0) == null) reportModel.GetRow(rowIndex).CreateCell(0);
reportModel.GetRow(rowIndex).GetCell(0).SetCellValue(item.TrustBatchCode);
//UnitName //Contractor
if (reportModel.GetRow(rowIndex).GetCell(2) == null) reportModel.GetRow(rowIndex).CreateCell(2);
reportModel.GetRow(rowIndex).GetCell(2).SetCellValue(item.UnitName);
// PipelineCode
if (reportModel.GetRow(rowIndex).GetCell(3) == null) reportModel.GetRow(rowIndex).CreateCell(3);
reportModel.GetRow(rowIndex).GetCell(3).SetCellValue(item.PipelineCode);
// WeldJointCode
if (reportModel.GetRow(rowIndex).GetCell(4) == null) reportModel.GetRow(rowIndex).CreateCell(4);
reportModel.GetRow(rowIndex).GetCell(4).SetCellValue(item.WeldJointCode);
#endregion
rowIndex++;
}
}
}
#endregion
reportModel.ForceFormulaRecalculation = true;
using (FileStream filess = System.IO.File.OpenWrite(ReportFileName))
{
hssfworkbook.Write(filess);
}
FileInfo filet = new FileInfo(ReportFileName);
Response.Clear();
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF8;
// 添加头信息,为"文件下载/另存为"对话框指定默认文件名
Response.AddHeader("Content-Disposition", "attachment; filename=trust_" + Server.UrlEncode(DateTime.Now.ToString("yyyyMMddhhmmss") + ".xlsx"));
// 添加头信息,指定文件大小,让浏览器能够显示下载进度
Response.AddHeader("Content-Length", filet.Length.ToString());
// 指定返回的是一个不能被客户端读取的流,必须被下载
Response.ContentType = "application/ms-excel";
// 把文件流发送到客户端
Response.WriteFile(filet.FullName);
// 停止页面的执行
Response.End();
}
}
}
@@ -0,0 +1,105 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class TrustBatchOut {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// SimpleForm1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Form SimpleForm1;
/// <summary>
/// drpUnit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpUnit;
/// <summary>
/// drpInstallation 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpInstallation;
/// <summary>
/// drpDetectionType 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpDetectionType;
/// <summary>
/// txtPipelineCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipelineCode;
/// <summary>
/// drpBatchTrust 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpBatchTrust;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// btnExport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnExport;
}
}
@@ -0,0 +1,153 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TrustBatchSelect.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.TrustManage.TrustBatchSelect" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>委托单查询</title>
<link href="../../res/css/common.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="Panel1" runat="server" />
<f:Panel ID="Panel1" runat="server" Margin="5px" BodyPadding="5px" ShowBorder="false"
ShowHeader="false" Layout="VBox" BoxConfigAlign="Stretch">
<Items>
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="<%$ Resources:Lan,NDTTestRequest %>"
EnableCollapse="true" runat="server" BoxFlex="1" DataKeyNames="TrustBatchItemId"
AllowCellEditing="true" AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2"
DataIDField="TrustBatchItemId" AllowSorting="true" SortField="TrustBatchCode,PipelineCode,WeldJointCode"
SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true"
PageSize="20" OnPageIndexChange="Grid1_PageIndexChange" EnableTextSelection="True"
EnableCheckBoxSelect="true">
<Toolbars>
<f:Toolbar ID="Toolbar1" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:DropDownList ID="drpInstallation" runat="server" Label="<%$ Resources:Lan,InstallationCode %>"
LabelAlign="Right" EnableEdit="true" Width="240" LabelWidth="90px" >
</f:DropDownList>
<f:TextBox ID="txtTrustBatchCode" runat="server" Label="<%$ Resources:Lan,RequestSheetNumber %>"
LabelAlign="Right" Width="280px" LabelWidth="90">
</f:TextBox>
<f:DatePicker runat="server" ID="txtTrustDate" LabelAlign="Right" LabelWidth="90px"
Label="<%$ Resources:Lan,TrustDate %>" Width="200px" >
</f:DatePicker>
<f:TextBox ID="txtPipeLineCode" runat="server" Label="管线号"
LabelAlign="Right" Width="240px" LabelWidth="90">
</f:TextBox>
<f:ToolbarFill ID="ToolbarFill2" runat="server">
</f:ToolbarFill>
</Items>
</f:Toolbar>
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox ID="txtWeldJointCode" runat="server" Label="焊口号"
LabelAlign="Right" Width="150px" LabelWidth="80">
</f:TextBox>
<f:TextBox ID="txtWelderCode" runat="server" Label="焊工号"
LabelAlign="Right" Width="150px" LabelWidth="80">
</f:TextBox>
<f:CheckBox ID="ckbFirstTwo" runat="server" Label="是否首三口" LabelAlign="Right" Width="130px" LabelWidth="100"></f:CheckBox>
<f:Label runat="server" Width="100px"></f:Label>
<f:Button ID="BtnAnalyse" Text="<%$ Resources:Lan,Statistics %>" Icon="ChartPie"
runat="server" OnClick="BtnAnalyse_Click">
</f:Button>
<f:Button ID="btnOut" OnClick="btnOut_Click" runat="server" Text="<%$ Resources:Lan,Export %>"
Icon="TableGo" EnableAjax="false" DisableControlBeforePostBack="false">
</f:Button>
<f:Button ID="btnExport" BoxConfigAlign="Center" runat="server" Text="导出RT日委托表" ToolTip="日管道焊口检测委托汇总表(RT)" Icon="DoorOut" EnableAjax="false" DisableControlBeforePostBack="false" OnClick="btnExport_Click" EnablePress="true" Pressed="false">
</f:Button>
<f:ToolbarFill ID="ToolbarFill1" runat="server">
</f:ToolbarFill>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:RenderField Width="220px" ColumnID="TrustBatchCode" DataField="TrustBatchCode" FieldType="String"
HeaderText="<%$ Resources:Lan,RequestSheetNumber %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="TrustBatchCode">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="InstallationCode" DataField="InstallationCode" FieldType="String"
HeaderText="<%$ Resources:Lan,InstallationCode %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="InstallationCode">
</f:RenderField>
<f:RenderField Width="220px" ColumnID="PipelineCode" DataField="PipelineCode" FieldType="String"
HeaderText="<%$ Resources:Lan,PipelineCode %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="PipelineCode">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="WeldJointCode" DataField="WeldJointCode" FieldType="String"
HeaderText="<%$ Resources:Lan,WeldingJointNumber %>" HeaderTextAlign="Center"
TextAlign="Left" SortField="WeldJointCode">
</f:RenderField>
<f:RenderField Width="80px" ColumnID="JointArea" DataField="JointArea" FieldType="String"
HeaderText="<%$ Resources:Lan,WeldingArea %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="JointArea">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="MaterialCode" DataField="MaterialCode" FieldType="String"
HeaderText="<%$ Resources:Lan,MaterialSpecification %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="MaterialCode">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Size" DataField="Size" FieldType="Double"
HeaderText="<%$ Resources:Lan,InchDiameter %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="Size">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="Thickness" DataField="Thickness" FieldType="Double"
HeaderText="<%$ Resources:Lan,WallThickness %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="Thickness">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="WeldTypeCode" DataField="WeldTypeCode" FieldType="String"
HeaderText="<%$ Resources:Lan,WeldingJointType %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="WeldTypeCode">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="WelderCode" DataField="WelderCode" FieldType="String"
HeaderText="<%$ Resources:Lan,WelderCode %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="WelderCode">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="WeldingMethodCode" DataField="WeldingMethodCode"
HeaderText="<%$ Resources:Lan,WeldingMethod %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="WeldingMethodCode" FieldType="String" >
</f:RenderField>
<f:RenderField Width="90px" ColumnID="DetectionRateCode" DataField="DetectionRateCode"
HeaderText="<%$ Resources:Lan,TestPercentage %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="DetectionRateCode" FieldType="String" >
</f:RenderField>
<f:RenderField Width="90px" ColumnID="AcceptLevel" DataField="AcceptLevel" FieldType="String" HeaderText="合格等级"
HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="Sheet" DataField="Sheet" FieldType="String" HeaderText="页数"
HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="120px" ColumnID="TrustDate" DataField="TrustDate"
HeaderText="<%$ Resources:Lan,TrustDate %>" HeaderTextAlign="Center" TextAlign="Left"
SortField="TrustDate" FieldType="String">
</f:RenderField>
<f:RenderField HeaderText="是否首三口" ColumnID="IsWelderFirst" DataField="IsWelderFirst"
FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="100px">
</f:RenderField>
<f:RenderField Width="90px" ColumnID="IsCancelTrust" DataField="IsCancelTrust" HeaderText="取消委托"
HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
<f:RenderField Width="100px" ColumnID="Remark" DataField="Remark" FieldType="String" HeaderText="备注"
HeaderTextAlign="Center" TextAlign="Left">
</f:RenderField>
</Columns>
<PageItems>
<f:ToolbarSeparator ID="ToolbarSeparator1" runat="server">
</f:ToolbarSeparator>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="<%$ Resources:Lan,NumberOfRecordsPerPage %>">
</f:ToolbarText>
<f:DropDownList runat="server" ID="ddlPageSize" Width="80px" AutoPostBack="true"
OnSelectedIndexChanged="ddlPageSize_SelectedIndexChanged">
<f:ListItem Text="20" Value="20" />
<f:ListItem Text="30" Value="30" />
<f:ListItem Text="50" Value="50" />
<f:ListItem Text="100" Value="100" />
<f:ListItem Text="<%$ Resources:Lan,AllLines %>" Value="10000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
</form>
</body>
</html>
@@ -0,0 +1,289 @@
using System;
using System.Collections.Generic;
using AspNet = System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;
using NPOI.HSSF.Util;
using NPOI.SS.UserModel;
using NPOI.SS.Util;
using NPOI.XSSF.UserModel;
using System.Linq;
using System.IO;
using BLL;
using System.Text;
namespace FineUIPro.Web.WeldingProcess.TrustManage
{
public partial class TrustBatchSelect : PageBase
{
#region 加载
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
BLL.Project_InstallationService.InitInstallationDropDownList(this.drpInstallation, true, this.CurrUser.LoginProjectId, Resources.Lan.PleaseSelect);
}
}
/// <summary>
/// 绑定数据
/// </summary>
private void BindGrid()
{
string strSql = @"SELECT * FROM dbo.View_Batch_BatchTrustItemSelect
WHERE PointBatchItemId IS NOT NULL AND ProjectId=@ProjectId ";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (drpInstallation.SelectedValue != Const._Null)
{
strSql += " AND InstallationId = @InstallationId";
listStr.Add(new SqlParameter("@InstallationId", drpInstallation.SelectedValue));
}
if (!string.IsNullOrEmpty(this.txtTrustBatchCode.Text))
{
strSql += " AND TrustBatchCode LIKE @TrustBatchCode";
listStr.Add(new SqlParameter("@TrustBatchCode", "%" + this.txtTrustBatchCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtTrustDate.Text))
{
strSql += " AND TrustDate = @TrustDate";
listStr.Add(new SqlParameter("@TrustDate", this.txtTrustDate.Text));
}
if (!string.IsNullOrEmpty(txtPipeLineCode.Text))
{
strSql += " AND PipelineCode LIKE @PipelineCode";
listStr.Add(new SqlParameter("@PipelineCode", "%" + this.txtPipeLineCode.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(this.txtWeldJointCode.Text))
{
strSql += " AND WeldJointCode = @WeldJointCode";
listStr.Add(new SqlParameter("@WeldJointCode", this.txtWeldJointCode.Text));
}
if (!string.IsNullOrEmpty(this.txtWelderCode.Text))
{
strSql += " AND WelderCode LIKE @WelderCode";
listStr.Add(new SqlParameter("@WelderCode", "%" + this.txtWelderCode.Text.Trim() + "%"));
}
if (this.ckbFirstTwo.Checked)
{
strSql += " AND IsWelderFirst = @IsWelderFirst";
listStr.Add(new SqlParameter("@IsWelderFirst", "是"));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
this.Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
/// <summary>
/// 改变索引事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
{
BindGrid();
}
/// <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();
}
/// <summary>
/// 排序
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
this.BindGrid();
}
#endregion
#region 统计按钮事件
/// <summary>
/// 统计
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void BtnAnalyse_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region 导出按钮
/// 导出按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnOut_Click(object sender, EventArgs e)
{
Response.ClearContent();
string filename = Funs.GetNewFileName();
Response.AddHeader("content-disposition", "attachment; filename=" + System.Web.HttpUtility.UrlEncode(Resources.Lan.RequestSheetNumber + filename, System.Text.Encoding.UTF8) + ".xls");
Response.ContentType = "application/excel";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.Write(GetGridTableHtml(Grid1));
Response.End();
}
/// <summary>
/// 导出方法
/// </summary>
/// <param name="grid"></param>
/// <returns></returns>
private string GetGridTableHtml(Grid grid)
{
StringBuilder sb = new StringBuilder();
grid.PageSize = 1000000;
BindGrid();
sb.Append("<meta http-equiv=\"content-type\" content=\"application/excel; charset=UTF-8\"/>");
sb.Append("<table cellspacing=\"0\" rules=\"all\" border=\"1\" style=\"border-collapse:collapse;\">");
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
sb.AppendFormat("<td>{0}</td>", column.HeaderText);
}
sb.Append("</tr>");
foreach (GridRow row in grid.Rows)
{
sb.Append("<tr>");
foreach (GridColumn column in grid.Columns)
{
string jot = row.Values[column.ColumnIndex].ToString();
string html = string.Empty;
if (column.ColumnID == "WeldJointCode" && jot.Split('-').Length > 1)
{
html = "'" + row.Values[column.ColumnIndex].ToString();
}
else
{
html = row.Values[column.ColumnIndex].ToString();
}
if (column.ColumnID == "tfNumber")
{
html = (row.FindControl("labNumber") as AspNet.Label).Text;
}
sb.AppendFormat("<td>{0}</td>", html);
}
sb.Append("</tr>");
}
sb.Append("</table>");
return sb.ToString();
}
#endregion
protected void btnExport_Click(object sender, EventArgs e)
{
if (drpInstallation.SelectedValue == Const._Null)
{
Alert.ShowInParent("请选择装置!");
return;
}
if (string.IsNullOrEmpty(txtTrustDate.Text))
{
Alert.ShowInParent("请选择导出的委托日期!");
return;
}
string rootPath = Server.MapPath("~/") + Const.ExcelUrl;
//模板文件
string TempletFileName = rootPath + "DailyTrust.xlsx";
//导出文件
string filePath = rootPath + DateTime.Now.ToString("yyyyMMddhhmmss") + "\\";
if (!Directory.Exists(filePath))
{
Directory.CreateDirectory(filePath);
}
string ReportFileName = filePath + "out.xls";
FileStream file = new FileStream(TempletFileName, FileMode.Open, FileAccess.Read);
XSSFWorkbook hssfworkbook = new XSSFWorkbook(file);
XSSFSheet ws = (XSSFSheet)hssfworkbook.GetSheetAt(0);
var project = BLL.Base_ProjectService.GetProjectByProjectId(this.CurrUser.LoginProjectId);
if (ws.GetRow(0).GetCell(6) == null) ws.GetRow(0).CreateCell(6);
ws.GetRow(0).GetCell(6).SetCellValue("工程名称:" + project.ProjectName);
if (ws.GetRow(1).GetCell(2) == null) ws.GetRow(1).CreateCell(2);
ws.GetRow(1).GetCell(2).SetCellValue("日期:"+txtTrustDate.Text);
if (ws.GetRow(1).GetCell(6) == null) ws.GetRow(1).CreateCell(6);
ws.GetRow(1).GetCell(6).SetCellValue("单元名称:" + drpInstallation.SelectedText);
//获取委托单信息
var trustList = Funs.DB.View_Batch_BatchTrustItem.Where(p => p.ProjectId == CurrUser.LoginProjectId && p.InstallationId == drpInstallation.SelectedValue && p.TrustDate == txtTrustDate.Text).ToList();
if (trustList.Count() > 0)
{
int rowindex = 3;
foreach (var item in trustList)
{
if (ws.GetRow(rowindex) == null) ws.CreateRow(rowindex);
if (ws.GetRow(rowindex).GetCell(0) == null) ws.GetRow(rowindex).CreateCell(0);
ws.GetRow(rowindex).GetCell(0).SetCellValue(rowindex-2);
if (ws.GetRow(rowindex).GetCell(1) == null) ws.GetRow(rowindex).CreateCell(1);
ws.GetRow(rowindex).GetCell(1).SetCellValue(item.PipelineCode);
if (ws.GetRow(rowindex).GetCell(2) == null) ws.GetRow(rowindex).CreateCell(2);
ws.GetRow(rowindex).GetCell(2).SetCellValue(item.WeldJointCode);
if (ws.GetRow(rowindex).GetCell(3) == null) ws.GetRow(rowindex).CreateCell(3);
ws.GetRow(rowindex).GetCell(3).SetCellValue(item.WelderCode);
if (ws.GetRow(rowindex).GetCell(4) == null) ws.GetRow(rowindex).CreateCell(4);
ws.GetRow(rowindex).GetCell(4).SetCellValue(item.Specification);
if (ws.GetRow(rowindex).GetCell(5) == null) ws.GetRow(rowindex).CreateCell(5);
ws.GetRow(rowindex).GetCell(5).SetCellValue(item.MaterialCode);
if (ws.GetRow(rowindex).GetCell(6) == null) ws.GetRow(rowindex).CreateCell(6);
ws.GetRow(rowindex).GetCell(6).SetCellValue(item.DetectionRateCode);
if (ws.GetRow(rowindex).GetCell(7) == null) ws.GetRow(rowindex).CreateCell(7);
ws.GetRow(rowindex).GetCell(7).SetCellValue(item.TrustBatchCode);
if (ws.GetRow(rowindex).GetCell(8) == null) ws.GetRow(rowindex).CreateCell(8);
ws.GetRow(rowindex).GetCell(8).SetCellValue(item.Remark);
rowindex++;
}
}
ws.ForceFormulaRecalculation = true;
using (FileStream filess = System.IO.File.OpenWrite(ReportFileName))
{
hssfworkbook.Write(filess);
}
FileInfo filet = new FileInfo(ReportFileName);
Response.Clear();
Response.Charset = "GB2312";
Response.ContentEncoding = System.Text.Encoding.UTF8;
// 添加头信息,为"文件下载/另存为"对话框指定默认文件名
Response.AddHeader("Content-Disposition", "attachment; filename=日管道焊口检测委托单(" + txtTrustDate.Text + ").xlsx");
// 添加头信息,指定文件大小,让浏览器能够显示下载进度
Response.AddHeader("Content-Length", filet.Length.ToString());
// 指定返回的是一个不能被客户端读取的流,必须被下载
Response.ContentType = "application/ms-excel";
// 把文件流发送到客户端
Response.WriteFile(filet.FullName);
// 停止页面的执行
Response.End();
}
}
}
@@ -0,0 +1,204 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.WeldingProcess.TrustManage {
public partial class TrustBatchSelect {
/// <summary>
/// form1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
/// <summary>
/// PageManager1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.PageManager PageManager1;
/// <summary>
/// Panel1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Panel Panel1;
/// <summary>
/// Grid1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid Grid1;
/// <summary>
/// Toolbar1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar1;
/// <summary>
/// drpInstallation 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList drpInstallation;
/// <summary>
/// txtTrustBatchCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtTrustBatchCode;
/// <summary>
/// txtTrustDate 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtTrustDate;
/// <summary>
/// txtPipeLineCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPipeLineCode;
/// <summary>
/// ToolbarFill2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill2;
/// <summary>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// txtWeldJointCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtWeldJointCode;
/// <summary>
/// txtWelderCode 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtWelderCode;
/// <summary>
/// ckbFirstTwo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.CheckBox ckbFirstTwo;
/// <summary>
/// BtnAnalyse 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button BtnAnalyse;
/// <summary>
/// btnOut 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnOut;
/// <summary>
/// btnExport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnExport;
/// <summary>
/// ToolbarFill1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarFill ToolbarFill1;
/// <summary>
/// ToolbarSeparator1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1;
/// <summary>
/// ToolbarText1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.ToolbarText ToolbarText1;
/// <summary>
/// ddlPageSize 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DropDownList ddlPageSize;
}
}