This commit is contained in:
commit
ced9c8a416
|
@ -9,7 +9,7 @@
|
||||||
<section name="FineUIPro" type="FineUIPro.ConfigSection, FineUIPro" requirePermission="false"/>
|
<section name="FineUIPro" type="FineUIPro.ConfigSection, FineUIPro" requirePermission="false"/>
|
||||||
</configSections>
|
</configSections>
|
||||||
<connectionStrings>
|
<connectionStrings>
|
||||||
<add name="HJGLDBConnectionString" connectionString="Data Source=.\sql2016;Initial Catalog=HJGLDB_ZJBSF;uid=sa;pwd=1111;"/>
|
<add name="HJGLDBConnectionString" connectionString="Data Source=.;Initial Catalog=HJGLDB_ZJBSF;uid=sa;pwd=Sh@nghai9;"/>
|
||||||
<!--<add name="HJGLDBConnectionString" connectionString="Data Source=.;Initial Catalog=HJGLDB;Integrated Security=True"
|
<!--<add name="HJGLDBConnectionString" connectionString="Data Source=.;Initial Catalog=HJGLDB;Integrated Security=True"
|
||||||
providerName="System.Data.SqlClient" />-->
|
providerName="System.Data.SqlClient" />-->
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
|
|
|
@ -0,0 +1,177 @@
|
||||||
|
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PMIDetectionEntry.aspx.cs" Inherits="FineUIPro.Web.WeldingProcess.PMI.PMIDetectionEntry" %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
<head runat="server">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||||||
|
<title>PMI检测录入</title>
|
||||||
|
<style>
|
||||||
|
.f-grid-row .f-grid-cell-inner {
|
||||||
|
white-space: normal;
|
||||||
|
word-break: break-all;
|
||||||
|
}
|
||||||
|
</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="280px" Title="<%$ Resources:Lan,TestForm %>" 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="txtNDEDateMonth" 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="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" Title="检测单节点树" OnNodeCommand="tvControlItem_NodeCommand"
|
||||||
|
Height="640px" runat="server" ShowBorder="false" EnableCollapse="true" EnableSingleClickExpand="true"
|
||||||
|
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,TestForm %>"
|
||||||
|
TitleToolTip="<%$ Resources:Lan,TestForm %>" AutoScroll="true">
|
||||||
|
<Toolbars>
|
||||||
|
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||||
|
<Items>
|
||||||
|
<f:HiddenField runat="server" ID="hdPMIId">
|
||||||
|
</f:HiddenField>
|
||||||
|
<f:ToolbarFill ID="ToolbarFill1" runat="server">
|
||||||
|
</f:ToolbarFill>
|
||||||
|
</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="txtDelegationNo" Label="<%$ Resources:Lan,RequestSheetNumber %>"
|
||||||
|
runat="server" LabelAlign="Right" LabelWidth="170px">
|
||||||
|
</f:Label>
|
||||||
|
<f:Label ID="txtDelegationDate" Label="<%$ Resources:Lan,DelegationDate %>" runat="server"
|
||||||
|
LabelAlign="Right" LabelWidth="170px">
|
||||||
|
</f:Label>
|
||||||
|
</Items>
|
||||||
|
</f:FormRow>
|
||||||
|
<f:FormRow>
|
||||||
|
<Items>
|
||||||
|
<f:Label ID="txtInstallationName" Label="<%$ Resources:Lan,InstallationName %>" runat="server"
|
||||||
|
LabelAlign="Right" LabelWidth="170px">
|
||||||
|
</f:Label>
|
||||||
|
<f:Label ID="txtUnitName" Label="<%$ Resources:Lan,UnitName %>" runat="server" LabelAlign="Right"
|
||||||
|
LabelWidth="170px">
|
||||||
|
</f:Label>
|
||||||
|
</Items>
|
||||||
|
</f:FormRow>
|
||||||
|
<f:FormRow>
|
||||||
|
<Items>
|
||||||
|
<f:Label ID="txtDetectionMethod" Label="<%$ Resources:Lan,DetectionMethod %>" runat="server"
|
||||||
|
LabelAlign="Right" LabelWidth="170px">
|
||||||
|
</f:Label>
|
||||||
|
<f:Label ID="txtDetectionStandard" Label="<%$ Resources:Lan,DetectionStandard %>" runat="server"
|
||||||
|
LabelAlign="Right" LabelWidth="170px">
|
||||||
|
</f:Label>
|
||||||
|
</Items>
|
||||||
|
</f:FormRow>
|
||||||
|
<f:FormRow>
|
||||||
|
<Items>
|
||||||
|
<f:Label ID="txtTabler" Label="<%$ Resources:Lan,Lister %>" runat="server" LabelAlign="Right"
|
||||||
|
LabelWidth="170px">
|
||||||
|
</f:Label>
|
||||||
|
<f:Label ID="txtRemark" Label="<%$ Resources:Lan,Remark %>" runat="server" LabelAlign="Right"
|
||||||
|
LabelWidth="170px">
|
||||||
|
</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="NDEItemID" AllowCellEditing="true" AllowColumnLocking="true"
|
||||||
|
EnableColumnLines="true" ClicksToEdit="2" DataIDField="NDEItemID" AllowSorting="true"
|
||||||
|
SortField="PipelineCode,WeldJointCode" SortDirection="ASC" OnSort="Grid1_Sort"
|
||||||
|
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
|
||||||
|
EnableTextSelection="True">
|
||||||
|
<Columns>
|
||||||
|
<f:RowNumberField EnablePagingNumber="true" HeaderText="<%$ Resources:Lan,SerialNumber %>"
|
||||||
|
Width="50px" HeaderTextAlign="Center" TextAlign="Center" />
|
||||||
|
<f:RenderField HeaderText="<%$ Resources:Lan,PipelineCode %>" ColumnID="PipelineCode"
|
||||||
|
DataField="PipelineCode" SortField="PipelineCode" FieldType="String" HeaderTextAlign="Center"
|
||||||
|
TextAlign="Left" Width="220px" Locked="true">
|
||||||
|
</f:RenderField>
|
||||||
|
<f:RenderField HeaderText="<%$ Resources:Lan,WeldingJointNumber %>" ColumnID="WeldJointCode"
|
||||||
|
DataField="WeldJointCode" SortField="WeldJointCode" FieldType="String" HeaderTextAlign="Center"
|
||||||
|
TextAlign="Left" Width="90px" Locked="true">
|
||||||
|
</f:RenderField>
|
||||||
|
<f:RenderField HeaderText="<%$ Resources:Lan,Specifications %>" ColumnID="Specification"
|
||||||
|
DataField="Specification" SortField="Specification" FieldType="String" HeaderTextAlign="Center"
|
||||||
|
TextAlign="Left" Width="170px">
|
||||||
|
</f:RenderField>
|
||||||
|
<f:RenderField HeaderText="<%$ Resources:Lan,MaterialSpecificationCode %>" ColumnID="MaterialCode"
|
||||||
|
DataField="MaterialCode" SortField="MaterialCode" FieldType="String" HeaderTextAlign="Center"
|
||||||
|
TextAlign="Center" Width="120px">
|
||||||
|
</f:RenderField>
|
||||||
|
<f:RenderField HeaderText="<%$ Resources:Lan,TrustDate %>" ColumnID="ProessDate"
|
||||||
|
DataField="ProessDate" SortField="ProessDate" FieldType="Date" Renderer="Date"
|
||||||
|
HeaderTextAlign="Center" TextAlign="Left" Width="120px">
|
||||||
|
</f:RenderField>
|
||||||
|
</Columns>
|
||||||
|
<Listeners>
|
||||||
|
<f:Listener Event="dataload" Handler="onGridDataLoad" />
|
||||||
|
<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:DropDownList>
|
||||||
|
</PageItems>
|
||||||
|
</f:Grid>
|
||||||
|
</Items>
|
||||||
|
</f:Panel>
|
||||||
|
</Items>
|
||||||
|
</f:Panel>
|
||||||
|
</form>
|
||||||
|
<script type="text/javascript">
|
||||||
|
// 返回false,来阻止浏览器右键菜单
|
||||||
|
function onRowContextMenu(event, rowId) {
|
||||||
|
// F(menuID).show(); //showAt(event.pageX, event.pageY);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
function reloadGrid() {
|
||||||
|
__doPostBack(null, 'reloadGrid');
|
||||||
|
}
|
||||||
|
function onGridDataLoad(event) {
|
||||||
|
this.mergeColumns(['PipelineCode']);
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
|
@ -0,0 +1,298 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Linq;
|
||||||
|
using BLL;
|
||||||
|
using System.Web;
|
||||||
|
using System.Collections;
|
||||||
|
using Model;
|
||||||
|
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
|
||||||
|
|
||||||
|
namespace FineUIPro.Web.WeldingProcess.PMI
|
||||||
|
{
|
||||||
|
public partial class PMIDetectionEntry : PageBase
|
||||||
|
{
|
||||||
|
#region 定义项
|
||||||
|
/// <summary>
|
||||||
|
/// 检测单主键
|
||||||
|
/// </summary>
|
||||||
|
public string PMIID
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return (string)ViewState["PMIID"];
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
ViewState["PMIID"] = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
protected void Page_Load(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (!IsPostBack)
|
||||||
|
{
|
||||||
|
this.txtNDEDateMonth.Text = string.Format("{0:yyyy-MM}", DateTime.Now);
|
||||||
|
this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString();
|
||||||
|
this.PMIID = string.Empty;
|
||||||
|
this.InitTreeMenu();//加载树
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 加载树
|
||||||
|
/// <summary>
|
||||||
|
/// 加载树
|
||||||
|
/// </summary>
|
||||||
|
private void InitTreeMenu()
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrEmpty(this.txtNDEDateMonth.Text.Trim()))
|
||||||
|
{
|
||||||
|
DateTime startTime = Convert.ToDateTime(this.txtNDEDateMonth.Text.Trim() + "-01");
|
||||||
|
DateTime endTime = startTime.AddMonths(1);
|
||||||
|
this.tvControlItem.Nodes.Clear();
|
||||||
|
List<Model.Base_Unit> units = new List<Model.Base_Unit>();
|
||||||
|
Model.Project_Unit pUnit = BLL.Project_UnitService.GetProject_UnitByProjectIdUnitId(this.CurrUser.LoginProjectId, this.CurrUser.UnitId);
|
||||||
|
if (pUnit == null || pUnit.UnitType == BLL.Const.UnitType_1 || pUnit.UnitType == BLL.Const.UnitType_2
|
||||||
|
|| pUnit.UnitType == BLL.Const.UnitType_3 || pUnit.UnitType == BLL.Const.UnitType_4
|
||||||
|
|| pUnit.UnitType == BLL.Const.UnitType_6)
|
||||||
|
{
|
||||||
|
units = (from x in Funs.DB.Base_Unit
|
||||||
|
join y in Funs.DB.Project_Unit on x.UnitId equals y.UnitId
|
||||||
|
where y.ProjectId == this.CurrUser.LoginProjectId && y.UnitType.Contains(BLL.Const.UnitType_5)
|
||||||
|
select x).ToList();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
units.Add(BLL.Base_UnitService.GetUnit(this.CurrUser.UnitId));
|
||||||
|
}
|
||||||
|
if (units != null)
|
||||||
|
{
|
||||||
|
foreach (var unit in units)
|
||||||
|
{
|
||||||
|
TreeNode newNode = new TreeNode();//定义根节点
|
||||||
|
newNode.Text = unit.UnitName;
|
||||||
|
newNode.NodeID = unit.UnitId;
|
||||||
|
newNode.Expanded = true;
|
||||||
|
newNode.ToolTip = "Unit";
|
||||||
|
this.tvControlItem.Nodes.Add(newNode);
|
||||||
|
this.BindNodes(newNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Alert.ShowInTop(Resources.Lan.PleaseAddUnitFirst, MessageBoxIcon.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Alert.ShowInTop(Resources.Lan.PleaseSelectTrustMonth, MessageBoxIcon.Warning);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 绑定树节点
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="node"></param>
|
||||||
|
private void BindNodes(TreeNode node)
|
||||||
|
{
|
||||||
|
if (node.ToolTip == "Unit")
|
||||||
|
{
|
||||||
|
///装置
|
||||||
|
var install = (from x in Funs.DB.Project_Installation
|
||||||
|
join y in Funs.DB.PMI_Delegation on x.InstallationId equals y.InstallationId
|
||||||
|
where y.UnitId == node.NodeID && x.ProjectId == this.CurrUser.LoginProjectId
|
||||||
|
orderby x.InstallationCode
|
||||||
|
select x).Distinct();
|
||||||
|
foreach (var q in install)
|
||||||
|
{
|
||||||
|
TreeNode newNode = new TreeNode();
|
||||||
|
newNode.Text = q.InstallationName;
|
||||||
|
newNode.NodeID = q.InstallationId + "|" + node.NodeID;
|
||||||
|
newNode.ToolTip = "Installation";
|
||||||
|
node.Nodes.Add(newNode);
|
||||||
|
BindNodes(newNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (node.ToolTip == "Installation")
|
||||||
|
{
|
||||||
|
string[] unitAndInstallationArr= node.NodeID.Split('|');
|
||||||
|
var ndt = from x in Funs.DB.PMI_Delegation where x.UnitId == unitAndInstallationArr[1]
|
||||||
|
&& x.InstallationId == unitAndInstallationArr[0]
|
||||||
|
&& x.ProjectId == this.CurrUser.LoginProjectId select x;
|
||||||
|
foreach (var q in ndt)
|
||||||
|
{
|
||||||
|
|
||||||
|
TreeNode newNode = new TreeNode();
|
||||||
|
newNode.Text = q.DelegationNo;
|
||||||
|
newNode.NodeID = q.Id;
|
||||||
|
newNode.ToolTip = "DelegationNo";
|
||||||
|
newNode.EnableClickEvent = true;
|
||||||
|
node.Nodes.Add(newNode);
|
||||||
|
BindNodes(newNode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 点击TreeView
|
||||||
|
/// <summary>
|
||||||
|
/// 点击TreeView
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e)
|
||||||
|
{
|
||||||
|
this.PMIID = tvControlItem.SelectedNodeID;
|
||||||
|
this.hdPMIId.Text = this.PMIID;
|
||||||
|
this.BindGrid();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 数据绑定
|
||||||
|
protected void TextBox_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.BindGrid();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 数据绑定
|
||||||
|
/// </summary>
|
||||||
|
private void BindGrid()
|
||||||
|
{
|
||||||
|
if (!string.IsNullOrWhiteSpace(this.hdPMIId.Text) && this.tvControlItem.SelectedNode.ToolTip == "DelegationNo")
|
||||||
|
{
|
||||||
|
this.SetTextTemp();
|
||||||
|
this.PageInfoLoad(); ///页面输入提交信息
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#region 加载页面输入提交信息
|
||||||
|
/// <summary>
|
||||||
|
/// 加载页面输入提交信息
|
||||||
|
/// </summary>
|
||||||
|
private void PageInfoLoad()
|
||||||
|
{
|
||||||
|
this.SimpleForm1.Reset(); ///重置所有字段
|
||||||
|
var pageInfo = (from x in Funs.DB.PMI_Delegation
|
||||||
|
join y in Funs.DB.Base_Unit on x.UnitId equals y.UnitId
|
||||||
|
join n in Funs.DB.Project_Installation on x.InstallationId equals n.InstallationId
|
||||||
|
join u in Funs.DB.Sys_User on x.DetectionStandard equals u.UserId into u1 //左连接查询
|
||||||
|
from u in u1.DefaultIfEmpty()
|
||||||
|
where x.Id==hdPMIId.Text
|
||||||
|
select new { DelegationNo=x.DelegationNo,
|
||||||
|
DelegationDate=x.DelegationDate,
|
||||||
|
InstallationName=n.InstallationName,
|
||||||
|
UnitName=y.UnitName,
|
||||||
|
DetectionMethod="待定",
|
||||||
|
Tabler=x.Tabler,
|
||||||
|
Remark=x.Remark,
|
||||||
|
}).ToList();
|
||||||
|
if (pageInfo.Count>0)
|
||||||
|
{
|
||||||
|
this.txtDelegationNo.Text = pageInfo[0].DelegationNo;
|
||||||
|
this.txtDelegationDate.Text = pageInfo[0].DelegationDate.ToString();
|
||||||
|
this.txtInstallationName.Text = pageInfo[0].InstallationName;
|
||||||
|
this.txtUnitName.Text = pageInfo[0].UnitName;
|
||||||
|
this.txtDetectionMethod.Text = pageInfo[0].DetectionMethod;
|
||||||
|
this.txtTabler.Text = pageInfo[0].Tabler;
|
||||||
|
this.txtRemark.Text = pageInfo[0].Remark;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 清空
|
||||||
|
/// </summary>
|
||||||
|
private void SetTextTemp()
|
||||||
|
{
|
||||||
|
this.txtDelegationNo.Text = string.Empty;
|
||||||
|
this.txtDelegationDate.Text = string.Empty;
|
||||||
|
this.txtInstallationName.Text = string.Empty;
|
||||||
|
this.txtUnitName.Text = string.Empty;
|
||||||
|
this.txtDetectionMethod.Text = string.Empty;
|
||||||
|
this.txtTabler.Text = string.Empty;
|
||||||
|
this.txtRemark.Text = string.Empty;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 分页排序
|
||||||
|
#region 页索引改变事件
|
||||||
|
/// <summary>
|
||||||
|
/// 页索引改变事件
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e)
|
||||||
|
{
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 排序
|
||||||
|
/// <summary>
|
||||||
|
/// 排序
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Grid1_Sort(object sender, GridSortEventArgs e)
|
||||||
|
{
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 分页选择下拉改变事件
|
||||||
|
/// <summary>
|
||||||
|
/// 分页选择下拉改变事件
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue);
|
||||||
|
BindGrid();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 关闭弹出窗口及刷新页面
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查询
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender"></param>
|
||||||
|
/// <param name="e"></param>
|
||||||
|
protected void Tree_TextChanged(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
this.InitTreeMenu();
|
||||||
|
//this.BindGrid();
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 格式化字符串
|
||||||
|
/// <summary>
|
||||||
|
/// 获取缺陷
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="bigType"></param>
|
||||||
|
/// <returns></returns>
|
||||||
|
protected string ConvertCheckDefects(object CheckDefects)
|
||||||
|
{
|
||||||
|
string str = string.Empty;
|
||||||
|
if (CheckDefects != null)
|
||||||
|
{
|
||||||
|
HttpCookie lanCookie = Request.Cookies["SelectLan"];
|
||||||
|
if (lanCookie["lan"] == "zh-CN") //中文
|
||||||
|
{
|
||||||
|
str = BLL.Base_DefectService.GetDefectNameStrByDefectIdStr(CheckDefects.ToString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
str = BLL.Base_DefectService.GetDefectEngNameStrByDefectIdStr(CheckDefects.ToString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,251 @@
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
// <自动生成>
|
||||||
|
// 此代码由工具生成。
|
||||||
|
//
|
||||||
|
// 对此文件的更改可能导致不正确的行为,如果
|
||||||
|
// 重新生成代码,则所做更改将丢失。
|
||||||
|
// </自动生成>
|
||||||
|
//------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
namespace FineUIPro.Web.WeldingProcess.PMI
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
public partial class PMIDetectionEntry
|
||||||
|
{
|
||||||
|
|
||||||
|
/// <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>
|
||||||
|
/// txtNDEDateMonth 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.DatePicker txtNDEDateMonth;
|
||||||
|
|
||||||
|
/// <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>
|
||||||
|
/// Toolbar2 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Toolbar Toolbar2;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// hdPMIId 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.HiddenField hdPMIId;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// ToolbarFill1 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.ToolbarFill ToolbarFill1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// SimpleForm1 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Form SimpleForm1;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtDelegationNo 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Label txtDelegationNo;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtDelegationDate 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Label txtDelegationDate;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtInstallationName 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Label txtInstallationName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtUnitName 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Label txtUnitName;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtDetectionMethod 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Label txtDetectionMethod;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtDetectionStandard 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Label txtDetectionStandard;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtTabler 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Label txtTabler;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// txtRemark 控件。
|
||||||
|
/// </summary>
|
||||||
|
/// <remarks>
|
||||||
|
/// 自动生成的字段。
|
||||||
|
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||||
|
/// </remarks>
|
||||||
|
protected global::FineUIPro.Label txtRemark;
|
||||||
|
|
||||||
|
/// <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;
|
||||||
|
}
|
||||||
|
}
|
|
@ -4094,6 +4094,212 @@ namespace FineUIPro.Web.WeldingProcess.TestPackageManage
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//24-TP-10-渗透&MT检测比例确认表
|
||||||
|
private void template25_1(XSSFWorkbook hssfworkbook, XSSFSheet ws)
|
||||||
|
{
|
||||||
|
int rowIndex = 0;
|
||||||
|
var style = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 10, true, false, "Arial Unicode MS");
|
||||||
|
#region 头部
|
||||||
|
var style1 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.None, BorderStyle.None, BorderStyle.None, BorderStyle.None, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Right, 10, true, false, "Arial Unicode MS");
|
||||||
|
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex, rowIndex, style1, 0, 20, true);
|
||||||
|
|
||||||
|
//设置行宽度
|
||||||
|
ws.SetColumnWidth(0, 13 * 256);
|
||||||
|
ws.SetColumnWidth(1, 3 * 256);
|
||||||
|
ws.SetColumnWidth(2, 10 * 256);
|
||||||
|
for (int i = 3; i < 20; i++)
|
||||||
|
{
|
||||||
|
ws.SetColumnWidth(1, 3 * 256);
|
||||||
|
}
|
||||||
|
ws.SetColumnWidth(20, 23 * 256);
|
||||||
|
|
||||||
|
//设置行高度
|
||||||
|
ws.GetRow(rowIndex).Height = 10 * 20;
|
||||||
|
ws.GetRow(rowIndex).GetCell(20).CellStyle = style1;
|
||||||
|
ws.GetRow(rowIndex).GetCell(20).SetCellValue("Form No. TP-10");
|
||||||
|
|
||||||
|
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 1, rowIndex + 2, style, 0, 20, true);
|
||||||
|
//设置行高度
|
||||||
|
ws.GetRow(rowIndex + 1).Height = 10 * 20 * 9;
|
||||||
|
ws.GetRow(rowIndex + 2).Height = 10 * 20 * 3;
|
||||||
|
|
||||||
|
//合并单元格和填充文本
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 0, 2));
|
||||||
|
ws.GetRow(rowIndex + 1).GetCell(0).SetCellValue("");
|
||||||
|
|
||||||
|
var style3 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 14, true, true, "Arial Unicode MS");
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 3, 17));
|
||||||
|
ws.GetRow(rowIndex + 1).GetCell(3).CellStyle = style3;
|
||||||
|
ws.GetRow(rowIndex + 1).GetCell(3).SetCellValue("管道焊接接头PMI检测比例确认表(一)\nPipeline Welding Joints PMI Examination Rate Confirmation Form(I)\n共 1 页 第 1 页");
|
||||||
|
|
||||||
|
var style2 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Top, NPOI.SS.UserModel.HorizontalAlignment.Left, 10, true, false, "Arial Unicode MS");
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 1, rowIndex + 1, 18, 20));
|
||||||
|
ws.GetRow(rowIndex + 1).GetCell(18).CellStyle = style2;
|
||||||
|
ws.GetRow(rowIndex + 1).GetCell(18).SetCellValue("\n 工程名称:巴斯夫(广东)一体化项目\n Project Name:BASF (Guangdong) Integrated Project\n 单元名称:Citral\n Unit Name:Citral");
|
||||||
|
|
||||||
|
ws.GetRow(rowIndex + 2).GetCell(0).SetCellValue("执行标准\nApplicable code");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 2, rowIndex + 2, 1, 5));
|
||||||
|
ws.GetRow(rowIndex + 2).GetCell(1).SetCellValue("");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 2, rowIndex + 2, 6, 7));
|
||||||
|
ws.GetRow(rowIndex + 2).GetCell(6).SetCellValue("检测方法\nExam. Method");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 2, rowIndex + 2, 8, 15));
|
||||||
|
ws.GetRow(rowIndex + 2).GetCell(8).SetCellValue("PMI检测");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 2, rowIndex + 2, 16, 17));
|
||||||
|
ws.GetRow(rowIndex + 2).GetCell(16).SetCellValue("检测比例\nExam. Rate");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 2, rowIndex + 2, 18, 20));
|
||||||
|
ws.GetRow(rowIndex + 2).GetCell(18).SetCellValue("2%");
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 表格部分
|
||||||
|
|
||||||
|
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 3, rowIndex + 13, style, 0, 20, true);
|
||||||
|
//设置高度和合并列填充文本
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 4, 0, 1));
|
||||||
|
ws.GetRow(rowIndex + 3).GetCell(0).SetCellValue("管道编号\nPipeline No.");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 4, 2, 2));
|
||||||
|
ws.GetRow(rowIndex + 3).GetCell(2).SetCellValue("材质\nMaterial");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 4, 3, 4));
|
||||||
|
ws.GetRow(rowIndex + 3).GetCell(3).SetCellValue("规 格/Size\n mm");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 3, 5, 8));
|
||||||
|
ws.GetRow(rowIndex + 3).GetCell(5).SetCellValue("管道焊接接头\nWelding Joints");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 3, 9, 12));
|
||||||
|
ws.GetRow(rowIndex + 3).GetCell(9).SetCellValue("施焊焊工\nWelder");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 3, 13, 16));
|
||||||
|
ws.GetRow(rowIndex + 3).GetCell(13).SetCellValue("检测焊接接头\nExanined Joints");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 5, 6));
|
||||||
|
ws.GetRow(rowIndex + 4).GetCell(5).SetCellValue("总数\nTotal");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 7, 8));
|
||||||
|
ws.GetRow(rowIndex + 4).GetCell(7).SetCellValue("固定口数\nField Joints");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 9, 10));
|
||||||
|
ws.GetRow(rowIndex + 4).GetCell(9).SetCellValue("焊工代号\nWelder No.");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 11, 12));
|
||||||
|
ws.GetRow(rowIndex + 4).GetCell(11).SetCellValue("施焊数量\nWelded Joints");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 13, 14));
|
||||||
|
ws.GetRow(rowIndex + 4).GetCell(13).SetCellValue("总数\nTotal Joints");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 4, rowIndex + 4, 15, 16));
|
||||||
|
ws.GetRow(rowIndex + 4).GetCell(15).SetCellValue("固定口数\nField Joints");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 4, 17, 19));
|
||||||
|
ws.GetRow(rowIndex + 3).GetCell(17).SetCellValue("实际检测比例\nActual exam. Rate");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 3, rowIndex + 4, 20, 20));
|
||||||
|
ws.GetRow(rowIndex + 3).GetCell(20).SetCellValue("检测报告编号\nExamination Report No.");
|
||||||
|
|
||||||
|
|
||||||
|
for (int i = 3; i < 14; i++)
|
||||||
|
{
|
||||||
|
if (i == 3 || i == 4)
|
||||||
|
{
|
||||||
|
ws.GetRow(rowIndex + i).Height = 30 * 20;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (i == 13)
|
||||||
|
ws.GetRow(rowIndex + i).Height = 30 * 20;
|
||||||
|
else
|
||||||
|
ws.GetRow(rowIndex + i).Height = 19 * 20;
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 0, 1));
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 3, 4));
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 5, 6));
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 7, 8));
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 9, 10));
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 11, 12));
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 13, 14));
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 15, 16));
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + i, rowIndex + i, 17, 19));
|
||||||
|
}
|
||||||
|
ws.GetRow(rowIndex + 13).GetCell(0).SetCellValue("小计\nTotal");
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 尾部
|
||||||
|
|
||||||
|
ws = ExcelCreateRow(ws, hssfworkbook, rowIndex + 14, rowIndex + 16, style, 0, 20, true);
|
||||||
|
//设置行高
|
||||||
|
ws.GetRow(rowIndex + 14).Height = 20 * 20 * 2;
|
||||||
|
ws.GetRow(rowIndex + 15).Height = 20 * 20 * 2;
|
||||||
|
ws.GetRow(rowIndex + 16).Height = 20 * 20 * 7;
|
||||||
|
|
||||||
|
ws.GetRow(rowIndex + 14).GetCell(0).SetCellValue("备注\nRemark");
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 14, rowIndex + 14, 1, 20));
|
||||||
|
|
||||||
|
ws.GetRow(rowIndex + 14).GetCell(1).CellStyle = style2;
|
||||||
|
ws.GetRow(rowIndex + 14).GetCell(1).SetCellValue("焊口位置与检测焊口见管道单线图与无损检测报告。\nPlease refer to Pipeline Iso-drawing and NDE Report for joints position and examined joints.");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 15, rowIndex + 15, 0, 3));
|
||||||
|
ws.GetRow(rowIndex + 15).GetCell(0).SetCellValue("建 设 / 监 理 单 位\nOwner/JianLi Company");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 15, rowIndex + 15, 4, 9));
|
||||||
|
ws.GetRow(rowIndex + 15).GetCell(4).SetCellValue("总 承 包 单 位\nGeneral Contractor");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 15, rowIndex + 15, 10, 16));
|
||||||
|
ws.GetRow(rowIndex + 15).GetCell(10).SetCellValue("检 测 单 位\nExamination Contractor");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 15, rowIndex + 15, 17, 20));
|
||||||
|
ws.GetRow(rowIndex + 15).GetCell(17).SetCellValue("施 工 单 位\nConstruction Company");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 16, rowIndex + 16, 0, 3));
|
||||||
|
ws.GetRow(rowIndex + 16).GetCell(0).CellStyle = style2;
|
||||||
|
ws.GetRow(rowIndex + 16).GetCell(0).SetCellValue("专业工程师\n Discipline Engineer: \n\n\n\n\n\n\n\n 日期Date: 年 月 日");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 16, rowIndex + 16, 4, 9));
|
||||||
|
ws.GetRow(rowIndex + 16).GetCell(4).CellStyle = style2;
|
||||||
|
ws.GetRow(rowIndex + 16).GetCell(4).SetCellValue("专业工程师\n Discipline Engineer: \n\n\n\n\n\n\n\n 日期Date: 年 月 日");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 16, rowIndex + 16, 10, 16));
|
||||||
|
ws.GetRow(rowIndex + 16).GetCell(10).CellStyle = style2;
|
||||||
|
ws.GetRow(rowIndex + 16).GetCell(10).SetCellValue("专业工程师\n Discipline Engineer: \n\n\n\n\n\n\n\n 日期Date: 年 月 日");
|
||||||
|
|
||||||
|
ws.AddMergedRegion(new CellRangeAddress(rowIndex + 16, rowIndex + 16, 17, 20));
|
||||||
|
ws.GetRow(rowIndex + 16).GetCell(17).CellStyle = style2;
|
||||||
|
ws.GetRow(rowIndex + 16).GetCell(17).SetCellValue("专业工程师\n Discipline Engineer: \n\n 质量检查员:\n Quality Inspector:\n\n 制表:\n Prepared:\n\n 日期Date: 年 月 日");
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
ws.PrintSetup.FitWidth = 1;
|
||||||
|
ws.PrintSetup.FitHeight = 0;
|
||||||
|
ws.PrintSetup.PaperSize = (int)PaperSize.A4_Small;
|
||||||
|
|
||||||
|
ws.FitToPage = true;
|
||||||
|
|
||||||
|
//水平垂直居中
|
||||||
|
ws.HorizontallyCenter = true;
|
||||||
|
ws.VerticallyCenter = true;
|
||||||
|
|
||||||
|
//横向打印
|
||||||
|
ws.PrintSetup.Landscape = true;
|
||||||
|
//垂直水平居中
|
||||||
|
ws.VerticallyCenter = true;
|
||||||
|
ws.HorizontallyCenter = true;
|
||||||
|
//打印边距设置 厘米/3
|
||||||
|
ws.SetMargin(MarginType.RightMargin, (double)2.4 / 3);
|
||||||
|
ws.SetMargin(MarginType.LeftMargin, (double)2.4 / 3);
|
||||||
|
ws.SetMargin(MarginType.TopMargin, (double)2.9 / 3);
|
||||||
|
ws.SetMargin(MarginType.BottomMargin, (double)2.4 / 3);
|
||||||
|
|
||||||
|
//页眉页脚间距
|
||||||
|
ws.SetMargin(MarginType.HeaderMargin, 0);
|
||||||
|
ws.SetMargin(MarginType.FooterMargin, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//25-管道无损检测结果汇总表SHT 3503-J412-2017
|
//25-管道无损检测结果汇总表SHT 3503-J412-2017
|
||||||
private void template25(XSSFWorkbook hssfworkbook, XSSFSheet ws)
|
private void template25(XSSFWorkbook hssfworkbook, XSSFSheet ws)
|
||||||
{
|
{
|
||||||
|
|
|
@ -291,32 +291,32 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
|
||||||
ws.GetRow(rowIndex + 2).GetCell(19).SetCellValue("Remark");
|
ws.GetRow(rowIndex + 2).GetCell(19).SetCellValue("Remark");
|
||||||
|
|
||||||
ws.GetRow(rowIndex).Height = 69 * 20;
|
ws.GetRow(rowIndex).Height = 69 * 20;
|
||||||
ws.GetRow(rowIndex + 1).Height = 12 * 20;
|
ws.GetRow(rowIndex + 1).Height = 15 * 20;
|
||||||
ws.GetRow(rowIndex + 2).Height = 24 * 20;
|
ws.GetRow(rowIndex + 2).Height = 30 * 20;
|
||||||
|
|
||||||
ws.SetColumnWidth(0, 4 * 256);
|
ws.SetColumnWidth(0, 4 * 256);
|
||||||
ws.SetColumnWidth(1, (int)(22.67 * 256));
|
ws.SetColumnWidth(1, (int)(22.67 * 256));
|
||||||
ws.SetColumnWidth(2, (int)(9.78 * 256));
|
ws.SetColumnWidth(2, (int)(9.78 * 256));
|
||||||
ws.SetColumnWidth(3, (int)(6.78 * 256));
|
ws.SetColumnWidth(3, (int)(5.33 * 256));
|
||||||
ws.SetColumnWidth(4, (int)(7.67 * 256));
|
ws.SetColumnWidth(4, (int)(7.67 * 256));
|
||||||
ws.SetColumnWidth(5, (int)(8.33 * 256));
|
ws.SetColumnWidth(5, (int)(8.33 * 256));
|
||||||
ws.SetColumnWidth(6, (int)(6.33 * 256));
|
ws.SetColumnWidth(6, (int)(4.42 * 256));
|
||||||
ws.SetColumnWidth(7, (int)(9.11 * 256));
|
ws.SetColumnWidth(7, (int)(10.82 * 256));
|
||||||
ws.SetColumnWidth(8, (int)(8.33 * 256));
|
ws.SetColumnWidth(8, (int)(8.33 * 256));
|
||||||
ws.SetColumnWidth(9, (int)(8.40 * 256));
|
ws.SetColumnWidth(9, (int)(8.40 * 256));
|
||||||
ws.SetColumnWidth(10, (int)(15.67 * 256));
|
ws.SetColumnWidth(10, (int)(15.67 * 256));
|
||||||
ws.SetColumnWidth(11, (int)(11.67 * 256));
|
ws.SetColumnWidth(11, (int)(12 * 256));
|
||||||
ws.SetColumnWidth(12, (int)(8.22 * 256));
|
ws.SetColumnWidth(12, (int)(8.22 * 256));
|
||||||
ws.SetColumnWidth(13, (int)(16.33 * 256));
|
ws.SetColumnWidth(13, (int)(16.33 * 256));
|
||||||
ws.SetColumnWidth(14, (int)(11.22 * 256));
|
ws.SetColumnWidth(14, (int)(11.45 * 256));
|
||||||
ws.SetColumnWidth(15, (int)(10.44 * 256));
|
ws.SetColumnWidth(15, (int)(11.00 * 256));
|
||||||
ws.SetColumnWidth(16, (int)(5.56 * 256));
|
ws.SetColumnWidth(16, (int)(4.00 * 256));
|
||||||
ws.SetColumnWidth(17, (int)(5.56 * 256));
|
ws.SetColumnWidth(17, (int)(4.00 * 256));
|
||||||
ws.SetColumnWidth(18, (int)(7.89 * 256));
|
ws.SetColumnWidth(18, (int)(9.00 * 256));
|
||||||
ws.SetColumnWidth(19, (int)(9.33 * 256));
|
ws.SetColumnWidth(19, (int)(9.33 * 256));
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
const int pageSize = 64;
|
const int pageSize = 67;
|
||||||
DataTable dt = GetDataTable();
|
DataTable dt = GetDataTable();
|
||||||
var style3 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 9, false, false, "sans-serif");
|
var style3 = CommonPrint.SetExcelStyle(hssfworkbook, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, BorderStyle.Thin, VerticalAlignment.Center, NPOI.SS.UserModel.HorizontalAlignment.Center, 9, false, false, "sans-serif");
|
||||||
|
|
||||||
|
@ -370,7 +370,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
|
||||||
var distinctWelder = dt.AsEnumerable().GroupBy(row => row.Field<string>("WelderCode")).Select(group => group.First());
|
var distinctWelder = dt.AsEnumerable().GroupBy(row => row.Field<string>("WelderCode")).Select(group => group.First());
|
||||||
decimal sumSize = decimal.Parse(dt.Compute("sum(Size)", "").ToString());
|
decimal sumSize = decimal.Parse(dt.Compute("sum(Size)", "").ToString());
|
||||||
|
|
||||||
ws.GetRow(dt.Rows.Count + 3).GetCell(0).SetCellValue("合计");
|
ws.GetRow(dt.Rows.Count + 3).GetCell(0).SetCellValue("Total");
|
||||||
ws.GetRow(dt.Rows.Count + 3).GetCell(1).SetCellValue($"{distinctPipelineCode.Count().ToString()}");
|
ws.GetRow(dt.Rows.Count + 3).GetCell(1).SetCellValue($"{distinctPipelineCode.Count().ToString()}");
|
||||||
ws.GetRow(dt.Rows.Count + 3).GetCell(3).SetCellValue($"{dt.Rows.Count}");
|
ws.GetRow(dt.Rows.Count + 3).GetCell(3).SetCellValue($"{dt.Rows.Count}");
|
||||||
ws.GetRow(dt.Rows.Count + 3).GetCell(6).SetCellValue($"{sumSize}");
|
ws.GetRow(dt.Rows.Count + 3).GetCell(6).SetCellValue($"{sumSize}");
|
||||||
|
@ -382,7 +382,7 @@ namespace FineUIPro.Web.WeldingProcess.WeldingReport
|
||||||
|
|
||||||
#region 页脚部分
|
#region 页脚部分
|
||||||
IFooter footer = ws.Footer;
|
IFooter footer = ws.Footer;
|
||||||
string str = "CC7: 监理: Worley:";
|
string str = " CC7: 监理: Worley:";
|
||||||
str += "\n\n第 &P 页,共 &N 页";
|
str += "\n\n第 &P 页,共 &N 页";
|
||||||
footer.Center = str;
|
footer.Center = str;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue