提交代码

This commit is contained in:
高飞 2024-01-26 17:15:34 +08:00
parent b2a5d61e56
commit 36fdd9cfa6
30 changed files with 3871 additions and 22 deletions

View File

@ -53,6 +53,52 @@ GO
CREATE TABLE [dbo].[Transfer_StaticEquipment](
[Id] [nvarchar](50) NOT NULL,
[ProjectId] [nvarchar](50) NULL,
[StaticEquipment] [nvarchar](50) NULL,
[SYSTEM] [nvarchar](50) NULL,
[Subsystem] [nvarchar](50) NULL,
[TestPackage] [nvarchar](50) NULL,
[TestPackageSTART] [datetime] NULL,
[TestPackageFINISH] [datetime] NULL,
[MechanicalFINALStatus] [nvarchar](50) NULL,
CONSTRAINT [PK_Transfer_StaticEquipment] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'StaticEquipment' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Transfer_StaticEquipment'
GO
CREATE TABLE [dbo].[Transfer_RotatingEquipment](
[Id] [nvarchar](50) NOT NULL,
[ProjectId] [nvarchar](50) NULL,
[RotatingEquipment] [nvarchar](50) NULL,
[SYSTEM] [nvarchar](50) NULL,
[Subsystem] [nvarchar](50) NULL,
[TestPackage] [nvarchar](50) NULL,
[TestPackageSTART] [datetime] NULL,
[TestPackageFINISH] [datetime] NULL,
[MechanicalFINALStatus] [nvarchar](50) NULL,
CONSTRAINT [PK_Transfer_RotatingEquipment] PRIMARY KEY CLUSTERED
(
[Id] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'RotatingEquipment' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'Transfer_RotatingEquipment'
GO
CREATE TABLE [dbo].[Transfer_Instrumentation](

View File

@ -769,6 +769,8 @@
<Compile Include="BoSheng\BOSHENGMonitorService.cs" />
<Compile Include="Transfer\PipingService.cs" />
<Compile Include="Transfer\ProjectSetupService.cs" />
<Compile Include="Transfer\RotatingEquipmentService.cs" />
<Compile Include="Transfer\StaticEquipmentService.cs" />
<Compile Include="WebService\MCSWebService.cs" />
<Compile Include="WebService\CNCECHSSEWebService.cs" />
<Compile Include="WebService\CNCECHSSEMonitorService.cs" />

View File

@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class RotatingEquipmentService
{
/// <summary>
/// 根据主键获取设备材料报验信息
/// </summary>
/// <param name="RotatingEquipmentId"></param>
/// <returns></returns>
public static Model.Transfer_RotatingEquipment GetRotatingEquipmentById(string Id)
{
return Funs.DB.Transfer_RotatingEquipment.FirstOrDefault(e => e.Id == Id);
}
/// <summary>
/// 添加设备材料报验
/// </summary>
/// <param name="RotatingEquipment"></param>
public static void AddRotatingEquipment(Model.Transfer_RotatingEquipment RotatingEquipment)
{
Model.SGGLDB db = Funs.DB;
Model.Transfer_RotatingEquipment newRotatingEquipment = new Model.Transfer_RotatingEquipment();
newRotatingEquipment.Id = RotatingEquipment.Id;
newRotatingEquipment.ProjectId = RotatingEquipment.ProjectId;
newRotatingEquipment.RotatingEquipment = RotatingEquipment.RotatingEquipment;
newRotatingEquipment.SYSTEM = RotatingEquipment.SYSTEM;
newRotatingEquipment.Subsystem = RotatingEquipment.Subsystem;
newRotatingEquipment.TestPackage = RotatingEquipment.TestPackage;
newRotatingEquipment.TestPackageSTART = RotatingEquipment.TestPackageSTART;
newRotatingEquipment.TestPackageFINISH = RotatingEquipment.TestPackageFINISH;
newRotatingEquipment.MechanicalFINALStatus = RotatingEquipment.MechanicalFINALStatus;
db.Transfer_RotatingEquipment.InsertOnSubmit(newRotatingEquipment);
db.SubmitChanges();
}
/// <summary>
/// 修改设备材料报验
/// </summary>
/// <param name="RotatingEquipment"></param>
public static void UpdateRotatingEquipment(Model.Transfer_RotatingEquipment RotatingEquipment)
{
Model.SGGLDB db = Funs.DB;
Model.Transfer_RotatingEquipment newRotatingEquipment = db.Transfer_RotatingEquipment.FirstOrDefault(e => e.Id == RotatingEquipment.Id);
if (newRotatingEquipment != null)
{
newRotatingEquipment.ProjectId = RotatingEquipment.ProjectId;
newRotatingEquipment.RotatingEquipment = RotatingEquipment.RotatingEquipment;
newRotatingEquipment.SYSTEM = RotatingEquipment.SYSTEM;
newRotatingEquipment.Subsystem = RotatingEquipment.Subsystem;
newRotatingEquipment.TestPackage = RotatingEquipment.TestPackage;
newRotatingEquipment.TestPackageSTART = RotatingEquipment.TestPackageSTART;
newRotatingEquipment.TestPackageFINISH = RotatingEquipment.TestPackageFINISH;
newRotatingEquipment.MechanicalFINALStatus = RotatingEquipment.MechanicalFINALStatus;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除设备材料报验
/// </summary>
/// <param name="Id"></param>
public static void DeleteRotatingEquipment(string Id)
{
Model.SGGLDB db = Funs.DB;
Model.Transfer_RotatingEquipment RotatingEquipment = db.Transfer_RotatingEquipment.FirstOrDefault(e => e.Id == Id);
if (RotatingEquipment != null)
{
db.Transfer_RotatingEquipment.DeleteOnSubmit(RotatingEquipment);
db.SubmitChanges();
}
}
}
}

View File

@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BLL
{
public class StaticEquipmentService
{
/// <summary>
/// 根据主键获取设备材料报验信息
/// </summary>
/// <param name="StaticEquipmentId"></param>
/// <returns></returns>
public static Model.Transfer_StaticEquipment GetStaticEquipmentById(string Id)
{
return Funs.DB.Transfer_StaticEquipment.FirstOrDefault(e => e.Id == Id);
}
/// <summary>
/// 添加设备材料报验
/// </summary>
/// <param name="StaticEquipment"></param>
public static void AddStaticEquipment(Model.Transfer_StaticEquipment StaticEquipment)
{
Model.SGGLDB db = Funs.DB;
Model.Transfer_StaticEquipment newStaticEquipment = new Model.Transfer_StaticEquipment();
newStaticEquipment.Id = StaticEquipment.Id;
newStaticEquipment.ProjectId = StaticEquipment.ProjectId;
newStaticEquipment.StaticEquipment = StaticEquipment.StaticEquipment;
newStaticEquipment.SYSTEM = StaticEquipment.SYSTEM;
newStaticEquipment.Subsystem = StaticEquipment.Subsystem;
newStaticEquipment.TestPackage = StaticEquipment.TestPackage;
newStaticEquipment.TestPackageSTART = StaticEquipment.TestPackageSTART;
newStaticEquipment.TestPackageFINISH = StaticEquipment.TestPackageFINISH;
newStaticEquipment.MechanicalFINALStatus = StaticEquipment.MechanicalFINALStatus;
db.Transfer_StaticEquipment.InsertOnSubmit(newStaticEquipment);
db.SubmitChanges();
}
/// <summary>
/// 修改设备材料报验
/// </summary>
/// <param name="StaticEquipment"></param>
public static void UpdateStaticEquipment(Model.Transfer_StaticEquipment StaticEquipment)
{
Model.SGGLDB db = Funs.DB;
Model.Transfer_StaticEquipment newStaticEquipment = db.Transfer_StaticEquipment.FirstOrDefault(e => e.Id == StaticEquipment.Id);
if (newStaticEquipment != null)
{
newStaticEquipment.ProjectId = StaticEquipment.ProjectId;
newStaticEquipment.StaticEquipment = StaticEquipment.StaticEquipment;
newStaticEquipment.SYSTEM = StaticEquipment.SYSTEM;
newStaticEquipment.Subsystem = StaticEquipment.Subsystem;
newStaticEquipment.TestPackage = StaticEquipment.TestPackage;
newStaticEquipment.TestPackageSTART = StaticEquipment.TestPackageSTART;
newStaticEquipment.TestPackageFINISH = StaticEquipment.TestPackageFINISH;
newStaticEquipment.MechanicalFINALStatus = StaticEquipment.MechanicalFINALStatus;
db.SubmitChanges();
}
}
/// <summary>
/// 根据主键删除设备材料报验
/// </summary>
/// <param name="Id"></param>
public static void DeleteStaticEquipment(string Id)
{
Model.SGGLDB db = Funs.DB;
Model.Transfer_StaticEquipment StaticEquipment = db.Transfer_StaticEquipment.FirstOrDefault(e => e.Id == Id);
if (StaticEquipment != null)
{
db.Transfer_StaticEquipment.DeleteOnSubmit(StaticEquipment);
db.SubmitChanges();
}
}
}
}

View File

@ -1835,8 +1835,13 @@
<Content Include="Transfer\Instrumentation.aspx" />
<Content Include="Transfer\InstrumentationDataIn.aspx" />
<Content Include="Transfer\Piping.aspx" />
<Content Include="Transfer\PipingDataIn.aspx" />
<Content Include="Transfer\ProjectSetup.aspx" />
<Content Include="Transfer\ProjectSetupDataIn.aspx" />
<Content Include="Transfer\RotatingEquipment.aspx" />
<Content Include="Transfer\RotatingEquipmentDataIn.aspx" />
<Content Include="Transfer\StaticEquipment.aspx" />
<Content Include="Transfer\StaticEquipmentDataIn.aspx" />
<Content Include="Video\Video.aspx" />
<Content Include="ZHGL\DataIn\AccidentCauseReportBar.aspx" />
<Content Include="ZHGL\DataIn\AccidentCauseReportBarIn.aspx" />
@ -16372,6 +16377,13 @@
<Compile Include="Transfer\Piping.aspx.designer.cs">
<DependentUpon>Piping.aspx</DependentUpon>
</Compile>
<Compile Include="Transfer\PipingDataIn.aspx.cs">
<DependentUpon>PipingDataIn.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Transfer\PipingDataIn.aspx.designer.cs">
<DependentUpon>PipingDataIn.aspx</DependentUpon>
</Compile>
<Compile Include="Transfer\ProjectSetup.aspx.cs">
<DependentUpon>ProjectSetup.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -16386,6 +16398,34 @@
<Compile Include="Transfer\ProjectSetupDataIn.aspx.designer.cs">
<DependentUpon>ProjectSetupDataIn.aspx</DependentUpon>
</Compile>
<Compile Include="Transfer\RotatingEquipment.aspx.cs">
<DependentUpon>RotatingEquipment.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Transfer\RotatingEquipment.aspx.designer.cs">
<DependentUpon>RotatingEquipment.aspx</DependentUpon>
</Compile>
<Compile Include="Transfer\RotatingEquipmentDataIn.aspx.cs">
<DependentUpon>RotatingEquipmentDataIn.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Transfer\RotatingEquipmentDataIn.aspx.designer.cs">
<DependentUpon>RotatingEquipmentDataIn.aspx</DependentUpon>
</Compile>
<Compile Include="Transfer\StaticEquipment.aspx.cs">
<DependentUpon>StaticEquipment.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Transfer\StaticEquipment.aspx.designer.cs">
<DependentUpon>StaticEquipment.aspx</DependentUpon>
</Compile>
<Compile Include="Transfer\StaticEquipmentDataIn.aspx.cs">
<DependentUpon>StaticEquipmentDataIn.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="Transfer\StaticEquipmentDataIn.aspx.designer.cs">
<DependentUpon>StaticEquipmentDataIn.aspx</DependentUpon>
</Compile>
<Compile Include="Video\Video.aspx.cs">
<DependentUpon>Video.aspx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress>false</Use64BitIISExpress>
<IISExpressSSLPort />

View File

@ -16,12 +16,24 @@
<f:Grid ID="Grid1" ShowBorder="true" ShowHeader="false" Title="设备材料报验" EnableCollapse="true"
runat="server" BoxFlex="1" DataKeyNames="Id" AllowCellEditing="true" EnableColumnLines="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="PIPINGLINENUMBER"
SortDirection="DESC" OnSort="Grid1_Sort"
SortDirection="ASC" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="true">
<Toolbars>
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox runat="server" ID="txtPIPINGLINENUMBER" Label="PIPINGLINENUMBER" LabelWidth="180px" LabelAlign="Right"></f:TextBox>
<f:DatePicker runat="server" Label="Test_Package_START" ID="txtStarTime" LabelAlign="Right" LabelWidth="150px"
Width="280px">
</f:DatePicker>
<f:Label ID="Label1" runat="server" Text="至">
</f:Label>
<f:DatePicker runat="server" ID="txtEndTime" LabelAlign="Right" Width="150px">
</f:DatePicker>
<f:Button ID="btnSearch" Icon="SystemSearch" EnablePostBack="true" runat="server" OnClick="btnSearch_Click" ToolTip="查询">
</f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnImport" ToolTip="导入" Icon="PackageIn" runat="server" OnClick="btnImport_Click" Hidden="true">
</f:Button>
@ -38,43 +50,47 @@
<f:GroupField ID="g1" HeaderText="PIPING" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="PIPINGLINENUMBER" DataField="PIPINGLINENUMBER" FieldType="String" HeaderText="PIPING/LINE NUMBER" TextAlign="Center"
HeaderTextAlign="Center" Width="150px">
HeaderTextAlign="Center" Width="170px">
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField ID="g2" HeaderText="SYSTEM AND TEST PACKAGE SELECTION" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="SYSTEM" DataField="SYSTEM" FieldType="String" HeaderText="SYSTEM" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="Subsystem" DataField="Subsystem" FieldType="String" HeaderText="Subsystem" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="TestPackage" DataField="TestPackage" FieldType="String" HeaderText="Test Package" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField ID="g3" HeaderText="Test Package Schedule" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="TestPackageSTART" DataField="TestPackageSTART" FieldType="String" HeaderText="Test Package<br/>START" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
<f:RenderField ColumnID="TestPackageSTART" DataField="TestPackageSTART" FieldType="Date" Renderer="Date" HeaderText="Test Package<br/>START" TextAlign="Center"
HeaderTextAlign="Center" Width="130px">
</f:RenderField>
<f:RenderField ColumnID="TestPackageFINISH" DataField="TestPackageFINISH" FieldType="String" HeaderText="Test Package<br/>FINISH" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="DescriptionArea" DataField="DescriptionArea" FieldType="String" HeaderText="Description<br/>(Area)" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
<f:RenderField ColumnID="TestPackageFINISH" DataField="TestPackageFINISH" FieldType="Date" Renderer="Date" HeaderText="Test Package<br/>FINISH" TextAlign="Center"
HeaderTextAlign="Center" Width="130px">
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField ID="g4" HeaderText="PRE-TEST/CHECK" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="FINALStatus" DataField="FINALStatus" FieldType="String" HeaderText="FINAL Status" TextAlign="Center"
HeaderTextAlign="Center" Width="100px">
HeaderTextAlign="Center" Width="130px">
</f:RenderField>
<f:RenderField ColumnID="PreTestFINISHED" DataField="PreTestFINISHED" FieldType="String" HeaderText="Pre-Test FINISHED?" TextAlign="Center"
HeaderTextAlign="Center" Width="150px">
HeaderTextAlign="Center" Width="170px">
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField ID="g5" HeaderText="WITNESS TEST/CHECK<br/>BY OWNER" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="FinalTestFINISHED" DataField="FinalTestFINISHED" FieldType="String" HeaderText="Final Test FINISHED?" ExpandUnusedSpace="true" TextAlign="Center"
HeaderTextAlign="Center" Width="200px">
</f:RenderField>
</Columns>
</f:GroupField>

View File

@ -30,10 +30,25 @@ namespace FineUIPro.Web.Transfer
/// </summary>
public void BindGrid()
{
string strSql = @"select * from Transfer_ProjectSetup C
string strSql = @"select * from Transfer_Piping C
where C.ProjectId = @ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (!string.IsNullOrEmpty(this.txtPIPINGLINENUMBER.Text.Trim()))
{
strSql += " AND PIPINGLINENUMBER like @PIPINGLINENUMBER";
listStr.Add(new SqlParameter("@PIPINGLINENUMBER", "%" + this.txtPIPINGLINENUMBER.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
{
strSql += " AND TestPackageSTART >= @InspectionDateA";
listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim())));
}
if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
{
strSql += " AND TestPackageSTART <= @InspectionDateZ";
listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim())));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
@ -154,10 +169,10 @@ namespace FineUIPro.Web.Transfer
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var data = BLL.ProjectSetupService.GetProjectSetupById(rowID);
var data = BLL.PipingService.GetPipingById(rowID);
if (data != null)
{
BLL.ProjectSetupService.DeleteProjectSetup(rowID);
BLL.PipingService.DeletePiping(rowID);
}
}
BindGrid();
@ -174,7 +189,7 @@ namespace FineUIPro.Web.Transfer
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("ProjectSetupDataIn.aspx", "导入 - ")));
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("PipingDataIn.aspx", "导入 - ")));
}
#endregion
@ -190,7 +205,7 @@ namespace FineUIPro.Web.Transfer
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.ProjectSetupMenuId);
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.PipingMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnDelete))

View File

@ -57,6 +57,51 @@ namespace FineUIPro.Web.Transfer {
/// </remarks>
protected global::FineUIPro.Toolbar ToolSearch;
/// <summary>
/// txtPIPINGLINENUMBER 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtPIPINGLINENUMBER;
/// <summary>
/// txtStarTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtStarTime;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// txtEndTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndTime;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// btnImport 控件。
/// </summary>
@ -111,6 +156,15 @@ namespace FineUIPro.Web.Transfer {
/// </remarks>
protected global::FineUIPro.GroupField g4;
/// <summary>
/// g5 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupField g5;
/// <summary>
/// ToolbarText1 控件。
/// </summary>

View File

@ -0,0 +1,68 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="PipingDataIn.aspx.cs" Inherits="FineUIPro.Web.Transfer.PipingDataIn" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
<Items>
<f:HiddenField ID="hdFileName" runat="server">
</f:HiddenField>
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="审核" ValidateForms="SimpleForm1" Text="审核"
OnClick="btnAudit_Click">
</f:Button>
<f:Button ID="btnImport" Icon="ApplicationGet" runat="server" ToolTip="导入" ValidateForms="SimpleForm1" Text="导入"
OnClick="btnImport_Click">
</f:Button>
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载模板" OnClick="btnDownLoad_Click" Text="下载模板">
</f:Button>
<f:HiddenField ID="hdCheckResult" runat="server">
</f:HiddenField>
</Items>
</f:Toolbar>
</Toolbars>
<Rows>
<f:FormRow>
<Items>
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
LabelWidth="150px">
</f:FileUpload>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Grid ID="gvErrorInfo" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="人员报验" EnableCollapse="true"
runat="server" BoxFlex="1" AllowCellEditing="true" ClicksToEdit="2" AllowSorting="true"
SortDirection="DESC" EnableColumnLines="true" ForceFit="true" AllowPaging="true" IsDatabasePaging="true" PageSize="10"
EnableRowDoubleClickEvent="true" AllowFilters="true" EnableTextSelection="True">
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# gvErrorInfo.PageIndex * gvErrorInfo.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:BoundField DataField="Row" HeaderText="错误行号">
</f:BoundField>
<f:BoundField DataField="Column" HeaderText="错误列">
</f:BoundField>
<f:BoundField DataField="Reason" HeaderText="错误类型">
</f:BoundField>
</Columns>
</f:Grid>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</form>
</body>
</html>

View File

@ -0,0 +1,421 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.Transfer
{
public partial class PipingDataIn : PageBase
{
#region
/// <summary>
/// 上传预设的虚拟路径
/// </summary>
private string initPath = Const.ExcelUrl;
/// <summary>
/// 错误集合
/// </summary>
public static List<Model.ErrorInfo> errorInfos = new List<Model.ErrorInfo>();
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.hdCheckResult.Text = string.Empty;
this.hdFileName.Text = string.Empty;
if (errorInfos != null)
{
errorInfos.Clear();
}
}
}
#endregion
#region
/// <summary>
/// 审核
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAudit_Click(object sender, EventArgs e)
{
try
{
if (this.fuAttachUrl.HasFile == false)
{
ShowNotify("请您选择Excel文件", MessageBoxIcon.Warning);
return;
}
string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls")
{
ShowNotify("只可以选择Excel文件", MessageBoxIcon.Warning);
return;
}
if (errorInfos != null)
{
errorInfos.Clear();
}
string rootPath = Server.MapPath("~/");
string initFullPath = rootPath + initPath;
if (!Directory.Exists(initFullPath))
{
Directory.CreateDirectory(initFullPath);
}
this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls;
string filePath = initFullPath + this.hdFileName.Text;
this.fuAttachUrl.PostedFile.SaveAs(filePath);
ImportXlsToData(rootPath + initPath + this.hdFileName.Text);
}
catch (Exception ex)
{
ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning);
}
}
#region Excel提取数据
/// <summary>
/// 从Excel提取数据--》Dataset
/// </summary>
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData(string fileName)
{
try
{
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
oleDBConnString += ";Extended Properties=Excel 8.0;";
OleDbConnection oleDBConn = null;
OleDbDataAdapter oleAdMaster = null;
DataTable m_tableName = new DataTable();
DataSet ds = new DataSet();
oleDBConn = new OleDbConnection(oleDBConnString);
oleDBConn.Open();
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (m_tableName != null && m_tableName.Rows.Count > 0)
{
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
}
string sqlMaster;
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
oleAdMaster.Fill(ds, "m_tableName");
oleAdMaster.Dispose();
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL(ds.Tables[0], 9);
hdCheckResult.Text = "1";
}
catch (Exception exc)
{
Response.Write(exc);
//return null;
// return dt;
}
finally
{
}
}
#endregion
#region Dataset的数据导入数据库
/// <summary>
/// 将Dataset的数据导入数据库
/// </summary>
/// <param name="pds">数据集</param>
/// <param name="Cols">数据集行数</param>
/// <returns></returns>
private bool AddDatasetToSQL(DataTable pds, int Cols)
{
string result = string.Empty;
int ic, ir;
ic = pds.Columns.Count;
if (ic < Cols)
{
ShowNotify("导入Excel格式错误Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning);
return false;
}
ir = pds.Rows.Count;
if (pds != null && ir > 0)
{
for (int i = 1; i < ir; i++)
{
string row4 = pds.Rows[i][4].ToString();
if (!string.IsNullOrEmpty(row4))
{
try
{
DateTime date = Convert.ToDateTime(row4.Trim());
}
catch (Exception)
{
result += (i + 3).ToString() + "," + "Test Package START" + "," + "[" + row4 + "]错误!不是日期格式!" + "|";
}
}
string row5 = pds.Rows[i][5].ToString();
if (!string.IsNullOrEmpty(row4))
{
try
{
DateTime date = Convert.ToDateTime(row5.Trim());
}
catch (Exception)
{
result += (i + 3).ToString() + "," + "Test Package FINISH" + "," + "[" + row5 + "]错误!不是日期格式!" + "|";
}
}
}
if (!string.IsNullOrEmpty(result))
{
result = result.Substring(0, result.LastIndexOf("|"));
}
errorInfos.Clear();
if (!string.IsNullOrEmpty(result))
{
string results = result;
List<string> errorInfoList = results.Split('|').ToList();
foreach (var item in errorInfoList)
{
string[] errors = item.Split(',');
Model.ErrorInfo errorInfo = new Model.ErrorInfo();
errorInfo.Row = errors[0];
errorInfo.Column = errors[1];
errorInfo.Reason = errors[2];
errorInfos.Add(errorInfo);
}
if (errorInfos.Count > 0)
{
this.gvErrorInfo.DataSource = errorInfos;
this.gvErrorInfo.DataBind();
}
}
else
{
ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success);
}
}
else
{
ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
}
return true;
}
#endregion
#endregion
#region
/// <summary>
/// 导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(hdCheckResult.Text))
{
if (errorInfos.Count <= 0)
{
string rootPath = Server.MapPath("~/");
ImportXlsToData2(rootPath + initPath + this.hdFileName.Text);
hdCheckResult.Text = string.Empty;
ShowNotify("导入成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning);
}
}
#region Excel提取数据
/// <summary>
/// 从Excel提取数据--》Dataset
/// </summary>
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData2(string fileName)
{
try
{
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
oleDBConnString += ";Extended Properties=Excel 8.0;";
OleDbConnection oleDBConn = null;
OleDbDataAdapter oleAdMaster = null;
DataTable m_tableName = new DataTable();
DataSet ds = new DataSet();
oleDBConn = new OleDbConnection(oleDBConnString);
oleDBConn.Open();
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (m_tableName != null && m_tableName.Rows.Count > 0)
{
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
}
string sqlMaster;
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
oleAdMaster.Fill(ds, "m_tableName");
oleAdMaster.Dispose();
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL2(ds.Tables[0], 9);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region Dataset的数据导入数据库
/// <summary>
/// 将Dataset的数据导入数据库
/// </summary>
/// <param name="pds">数据集</param>
/// <param name="Cols">数据集列数</param>
/// <returns></returns>
private bool AddDatasetToSQL2(DataTable pds, int Cols)
{
int ic, ir;
ic = pds.Columns.Count;
if (ic < Cols)
{
ShowNotify("导入Excel格式错误Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning);
}
string result = string.Empty;
ir = pds.Rows.Count;
if (pds != null && ir > 0)
{
List<Model.Transfer_Piping> list = new List<Model.Transfer_Piping>();
for (int i = 1; i < ir; i++)
{
//查询第一列,没查到的情况下作导入处理
var modelOnly = Funs.DB.Transfer_Piping.FirstOrDefault(x => x.PIPINGLINENUMBER == pds.Rows[i][0].ToString().Trim()
&& x.ProjectId == CurrUser.LoginProjectId);
if (modelOnly == null)
{
Model.Transfer_Piping model = new Model.Transfer_Piping();
model.Id = Guid.NewGuid().ToString();
model.ProjectId = CurrUser.LoginProjectId;
model.PIPINGLINENUMBER = pds.Rows[i][0].ToString().Trim();
model.SYSTEM = pds.Rows[i][1].ToString().Trim();
model.Subsystem = pds.Rows[i][2].ToString().Trim();
model.TestPackage = pds.Rows[i][3].ToString().Trim();
DateTime t1, t2;
if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString()))
model.TestPackageSTART = t1;
if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString()))
model.TestPackageFINISH = t2;
model.FINALStatus = pds.Rows[i][6].ToString().Trim();
model.PreTestFINISHED = pds.Rows[i][7].ToString().Trim();
model.FinalTestFINISHED = pds.Rows[i][8].ToString().Trim();
list.Add(model);
}
else
{
//修改
modelOnly.PIPINGLINENUMBER = pds.Rows[i][0].ToString().Trim();
modelOnly.SYSTEM = pds.Rows[i][1].ToString().Trim();
modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim();
modelOnly.TestPackage = pds.Rows[i][3].ToString().Trim();
DateTime t1, t2;
if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString()))
modelOnly.TestPackageSTART = t1;
if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString()))
modelOnly.TestPackageFINISH = t2;
modelOnly.FINALStatus = pds.Rows[i][6].ToString().Trim();
modelOnly.PreTestFINISHED = pds.Rows[i][7].ToString().Trim();
modelOnly.FinalTestFINISHED = pds.Rows[i][8].ToString().Trim();
Funs.DB.SubmitChanges();
}
}
if (list.Count > 0)
{
Funs.DB.Transfer_Piping.InsertAllOnSubmit(list);
Funs.DB.SubmitChanges();
}
}
else
{
ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
}
return true;
}
#endregion
#endregion
#region
/// <summary>
/// 下载模板按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDownLoad_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel")));
}
/// <summary>
/// 下载导入模板
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
{
if (e.EventArgument == "Confirm_OK")
{
string rootPath = Server.MapPath("~/");
string uploadfilepath = rootPath + "File\\Excel\\DataIn\\Piping导入模板.xls";
string filePath = "File\\Excel\\DataIn\\Piping导入模板.xls";
string fileName = Path.GetFileName(filePath);
FileInfo info = new FileInfo(uploadfilepath);
long fileSize = info.Length;
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.ContentType = "excel/plain";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.AddHeader("Content-Length", fileSize.ToString().Trim());
Response.TransmitFile(uploadfilepath, 0, fileSize);
Response.End();
}
}
#endregion
}
}

View File

@ -0,0 +1,123 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.Transfer {
public partial class PipingDataIn {
/// <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>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// hdFileName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdFileName;
/// <summary>
/// btnAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAudit;
/// <summary>
/// btnImport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// btnDownLoad 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDownLoad;
/// <summary>
/// hdCheckResult 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdCheckResult;
/// <summary>
/// fuAttachUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FileUpload fuAttachUrl;
/// <summary>
/// gvErrorInfo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid gvErrorInfo;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
}
}

View File

@ -0,0 +1,135 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RotatingEquipment.aspx.cs" Inherits="FineUIPro.Web.Transfer.RotatingEquipment" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
<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="Id" AllowCellEditing="true" EnableColumnLines="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="RotatingEquipment"
SortDirection="ASC" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="true">
<Toolbars>
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox runat="server" ID="txtRotatingEquipment" Label="Rotating Equipment" LabelWidth="180px" LabelAlign="Right"></f:TextBox>
<f:DatePicker runat="server" Label="Test_Package_START" ID="txtStarTime" LabelAlign="Right" LabelWidth="150px"
Width="280px">
</f:DatePicker>
<f:Label ID="Label1" runat="server" Text="至">
</f:Label>
<f:DatePicker runat="server" ID="txtEndTime" LabelAlign="Right" Width="150px">
</f:DatePicker>
<f:Button ID="btnSearch" Icon="SystemSearch" EnablePostBack="true" runat="server" OnClick="btnSearch_Click" ToolTip="查询">
</f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnImport" ToolTip="导入" Icon="PackageIn" runat="server" OnClick="btnImport_Click" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:GroupField ID="g1" HeaderText="MECHANICAL" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="RotatingEquipment" DataField="RotatingEquipment" FieldType="String" HeaderText="Rotating Equipment" TextAlign="Center"
HeaderTextAlign="Center" Width="170px">
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField ID="g2" HeaderText="SYSTEM AND TEST PACKAGE SELECTION" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="SYSTEM" DataField="SYSTEM" FieldType="String" HeaderText="SYSTEM" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="Subsystem" DataField="Subsystem" FieldType="String" HeaderText="Subsystem" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="TestPackage" DataField="TestPackage" FieldType="String" HeaderText="Test Package" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField ID="g3" HeaderText="Test Package Schedule" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="TestPackageSTART" DataField="TestPackageSTART" FieldType="Date" Renderer="Date" HeaderText="Test Package<br/>START" TextAlign="Center"
HeaderTextAlign="Center" Width="130px">
</f:RenderField>
<f:RenderField ColumnID="TestPackageFINISH" DataField="TestPackageFINISH" FieldType="Date" Renderer="Date" HeaderText="Test Package<br/>FINISH" TextAlign="Center"
HeaderTextAlign="Center" Width="130px">
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField ID="g5" HeaderText="" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="MechanicalFINALStatus" DataField="MechanicalFINALStatus" FieldType="String" HeaderText="Mechanical FINAL Status" ExpandUnusedSpace="true" TextAlign="Center"
HeaderTextAlign="Center" Width="200px">
</f:RenderField>
</Columns>
</f:GroupField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</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="所有行" Value="100000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="设备材料报验" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
Width="900px" Height="480px">
</f:Window>
<f:Window ID="Window2" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Top" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="700px" Height="560px">
</f:Window>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Parent" EnableResize="false" runat="server"
IsModal="true" Width="700px" Height="500px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<Items>
<f:MenuButton ID="btnMenuDel" EnablePostBack="true" runat="server" Icon="Delete" Text="删除" ConfirmText="确定删除当前数据?"
OnClick="btnMenuDel_Click" Hidden="true">
</f:MenuButton>
</Items>
</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;
}
</script>
</body>
</html>

View File

@ -0,0 +1,223 @@
using BLL;
using BLL.CQMS.Comprehensive;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
namespace FineUIPro.Web.Transfer
{
public partial class RotatingEquipment : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetButtonPower();
BindGrid();
}
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindGrid()
{
string strSql = @"select * from Transfer_RotatingEquipment C
where C.ProjectId = @ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (!string.IsNullOrEmpty(this.txtRotatingEquipment.Text.Trim()))
{
strSql += " AND RotatingEquipment like @RotatingEquipment";
listStr.Add(new SqlParameter("@RotatingEquipment", "%" + this.txtRotatingEquipment.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
{
strSql += " AND TestPackageSTART >= @InspectionDateA";
listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim())));
}
if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
{
strSql += " AND TestPackageSTART <= @InspectionDateZ";
listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim())));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#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();
}
/// <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 Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 关闭弹出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 新增按钮事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionEquipmentEdit.aspx", "编辑 - ")));
}
#endregion
#region
/// <summary>
/// 右键编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuModify_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionEquipmentEdit.aspx?InspectionEquipmentId={0}", Grid1.SelectedRowID, "编辑 - ")));
}
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.btnMenuModify_Click(sender, e);
}
#endregion
#region
/// <summary>
/// 右键删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDel_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var data = BLL.RotatingEquipmentService.GetRotatingEquipmentById(rowID);
if (data != null)
{
BLL.RotatingEquipmentService.DeleteRotatingEquipment(rowID);
}
}
BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
}
}
#endregion
#region
/// <summary>
/// 导入按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("RotatingEquipmentDataIn.aspx", "导入 - ")));
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.RotatingEquipmentMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDel.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnImport.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,222 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.Transfer {
public partial class RotatingEquipment {
/// <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>
/// ToolSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar ToolSearch;
/// <summary>
/// txtRotatingEquipment 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtRotatingEquipment;
/// <summary>
/// txtStarTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtStarTime;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// txtEndTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndTime;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// btnImport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
/// <summary>
/// g1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupField g1;
/// <summary>
/// g2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupField g2;
/// <summary>
/// g3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupField g3;
/// <summary>
/// g5 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupField g5;
/// <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>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuDel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDel;
}
}

View File

@ -0,0 +1,68 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RotatingEquipmentDataIn.aspx.cs" Inherits="FineUIPro.Web.Transfer.RotatingEquipmentDataIn" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
<Items>
<f:HiddenField ID="hdFileName" runat="server">
</f:HiddenField>
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="审核" ValidateForms="SimpleForm1" Text="审核"
OnClick="btnAudit_Click">
</f:Button>
<f:Button ID="btnImport" Icon="ApplicationGet" runat="server" ToolTip="导入" ValidateForms="SimpleForm1" Text="导入"
OnClick="btnImport_Click">
</f:Button>
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载模板" OnClick="btnDownLoad_Click" Text="下载模板">
</f:Button>
<f:HiddenField ID="hdCheckResult" runat="server">
</f:HiddenField>
</Items>
</f:Toolbar>
</Toolbars>
<Rows>
<f:FormRow>
<Items>
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
LabelWidth="150px">
</f:FileUpload>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Grid ID="gvErrorInfo" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="人员报验" EnableCollapse="true"
runat="server" BoxFlex="1" AllowCellEditing="true" ClicksToEdit="2" AllowSorting="true"
SortDirection="DESC" EnableColumnLines="true" ForceFit="true" AllowPaging="true" IsDatabasePaging="true" PageSize="10"
EnableRowDoubleClickEvent="true" AllowFilters="true" EnableTextSelection="True">
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# gvErrorInfo.PageIndex * gvErrorInfo.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:BoundField DataField="Row" HeaderText="错误行号">
</f:BoundField>
<f:BoundField DataField="Column" HeaderText="错误列">
</f:BoundField>
<f:BoundField DataField="Reason" HeaderText="错误类型">
</f:BoundField>
</Columns>
</f:Grid>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</form>
</body>
</html>

View File

@ -0,0 +1,417 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.Transfer
{
public partial class RotatingEquipmentDataIn : PageBase
{
#region
/// <summary>
/// 上传预设的虚拟路径
/// </summary>
private string initPath = Const.ExcelUrl;
/// <summary>
/// 错误集合
/// </summary>
public static List<Model.ErrorInfo> errorInfos = new List<Model.ErrorInfo>();
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.hdCheckResult.Text = string.Empty;
this.hdFileName.Text = string.Empty;
if (errorInfos != null)
{
errorInfos.Clear();
}
}
}
#endregion
#region
/// <summary>
/// 审核
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAudit_Click(object sender, EventArgs e)
{
try
{
if (this.fuAttachUrl.HasFile == false)
{
ShowNotify("请您选择Excel文件", MessageBoxIcon.Warning);
return;
}
string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls")
{
ShowNotify("只可以选择Excel文件", MessageBoxIcon.Warning);
return;
}
if (errorInfos != null)
{
errorInfos.Clear();
}
string rootPath = Server.MapPath("~/");
string initFullPath = rootPath + initPath;
if (!Directory.Exists(initFullPath))
{
Directory.CreateDirectory(initFullPath);
}
this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls;
string filePath = initFullPath + this.hdFileName.Text;
this.fuAttachUrl.PostedFile.SaveAs(filePath);
ImportXlsToData(rootPath + initPath + this.hdFileName.Text);
}
catch (Exception ex)
{
ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning);
}
}
#region Excel提取数据
/// <summary>
/// 从Excel提取数据--》Dataset
/// </summary>
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData(string fileName)
{
try
{
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
oleDBConnString += ";Extended Properties=Excel 8.0;";
OleDbConnection oleDBConn = null;
OleDbDataAdapter oleAdMaster = null;
DataTable m_tableName = new DataTable();
DataSet ds = new DataSet();
oleDBConn = new OleDbConnection(oleDBConnString);
oleDBConn.Open();
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (m_tableName != null && m_tableName.Rows.Count > 0)
{
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
}
string sqlMaster;
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
oleAdMaster.Fill(ds, "m_tableName");
oleAdMaster.Dispose();
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL(ds.Tables[0], 7);
hdCheckResult.Text = "1";
}
catch (Exception exc)
{
Response.Write(exc);
//return null;
// return dt;
}
finally
{
}
}
#endregion
#region Dataset的数据导入数据库
/// <summary>
/// 将Dataset的数据导入数据库
/// </summary>
/// <param name="pds">数据集</param>
/// <param name="Cols">数据集行数</param>
/// <returns></returns>
private bool AddDatasetToSQL(DataTable pds, int Cols)
{
string result = string.Empty;
int ic, ir;
ic = pds.Columns.Count;
if (ic < Cols)
{
ShowNotify("导入Excel格式错误Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning);
return false;
}
ir = pds.Rows.Count;
if (pds != null && ir > 0)
{
for (int i = 1; i < ir; i++)
{
string row4 = pds.Rows[i][4].ToString();
if (!string.IsNullOrEmpty(row4))
{
try
{
DateTime date = Convert.ToDateTime(row4.Trim());
}
catch (Exception)
{
result += (i + 3).ToString() + "," + "Test Package START" + "," + "[" + row4 + "]错误!不是日期格式!" + "|";
}
}
string row5 = pds.Rows[i][5].ToString();
if (!string.IsNullOrEmpty(row4))
{
try
{
DateTime date = Convert.ToDateTime(row5.Trim());
}
catch (Exception)
{
result += (i + 3).ToString() + "," + "Test Package FINISH" + "," + "[" + row5 + "]错误!不是日期格式!" + "|";
}
}
}
if (!string.IsNullOrEmpty(result))
{
result = result.Substring(0, result.LastIndexOf("|"));
}
errorInfos.Clear();
if (!string.IsNullOrEmpty(result))
{
string results = result;
List<string> errorInfoList = results.Split('|').ToList();
foreach (var item in errorInfoList)
{
string[] errors = item.Split(',');
Model.ErrorInfo errorInfo = new Model.ErrorInfo();
errorInfo.Row = errors[0];
errorInfo.Column = errors[1];
errorInfo.Reason = errors[2];
errorInfos.Add(errorInfo);
}
if (errorInfos.Count > 0)
{
this.gvErrorInfo.DataSource = errorInfos;
this.gvErrorInfo.DataBind();
}
}
else
{
ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success);
}
}
else
{
ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
}
return true;
}
#endregion
#endregion
#region
/// <summary>
/// 导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(hdCheckResult.Text))
{
if (errorInfos.Count <= 0)
{
string rootPath = Server.MapPath("~/");
ImportXlsToData2(rootPath + initPath + this.hdFileName.Text);
hdCheckResult.Text = string.Empty;
ShowNotify("导入成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning);
}
}
#region Excel提取数据
/// <summary>
/// 从Excel提取数据--》Dataset
/// </summary>
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData2(string fileName)
{
try
{
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
oleDBConnString += ";Extended Properties=Excel 8.0;";
OleDbConnection oleDBConn = null;
OleDbDataAdapter oleAdMaster = null;
DataTable m_tableName = new DataTable();
DataSet ds = new DataSet();
oleDBConn = new OleDbConnection(oleDBConnString);
oleDBConn.Open();
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (m_tableName != null && m_tableName.Rows.Count > 0)
{
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
}
string sqlMaster;
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
oleAdMaster.Fill(ds, "m_tableName");
oleAdMaster.Dispose();
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL2(ds.Tables[0], 7);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region Dataset的数据导入数据库
/// <summary>
/// 将Dataset的数据导入数据库
/// </summary>
/// <param name="pds">数据集</param>
/// <param name="Cols">数据集列数</param>
/// <returns></returns>
private bool AddDatasetToSQL2(DataTable pds, int Cols)
{
int ic, ir;
ic = pds.Columns.Count;
if (ic < Cols)
{
ShowNotify("导入Excel格式错误Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning);
}
string result = string.Empty;
ir = pds.Rows.Count;
if (pds != null && ir > 0)
{
List<Model.Transfer_RotatingEquipment> list = new List<Model.Transfer_RotatingEquipment>();
for (int i = 1; i < ir; i++)
{
//查询第一列,没查到的情况下作导入处理
var modelOnly = Funs.DB.Transfer_RotatingEquipment.FirstOrDefault(x => x.RotatingEquipment == pds.Rows[i][0].ToString().Trim()
&& x.ProjectId == CurrUser.LoginProjectId);
if (modelOnly == null)
{
Model.Transfer_RotatingEquipment model = new Model.Transfer_RotatingEquipment();
model.Id = Guid.NewGuid().ToString();
model.ProjectId = CurrUser.LoginProjectId;
model.RotatingEquipment = pds.Rows[i][0].ToString().Trim();
model.SYSTEM = pds.Rows[i][1].ToString().Trim();
model.Subsystem = pds.Rows[i][2].ToString().Trim();
model.TestPackage = pds.Rows[i][3].ToString().Trim();
DateTime t1, t2;
if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString()))
model.TestPackageSTART = t1;
if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString()))
model.TestPackageFINISH = t2;
model.MechanicalFINALStatus = pds.Rows[i][6].ToString().Trim();
list.Add(model);
}
else
{
//修改
modelOnly.RotatingEquipment = pds.Rows[i][0].ToString().Trim();
modelOnly.SYSTEM = pds.Rows[i][1].ToString().Trim();
modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim();
modelOnly.TestPackage = pds.Rows[i][3].ToString().Trim();
DateTime t1, t2;
if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString()))
modelOnly.TestPackageSTART = t1;
if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString()))
modelOnly.TestPackageFINISH = t2;
modelOnly.MechanicalFINALStatus = pds.Rows[i][6].ToString().Trim();
Funs.DB.SubmitChanges();
}
}
if (list.Count > 0)
{
Funs.DB.Transfer_RotatingEquipment.InsertAllOnSubmit(list);
Funs.DB.SubmitChanges();
}
}
else
{
ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
}
return true;
}
#endregion
#endregion
#region
/// <summary>
/// 下载模板按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDownLoad_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel")));
}
/// <summary>
/// 下载导入模板
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
{
if (e.EventArgument == "Confirm_OK")
{
string rootPath = Server.MapPath("~/");
string uploadfilepath = rootPath + "File\\Excel\\DataIn\\RotatingEquipment导入模板.xls";
string filePath = "File\\Excel\\DataIn\\RotatingEquipment导入模板.xls";
string fileName = Path.GetFileName(filePath);
FileInfo info = new FileInfo(uploadfilepath);
long fileSize = info.Length;
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.ContentType = "excel/plain";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.AddHeader("Content-Length", fileSize.ToString().Trim());
Response.TransmitFile(uploadfilepath, 0, fileSize);
Response.End();
}
}
#endregion
}
}

View File

@ -0,0 +1,123 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.Transfer {
public partial class RotatingEquipmentDataIn {
/// <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>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// hdFileName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdFileName;
/// <summary>
/// btnAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAudit;
/// <summary>
/// btnImport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// btnDownLoad 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDownLoad;
/// <summary>
/// hdCheckResult 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdCheckResult;
/// <summary>
/// fuAttachUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FileUpload fuAttachUrl;
/// <summary>
/// gvErrorInfo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid gvErrorInfo;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
}
}

View File

@ -0,0 +1,135 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StaticEquipment.aspx.cs" Inherits="FineUIPro.Web.Transfer.StaticEquipment" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" runat="server" AutoSizePanelID="Panel1" />
<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="Id" AllowCellEditing="true" EnableColumnLines="true"
ClicksToEdit="2" DataIDField="Id" AllowSorting="true" SortField="StaticEquipment"
SortDirection="ASC" OnSort="Grid1_Sort"
AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange"
EnableTextSelection="true">
<Toolbars>
<f:Toolbar ID="ToolSearch" Position="Top" runat="server" ToolbarAlign="Left">
<Items>
<f:TextBox runat="server" ID="txtStaticEquipment" Label="Static Equipment" LabelWidth="180px" LabelAlign="Right"></f:TextBox>
<f:DatePicker runat="server" Label="Test_Package_START" ID="txtStarTime" LabelAlign="Right" LabelWidth="150px"
Width="280px">
</f:DatePicker>
<f:Label ID="Label1" runat="server" Text="至">
</f:Label>
<f:DatePicker runat="server" ID="txtEndTime" LabelAlign="Right" Width="150px">
</f:DatePicker>
<f:Button ID="btnSearch" Icon="SystemSearch" EnablePostBack="true" runat="server" OnClick="btnSearch_Click" ToolTip="查询">
</f:Button>
<f:ToolbarFill runat="server"></f:ToolbarFill>
<f:Button ID="btnImport" ToolTip="导入" Icon="PackageIn" runat="server" OnClick="btnImport_Click" Hidden="true">
</f:Button>
</Items>
</f:Toolbar>
</Toolbars>
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# Grid1.PageIndex * Grid1.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:GroupField ID="g1" HeaderText="MECHANICAL" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="StaticEquipment" DataField="StaticEquipment" FieldType="String" HeaderText="Static Equipment" TextAlign="Center"
HeaderTextAlign="Center" Width="170px">
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField ID="g2" HeaderText="SYSTEM AND TEST PACKAGE SELECTION" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="SYSTEM" DataField="SYSTEM" FieldType="String" HeaderText="SYSTEM" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="Subsystem" DataField="Subsystem" FieldType="String" HeaderText="Subsystem" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
<f:RenderField ColumnID="TestPackage" DataField="TestPackage" FieldType="String" HeaderText="Test Package" TextAlign="Center"
HeaderTextAlign="Center" Width="120px">
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField ID="g3" HeaderText="Test Package Schedule" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="TestPackageSTART" DataField="TestPackageSTART" FieldType="Date" Renderer="Date" HeaderText="Test Package<br/>START" TextAlign="Center"
HeaderTextAlign="Center" Width="130px">
</f:RenderField>
<f:RenderField ColumnID="TestPackageFINISH" DataField="TestPackageFINISH" FieldType="Date" Renderer="Date" HeaderText="Test Package<br/>FINISH" TextAlign="Center"
HeaderTextAlign="Center" Width="130px">
</f:RenderField>
</Columns>
</f:GroupField>
<f:GroupField ID="g5" HeaderText="" HeaderTextAlign="Center">
<Columns>
<f:RenderField ColumnID="MechanicalFINALStatus" DataField="MechanicalFINALStatus" FieldType="String" HeaderText="Mechanical FINAL Status" ExpandUnusedSpace="true" TextAlign="Center"
HeaderTextAlign="Center" Width="200px">
</f:RenderField>
</Columns>
</f:GroupField>
</Columns>
<Listeners>
<f:Listener Event="beforerowcontextmenu" Handler="onRowContextMenu" />
</Listeners>
<PageItems>
<f:ToolbarText ID="ToolbarText1" runat="server" Text="每页记录数:">
</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="所有行" Value="100000" />
</f:DropDownList>
</PageItems>
</f:Grid>
</Items>
</f:Panel>
<f:Window ID="Window1" Title="设备材料报验" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Parent" EnableResize="false" runat="server" IsModal="true" OnClose="Window1_Close"
Width="900px" Height="480px">
</f:Window>
<f:Window ID="Window2" Title="弹出窗体" Hidden="true" EnableIFrame="true" EnableMaximize="true"
Target="Top" EnableResize="false" runat="server" OnClose="Window1_Close" IsModal="true"
Width="700px" Height="560px">
</f:Window>
<f:Window ID="WindowAtt" Title="弹出窗体" Hidden="true" EnableIFrame="true"
EnableMaximize="true" Target="Parent" EnableResize="false" runat="server"
IsModal="true" Width="700px" Height="500px">
</f:Window>
<f:Menu ID="Menu1" runat="server">
<Items>
<f:MenuButton ID="btnMenuDel" EnablePostBack="true" runat="server" Icon="Delete" Text="删除" ConfirmText="确定删除当前数据?"
OnClick="btnMenuDel_Click" Hidden="true">
</f:MenuButton>
</Items>
</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;
}
</script>
</body>
</html>

View File

@ -0,0 +1,223 @@
using BLL;
using BLL.CQMS.Comprehensive;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
namespace FineUIPro.Web.Transfer
{
public partial class StaticEquipment : PageBase
{
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GetButtonPower();
BindGrid();
}
}
/// <summary>
/// 数据绑定
/// </summary>
public void BindGrid()
{
string strSql = @"select * from Transfer_StaticEquipment C
where C.ProjectId = @ProjectId";
List<SqlParameter> listStr = new List<SqlParameter>();
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
if (!string.IsNullOrEmpty(this.txtStaticEquipment.Text.Trim()))
{
strSql += " AND StaticEquipment like @StaticEquipment";
listStr.Add(new SqlParameter("@StaticEquipment", "%" + this.txtStaticEquipment.Text.Trim() + "%"));
}
if (!string.IsNullOrEmpty(txtStarTime.Text.Trim()))
{
strSql += " AND TestPackageSTART >= @InspectionDateA";
listStr.Add(new SqlParameter("@InspectionDateA", Funs.GetNewDateTime(txtStarTime.Text.Trim())));
}
if (!string.IsNullOrEmpty(txtEndTime.Text.Trim()))
{
strSql += " AND TestPackageSTART <= @InspectionDateZ";
listStr.Add(new SqlParameter("@InspectionDateZ", Funs.GetNewDateTime(txtEndTime.Text.Trim())));
}
SqlParameter[] parameter = listStr.ToArray();
DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter);
Grid1.RecordCount = tb.Rows.Count;
var table = this.GetPagedDataTable(Grid1, tb);
Grid1.DataSource = table;
Grid1.DataBind();
}
#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();
}
/// <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 Grid1_Sort(object sender, FineUIPro.GridSortEventArgs e)
{
Grid1.SortDirection = e.SortDirection;
Grid1.SortField = e.SortField;
BindGrid();
}
#endregion
#region
/// <summary>
/// 查询
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnSearch_Click(object sender, EventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 关闭弹出窗口
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Window1_Close(object sender, WindowCloseEventArgs e)
{
BindGrid();
}
#endregion
#region
/// <summary>
/// 新增按钮事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnNew_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionEquipmentEdit.aspx", "编辑 - ")));
}
#endregion
#region
/// <summary>
/// 右键编辑
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuModify_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length == 0)
{
Alert.ShowInTop("请至少选择一条记录", MessageBoxIcon.Warning);
return;
}
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("InspectionEquipmentEdit.aspx?InspectionEquipmentId={0}", Grid1.SelectedRowID, "编辑 - ")));
}
/// <summary>
/// Grid行双击事件
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e)
{
this.btnMenuModify_Click(sender, e);
}
#endregion
#region
/// <summary>
/// 右键删除
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnMenuDel_Click(object sender, EventArgs e)
{
if (Grid1.SelectedRowIndexArray.Length > 0)
{
foreach (int rowIndex in Grid1.SelectedRowIndexArray)
{
string rowID = Grid1.DataKeys[rowIndex][0].ToString();
var data = BLL.StaticEquipmentService.GetStaticEquipmentById(rowID);
if (data != null)
{
BLL.StaticEquipmentService.DeleteStaticEquipment(rowID);
}
}
BindGrid();
ShowNotify("删除数据成功!", MessageBoxIcon.Success);
}
}
#endregion
#region
/// <summary>
/// 导入按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Window2.GetShowReference(String.Format("StaticEquipmentDataIn.aspx", "导入 - ")));
}
#endregion
#region
/// <summary>
/// 获取按钮权限
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private void GetButtonPower()
{
if (Request.Params["value"] == "0")
{
return;
}
var buttonList = BLL.CommonService.GetAllButtonList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.StaticEquipmentMenuId);
if (buttonList.Count() > 0)
{
if (buttonList.Contains(BLL.Const.BtnDelete))
{
this.btnMenuDel.Hidden = false;
}
if (buttonList.Contains(BLL.Const.BtnSave))
{
this.btnImport.Hidden = false;
}
}
}
#endregion
}
}

View File

@ -0,0 +1,222 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.Transfer {
public partial class StaticEquipment {
/// <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>
/// ToolSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar ToolSearch;
/// <summary>
/// txtStaticEquipment 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.TextBox txtStaticEquipment;
/// <summary>
/// txtStarTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtStarTime;
/// <summary>
/// Label1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Label Label1;
/// <summary>
/// txtEndTime 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.DatePicker txtEndTime;
/// <summary>
/// btnSearch 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnSearch;
/// <summary>
/// btnImport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
/// <summary>
/// g1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupField g1;
/// <summary>
/// g2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupField g2;
/// <summary>
/// g3 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupField g3;
/// <summary>
/// g5 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.GroupField g5;
/// <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>
/// WindowAtt 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Window WindowAtt;
/// <summary>
/// Menu1 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Menu Menu1;
/// <summary>
/// btnMenuDel 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.MenuButton btnMenuDel;
}
}

View File

@ -0,0 +1,68 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="StaticEquipmentDataIn.aspx.cs" Inherits="FineUIPro.Web.Transfer.StaticEquipmentDataIn" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title>
</head>
<body>
<form id="form1" runat="server">
<f:PageManager ID="PageManager1" AutoSizePanelID="SimpleForm1" runat="server" OnCustomEvent="PageManager1_CustomEvent" />
<f:Form ID="SimpleForm1" ShowBorder="false" ShowHeader="false" AutoScroll="true"
BodyPadding="10px" runat="server" RedStarPosition="BeforeText" LabelAlign="Right">
<Toolbars>
<f:Toolbar ID="Toolbar2" Position="Top" ToolbarAlign="Right" runat="server">
<Items>
<f:HiddenField ID="hdFileName" runat="server">
</f:HiddenField>
<f:Button ID="btnAudit" Icon="ApplicationEdit" runat="server" ToolTip="审核" ValidateForms="SimpleForm1" Text="审核"
OnClick="btnAudit_Click">
</f:Button>
<f:Button ID="btnImport" Icon="ApplicationGet" runat="server" ToolTip="导入" ValidateForms="SimpleForm1" Text="导入"
OnClick="btnImport_Click">
</f:Button>
<f:Button ID="btnDownLoad" runat="server" Icon="ApplicationGo" ToolTip="下载模板" OnClick="btnDownLoad_Click" Text="下载模板">
</f:Button>
<f:HiddenField ID="hdCheckResult" runat="server">
</f:HiddenField>
</Items>
</f:Toolbar>
</Toolbars>
<Rows>
<f:FormRow>
<Items>
<f:FileUpload runat="server" ID="fuAttachUrl" EmptyText="选择要导入的文件" Label="选择要导入的文件"
LabelWidth="150px">
</f:FileUpload>
</Items>
</f:FormRow>
<f:FormRow>
<Items>
<f:Grid ID="gvErrorInfo" ShowBorder="true" EnableAjax="false" ShowHeader="false" Title="人员报验" EnableCollapse="true"
runat="server" BoxFlex="1" AllowCellEditing="true" ClicksToEdit="2" AllowSorting="true"
SortDirection="DESC" EnableColumnLines="true" ForceFit="true" AllowPaging="true" IsDatabasePaging="true" PageSize="10"
EnableRowDoubleClickEvent="true" AllowFilters="true" EnableTextSelection="True">
<Columns>
<f:TemplateField ColumnID="tfPageIndex" Width="55px" HeaderText="序号" HeaderTextAlign="Center" TextAlign="Center"
EnableLock="true" Locked="False">
<ItemTemplate>
<asp:Label ID="lblPageIndex" runat="server" Text='<%# gvErrorInfo.PageIndex * gvErrorInfo.PageSize + Container.DataItemIndex + 1 %>'></asp:Label>
</ItemTemplate>
</f:TemplateField>
<f:BoundField DataField="Row" HeaderText="错误行号">
</f:BoundField>
<f:BoundField DataField="Column" HeaderText="错误列">
</f:BoundField>
<f:BoundField DataField="Reason" HeaderText="错误类型">
</f:BoundField>
</Columns>
</f:Grid>
</Items>
</f:FormRow>
</Rows>
</f:Form>
</form>
</body>
</html>

View File

@ -0,0 +1,417 @@
using BLL;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.OleDb;
using System.IO;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace FineUIPro.Web.Transfer
{
public partial class StaticEquipmentDataIn : PageBase
{
#region
/// <summary>
/// 上传预设的虚拟路径
/// </summary>
private string initPath = Const.ExcelUrl;
/// <summary>
/// 错误集合
/// </summary>
public static List<Model.ErrorInfo> errorInfos = new List<Model.ErrorInfo>();
#endregion
#region
/// <summary>
/// 加载页面
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.hdCheckResult.Text = string.Empty;
this.hdFileName.Text = string.Empty;
if (errorInfos != null)
{
errorInfos.Clear();
}
}
}
#endregion
#region
/// <summary>
/// 审核
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnAudit_Click(object sender, EventArgs e)
{
try
{
if (this.fuAttachUrl.HasFile == false)
{
ShowNotify("请您选择Excel文件", MessageBoxIcon.Warning);
return;
}
string IsXls = Path.GetExtension(this.fuAttachUrl.FileName).ToString().Trim().ToLower();
if (IsXls != ".xls")
{
ShowNotify("只可以选择Excel文件", MessageBoxIcon.Warning);
return;
}
if (errorInfos != null)
{
errorInfos.Clear();
}
string rootPath = Server.MapPath("~/");
string initFullPath = rootPath + initPath;
if (!Directory.Exists(initFullPath))
{
Directory.CreateDirectory(initFullPath);
}
this.hdFileName.Text = BLL.Funs.GetNewFileName() + IsXls;
string filePath = initFullPath + this.hdFileName.Text;
this.fuAttachUrl.PostedFile.SaveAs(filePath);
ImportXlsToData(rootPath + initPath + this.hdFileName.Text);
}
catch (Exception ex)
{
ShowNotify("'" + ex.Message + "'", MessageBoxIcon.Warning);
}
}
#region Excel提取数据
/// <summary>
/// 从Excel提取数据--》Dataset
/// </summary>
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData(string fileName)
{
try
{
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
oleDBConnString += ";Extended Properties=Excel 8.0;";
OleDbConnection oleDBConn = null;
OleDbDataAdapter oleAdMaster = null;
DataTable m_tableName = new DataTable();
DataSet ds = new DataSet();
oleDBConn = new OleDbConnection(oleDBConnString);
oleDBConn.Open();
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (m_tableName != null && m_tableName.Rows.Count > 0)
{
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
}
string sqlMaster;
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
oleAdMaster.Fill(ds, "m_tableName");
oleAdMaster.Dispose();
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL(ds.Tables[0], 7);
hdCheckResult.Text = "1";
}
catch (Exception exc)
{
Response.Write(exc);
//return null;
// return dt;
}
finally
{
}
}
#endregion
#region Dataset的数据导入数据库
/// <summary>
/// 将Dataset的数据导入数据库
/// </summary>
/// <param name="pds">数据集</param>
/// <param name="Cols">数据集行数</param>
/// <returns></returns>
private bool AddDatasetToSQL(DataTable pds, int Cols)
{
string result = string.Empty;
int ic, ir;
ic = pds.Columns.Count;
if (ic < Cols)
{
ShowNotify("导入Excel格式错误Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning);
return false;
}
ir = pds.Rows.Count;
if (pds != null && ir > 0)
{
for (int i = 1; i < ir; i++)
{
string row4 = pds.Rows[i][4].ToString();
if (!string.IsNullOrEmpty(row4))
{
try
{
DateTime date = Convert.ToDateTime(row4.Trim());
}
catch (Exception)
{
result += (i + 3).ToString() + "," + "Test Package START" + "," + "[" + row4 + "]错误!不是日期格式!" + "|";
}
}
string row5 = pds.Rows[i][5].ToString();
if (!string.IsNullOrEmpty(row4))
{
try
{
DateTime date = Convert.ToDateTime(row5.Trim());
}
catch (Exception)
{
result += (i + 3).ToString() + "," + "Test Package FINISH" + "," + "[" + row5 + "]错误!不是日期格式!" + "|";
}
}
}
if (!string.IsNullOrEmpty(result))
{
result = result.Substring(0, result.LastIndexOf("|"));
}
errorInfos.Clear();
if (!string.IsNullOrEmpty(result))
{
string results = result;
List<string> errorInfoList = results.Split('|').ToList();
foreach (var item in errorInfoList)
{
string[] errors = item.Split(',');
Model.ErrorInfo errorInfo = new Model.ErrorInfo();
errorInfo.Row = errors[0];
errorInfo.Column = errors[1];
errorInfo.Reason = errors[2];
errorInfos.Add(errorInfo);
}
if (errorInfos.Count > 0)
{
this.gvErrorInfo.DataSource = errorInfos;
this.gvErrorInfo.DataBind();
}
}
else
{
ShowNotify("审核完成,请点击导入!", MessageBoxIcon.Success);
}
}
else
{
ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
}
return true;
}
#endregion
#endregion
#region
/// <summary>
/// 导入
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnImport_Click(object sender, EventArgs e)
{
if (!string.IsNullOrEmpty(hdCheckResult.Text))
{
if (errorInfos.Count <= 0)
{
string rootPath = Server.MapPath("~/");
ImportXlsToData2(rootPath + initPath + this.hdFileName.Text);
hdCheckResult.Text = string.Empty;
ShowNotify("导入成功!", MessageBoxIcon.Success);
PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference());
}
else
{
ShowNotify("请先将错误数据修正,再重新导入提交!", MessageBoxIcon.Warning);
}
}
else
{
ShowNotify("请先审核要导入的文件!", MessageBoxIcon.Warning);
}
}
#region Excel提取数据
/// <summary>
/// 从Excel提取数据--》Dataset
/// </summary>
/// <param name="filename">Excel文件路径名</param>
private void ImportXlsToData2(string fileName)
{
try
{
string oleDBConnString = String.Empty;
oleDBConnString = "Provider=Microsoft.Jet.OLEDB.4.0;";
oleDBConnString += "Data Source=";
oleDBConnString += fileName;
oleDBConnString += ";Extended Properties=Excel 8.0;";
OleDbConnection oleDBConn = null;
OleDbDataAdapter oleAdMaster = null;
DataTable m_tableName = new DataTable();
DataSet ds = new DataSet();
oleDBConn = new OleDbConnection(oleDBConnString);
oleDBConn.Open();
m_tableName = oleDBConn.GetOleDbSchemaTable(OleDbSchemaGuid.Tables, null);
if (m_tableName != null && m_tableName.Rows.Count > 0)
{
m_tableName.TableName = m_tableName.Rows[0]["TABLE_NAME"].ToString().Trim();
}
string sqlMaster;
sqlMaster = " SELECT * FROM [" + m_tableName.TableName + "]";
oleAdMaster = new OleDbDataAdapter(sqlMaster, oleDBConn);
oleAdMaster.Fill(ds, "m_tableName");
oleAdMaster.Dispose();
oleDBConn.Close();
oleDBConn.Dispose();
AddDatasetToSQL2(ds.Tables[0], 7);
}
catch (Exception ex)
{
throw ex;
}
}
#endregion
#region Dataset的数据导入数据库
/// <summary>
/// 将Dataset的数据导入数据库
/// </summary>
/// <param name="pds">数据集</param>
/// <param name="Cols">数据集列数</param>
/// <returns></returns>
private bool AddDatasetToSQL2(DataTable pds, int Cols)
{
int ic, ir;
ic = pds.Columns.Count;
if (ic < Cols)
{
ShowNotify("导入Excel格式错误Excel只有" + ic.ToString().Trim() + "列", MessageBoxIcon.Warning);
}
string result = string.Empty;
ir = pds.Rows.Count;
if (pds != null && ir > 0)
{
List<Model.Transfer_StaticEquipment> list = new List<Model.Transfer_StaticEquipment>();
for (int i = 1; i < ir; i++)
{
//查询第一列,没查到的情况下作导入处理
var modelOnly = Funs.DB.Transfer_StaticEquipment.FirstOrDefault(x => x.StaticEquipment == pds.Rows[i][0].ToString().Trim()
&& x.ProjectId == CurrUser.LoginProjectId);
if (modelOnly == null)
{
Model.Transfer_StaticEquipment model = new Model.Transfer_StaticEquipment();
model.Id = Guid.NewGuid().ToString();
model.ProjectId = CurrUser.LoginProjectId;
model.StaticEquipment = pds.Rows[i][0].ToString().Trim();
model.SYSTEM = pds.Rows[i][1].ToString().Trim();
model.Subsystem = pds.Rows[i][2].ToString().Trim();
model.TestPackage = pds.Rows[i][3].ToString().Trim();
DateTime t1, t2;
if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString()))
model.TestPackageSTART = t1;
if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString()))
model.TestPackageFINISH = t2;
model.MechanicalFINALStatus = pds.Rows[i][6].ToString().Trim();
list.Add(model);
}
else
{
//修改
modelOnly.StaticEquipment = pds.Rows[i][0].ToString().Trim();
modelOnly.SYSTEM = pds.Rows[i][1].ToString().Trim();
modelOnly.Subsystem = pds.Rows[i][2].ToString().Trim();
modelOnly.TestPackage = pds.Rows[i][3].ToString().Trim();
DateTime t1, t2;
if (DateTime.TryParse(pds.Rows[i][4].ToString(), out t1) && !string.IsNullOrEmpty(pds.Rows[i][4].ToString()))
modelOnly.TestPackageSTART = t1;
if (DateTime.TryParse(pds.Rows[i][5].ToString(), out t2) && !string.IsNullOrEmpty(pds.Rows[i][5].ToString()))
modelOnly.TestPackageFINISH = t2;
modelOnly.MechanicalFINALStatus = pds.Rows[i][6].ToString().Trim();
Funs.DB.SubmitChanges();
}
}
if (list.Count > 0)
{
Funs.DB.Transfer_StaticEquipment.InsertAllOnSubmit(list);
Funs.DB.SubmitChanges();
}
}
else
{
ShowNotify("导入数据为空!", MessageBoxIcon.Warning);
}
return true;
}
#endregion
#endregion
#region
/// <summary>
/// 下载模板按钮
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void btnDownLoad_Click(object sender, EventArgs e)
{
PageContext.RegisterStartupScript(Confirm.GetShowReference("确定下载导入模板吗?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirm_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel")));
}
/// <summary>
/// 下载导入模板
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
protected void PageManager1_CustomEvent(object sender, CustomEventArgs e)
{
if (e.EventArgument == "Confirm_OK")
{
string rootPath = Server.MapPath("~/");
string uploadfilepath = rootPath + "File\\Excel\\DataIn\\StaticEquipment导入模板.xls";
string filePath = "File\\Excel\\DataIn\\StaticEquipment导入模板.xls";
string fileName = Path.GetFileName(filePath);
FileInfo info = new FileInfo(uploadfilepath);
long fileSize = info.Length;
Response.ClearContent();
Response.AddHeader("Content-Disposition", "attachment;filename=" + System.Web.HttpUtility.UrlEncode(fileName, System.Text.Encoding.UTF8));
Response.ContentType = "excel/plain";
Response.ContentEncoding = System.Text.Encoding.UTF8;
Response.AddHeader("Content-Length", fileSize.ToString().Trim());
Response.TransmitFile(uploadfilepath, 0, fileSize);
Response.End();
}
}
#endregion
}
}

View File

@ -0,0 +1,123 @@
//------------------------------------------------------------------------------
// <自动生成>
// 此代码由工具生成。
//
// 对此文件的更改可能导致不正确的行为,如果
// 重新生成代码,则所做更改将丢失。
// </自动生成>
//------------------------------------------------------------------------------
namespace FineUIPro.Web.Transfer {
public partial class StaticEquipmentDataIn {
/// <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>
/// Toolbar2 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Toolbar Toolbar2;
/// <summary>
/// hdFileName 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdFileName;
/// <summary>
/// btnAudit 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnAudit;
/// <summary>
/// btnImport 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnImport;
/// <summary>
/// btnDownLoad 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Button btnDownLoad;
/// <summary>
/// hdCheckResult 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.HiddenField hdCheckResult;
/// <summary>
/// fuAttachUrl 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.FileUpload fuAttachUrl;
/// <summary>
/// gvErrorInfo 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::FineUIPro.Grid gvErrorInfo;
/// <summary>
/// lblPageIndex 控件。
/// </summary>
/// <remarks>
/// 自动生成的字段。
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblPageIndex;
}
}

View File

@ -76,7 +76,7 @@
<add verb="GET" path="res.axd" type="FineUIPro.ResourceHandler, FineUIPro" validate="false"/>
<add path="ChartImg.axd" verb="GET,POST,HEAD" type="System.Web.UI.DataVisualization.Charting.ChartHttpHandler, System.Web.DataVisualization, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false"/>
</httpHandlers>
<compilation debug="false" targetFramework="4.6.1"/>
<compilation debug="true" targetFramework="4.6.1"/>
<httpRuntime requestValidationMode="2.0" maxRequestLength="2147483647" executionTimeout="36000"/>
<authentication mode="Forms">
<forms loginUrl="Login.aspx" name="PUBLISHERCOOKIE" protection="All" timeout="1440" path="/"/>

View File

@ -2360,6 +2360,12 @@ namespace Model
partial void InsertTransfer_PunchlistFrom(Transfer_PunchlistFrom instance);
partial void UpdateTransfer_PunchlistFrom(Transfer_PunchlistFrom instance);
partial void DeleteTransfer_PunchlistFrom(Transfer_PunchlistFrom instance);
partial void InsertTransfer_RotatingEquipment(Transfer_RotatingEquipment instance);
partial void UpdateTransfer_RotatingEquipment(Transfer_RotatingEquipment instance);
partial void DeleteTransfer_RotatingEquipment(Transfer_RotatingEquipment instance);
partial void InsertTransfer_StaticEquipment(Transfer_StaticEquipment instance);
partial void UpdateTransfer_StaticEquipment(Transfer_StaticEquipment instance);
partial void DeleteTransfer_StaticEquipment(Transfer_StaticEquipment instance);
partial void InsertTransfer_Telecom(Transfer_Telecom instance);
partial void UpdateTransfer_Telecom(Transfer_Telecom instance);
partial void DeleteTransfer_Telecom(Transfer_Telecom instance);
@ -8774,6 +8780,22 @@ namespace Model
}
}
public System.Data.Linq.Table<Transfer_RotatingEquipment> Transfer_RotatingEquipment
{
get
{
return this.GetTable<Transfer_RotatingEquipment>();
}
}
public System.Data.Linq.Table<Transfer_StaticEquipment> Transfer_StaticEquipment
{
get
{
return this.GetTable<Transfer_StaticEquipment>();
}
}
public System.Data.Linq.Table<Transfer_Telecom> Transfer_Telecom
{
get
@ -370477,6 +370499,514 @@ namespace Model
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Transfer_RotatingEquipment")]
public partial class Transfer_RotatingEquipment : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _Id;
private string _ProjectId;
private string _RotatingEquipment;
private string _SYSTEM;
private string _Subsystem;
private string _TestPackage;
private System.Nullable<System.DateTime> _TestPackageSTART;
private System.Nullable<System.DateTime> _TestPackageFINISH;
private string _MechanicalFINALStatus;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnIdChanging(string value);
partial void OnIdChanged();
partial void OnProjectIdChanging(string value);
partial void OnProjectIdChanged();
partial void OnRotatingEquipmentChanging(string value);
partial void OnRotatingEquipmentChanged();
partial void OnSYSTEMChanging(string value);
partial void OnSYSTEMChanged();
partial void OnSubsystemChanging(string value);
partial void OnSubsystemChanged();
partial void OnTestPackageChanging(string value);
partial void OnTestPackageChanged();
partial void OnTestPackageSTARTChanging(System.Nullable<System.DateTime> value);
partial void OnTestPackageSTARTChanged();
partial void OnTestPackageFINISHChanging(System.Nullable<System.DateTime> value);
partial void OnTestPackageFINISHChanged();
partial void OnMechanicalFINALStatusChanging(string value);
partial void OnMechanicalFINALStatusChanged();
#endregion
public Transfer_RotatingEquipment()
{
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string Id
{
get
{
return this._Id;
}
set
{
if ((this._Id != value))
{
this.OnIdChanging(value);
this.SendPropertyChanging();
this._Id = value;
this.SendPropertyChanged("Id");
this.OnIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
public string ProjectId
{
get
{
return this._ProjectId;
}
set
{
if ((this._ProjectId != value))
{
this.OnProjectIdChanging(value);
this.SendPropertyChanging();
this._ProjectId = value;
this.SendPropertyChanged("ProjectId");
this.OnProjectIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_RotatingEquipment", DbType="NVarChar(50)")]
public string RotatingEquipment
{
get
{
return this._RotatingEquipment;
}
set
{
if ((this._RotatingEquipment != value))
{
this.OnRotatingEquipmentChanging(value);
this.SendPropertyChanging();
this._RotatingEquipment = value;
this.SendPropertyChanged("RotatingEquipment");
this.OnRotatingEquipmentChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SYSTEM", DbType="NVarChar(50)")]
public string SYSTEM
{
get
{
return this._SYSTEM;
}
set
{
if ((this._SYSTEM != value))
{
this.OnSYSTEMChanging(value);
this.SendPropertyChanging();
this._SYSTEM = value;
this.SendPropertyChanged("SYSTEM");
this.OnSYSTEMChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Subsystem", DbType="NVarChar(50)")]
public string Subsystem
{
get
{
return this._Subsystem;
}
set
{
if ((this._Subsystem != value))
{
this.OnSubsystemChanging(value);
this.SendPropertyChanging();
this._Subsystem = value;
this.SendPropertyChanged("Subsystem");
this.OnSubsystemChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackage", DbType="NVarChar(50)")]
public string TestPackage
{
get
{
return this._TestPackage;
}
set
{
if ((this._TestPackage != value))
{
this.OnTestPackageChanging(value);
this.SendPropertyChanging();
this._TestPackage = value;
this.SendPropertyChanged("TestPackage");
this.OnTestPackageChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageSTART", DbType="DateTime")]
public System.Nullable<System.DateTime> TestPackageSTART
{
get
{
return this._TestPackageSTART;
}
set
{
if ((this._TestPackageSTART != value))
{
this.OnTestPackageSTARTChanging(value);
this.SendPropertyChanging();
this._TestPackageSTART = value;
this.SendPropertyChanged("TestPackageSTART");
this.OnTestPackageSTARTChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageFINISH", DbType="DateTime")]
public System.Nullable<System.DateTime> TestPackageFINISH
{
get
{
return this._TestPackageFINISH;
}
set
{
if ((this._TestPackageFINISH != value))
{
this.OnTestPackageFINISHChanging(value);
this.SendPropertyChanging();
this._TestPackageFINISH = value;
this.SendPropertyChanged("TestPackageFINISH");
this.OnTestPackageFINISHChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MechanicalFINALStatus", DbType="NVarChar(50)")]
public string MechanicalFINALStatus
{
get
{
return this._MechanicalFINALStatus;
}
set
{
if ((this._MechanicalFINALStatus != value))
{
this.OnMechanicalFINALStatusChanging(value);
this.SendPropertyChanging();
this._MechanicalFINALStatus = value;
this.SendPropertyChanged("MechanicalFINALStatus");
this.OnMechanicalFINALStatusChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Transfer_StaticEquipment")]
public partial class Transfer_StaticEquipment : INotifyPropertyChanging, INotifyPropertyChanged
{
private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty);
private string _Id;
private string _ProjectId;
private string _StaticEquipment;
private string _SYSTEM;
private string _Subsystem;
private string _TestPackage;
private System.Nullable<System.DateTime> _TestPackageSTART;
private System.Nullable<System.DateTime> _TestPackageFINISH;
private string _MechanicalFINALStatus;
#region
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnIdChanging(string value);
partial void OnIdChanged();
partial void OnProjectIdChanging(string value);
partial void OnProjectIdChanged();
partial void OnStaticEquipmentChanging(string value);
partial void OnStaticEquipmentChanged();
partial void OnSYSTEMChanging(string value);
partial void OnSYSTEMChanged();
partial void OnSubsystemChanging(string value);
partial void OnSubsystemChanged();
partial void OnTestPackageChanging(string value);
partial void OnTestPackageChanged();
partial void OnTestPackageSTARTChanging(System.Nullable<System.DateTime> value);
partial void OnTestPackageSTARTChanged();
partial void OnTestPackageFINISHChanging(System.Nullable<System.DateTime> value);
partial void OnTestPackageFINISHChanged();
partial void OnMechanicalFINALStatusChanging(string value);
partial void OnMechanicalFINALStatusChanged();
#endregion
public Transfer_StaticEquipment()
{
OnCreated();
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Id", DbType="NVarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)]
public string Id
{
get
{
return this._Id;
}
set
{
if ((this._Id != value))
{
this.OnIdChanging(value);
this.SendPropertyChanging();
this._Id = value;
this.SendPropertyChanged("Id");
this.OnIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="NVarChar(50)")]
public string ProjectId
{
get
{
return this._ProjectId;
}
set
{
if ((this._ProjectId != value))
{
this.OnProjectIdChanging(value);
this.SendPropertyChanging();
this._ProjectId = value;
this.SendPropertyChanged("ProjectId");
this.OnProjectIdChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_StaticEquipment", DbType="NVarChar(50)")]
public string StaticEquipment
{
get
{
return this._StaticEquipment;
}
set
{
if ((this._StaticEquipment != value))
{
this.OnStaticEquipmentChanging(value);
this.SendPropertyChanging();
this._StaticEquipment = value;
this.SendPropertyChanged("StaticEquipment");
this.OnStaticEquipmentChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SYSTEM", DbType="NVarChar(50)")]
public string SYSTEM
{
get
{
return this._SYSTEM;
}
set
{
if ((this._SYSTEM != value))
{
this.OnSYSTEMChanging(value);
this.SendPropertyChanging();
this._SYSTEM = value;
this.SendPropertyChanged("SYSTEM");
this.OnSYSTEMChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Subsystem", DbType="NVarChar(50)")]
public string Subsystem
{
get
{
return this._Subsystem;
}
set
{
if ((this._Subsystem != value))
{
this.OnSubsystemChanging(value);
this.SendPropertyChanging();
this._Subsystem = value;
this.SendPropertyChanged("Subsystem");
this.OnSubsystemChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackage", DbType="NVarChar(50)")]
public string TestPackage
{
get
{
return this._TestPackage;
}
set
{
if ((this._TestPackage != value))
{
this.OnTestPackageChanging(value);
this.SendPropertyChanging();
this._TestPackage = value;
this.SendPropertyChanged("TestPackage");
this.OnTestPackageChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageSTART", DbType="DateTime")]
public System.Nullable<System.DateTime> TestPackageSTART
{
get
{
return this._TestPackageSTART;
}
set
{
if ((this._TestPackageSTART != value))
{
this.OnTestPackageSTARTChanging(value);
this.SendPropertyChanging();
this._TestPackageSTART = value;
this.SendPropertyChanged("TestPackageSTART");
this.OnTestPackageSTARTChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TestPackageFINISH", DbType="DateTime")]
public System.Nullable<System.DateTime> TestPackageFINISH
{
get
{
return this._TestPackageFINISH;
}
set
{
if ((this._TestPackageFINISH != value))
{
this.OnTestPackageFINISHChanging(value);
this.SendPropertyChanging();
this._TestPackageFINISH = value;
this.SendPropertyChanged("TestPackageFINISH");
this.OnTestPackageFINISHChanged();
}
}
}
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MechanicalFINALStatus", DbType="NVarChar(50)")]
public string MechanicalFINALStatus
{
get
{
return this._MechanicalFINALStatus;
}
set
{
if ((this._MechanicalFINALStatus != value))
{
this.OnMechanicalFINALStatusChanging(value);
this.SendPropertyChanging();
this._MechanicalFINALStatus = value;
this.SendPropertyChanged("MechanicalFINALStatus");
this.OnMechanicalFINALStatusChanged();
}
}
}
public event PropertyChangingEventHandler PropertyChanging;
public event PropertyChangedEventHandler PropertyChanged;
protected virtual void SendPropertyChanging()
{
if ((this.PropertyChanging != null))
{
this.PropertyChanging(this, emptyChangingEventArgs);
}
}
protected virtual void SendPropertyChanged(String propertyName)
{
if ((this.PropertyChanged != null))
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
[global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Transfer_Telecom")]
public partial class Transfer_Telecom : INotifyPropertyChanging, INotifyPropertyChanged
{

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<LastActiveSolutionConfig>Release|Any CPU</LastActiveSolutionConfig>
<LastActiveSolutionConfig>Debug|Any CPU</LastActiveSolutionConfig>
<UseIISExpress>true</UseIISExpress>
<Use64BitIISExpress />
<IISExpressSSLPort />