diff --git a/DataBase/版本日志/SGGLDB_WH_2023-06-27.sql b/DataBase/版本日志/SGGLDB_WH_2023-06-27.sql new file mode 100644 index 00000000..2198f30a --- /dev/null +++ b/DataBase/版本日志/SGGLDB_WH_2023-06-27.sql @@ -0,0 +1,239 @@ +--cd C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools +--SqlMetal /views /server:WQ /database:SGGLDB_WH /code:C:\Model.cs /namespace:Model + +--菜单新增 +delete Sys_Menu where MenuId='5C07E135-C3AB-4CE4-97A2-C79970640272' +delete Sys_Menu where MenuId='B4702BFB-8CEB-46AD-BDC0-751D146FE228' +delete Sys_Menu where MenuId='34719347-E5EE-4491-9E92-B1270C187C7F' +delete Sys_Menu where MenuId='F0E06491-B1DA-4510-ABCA-D09F4B24EE50' +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('5C07E135-C3AB-4CE4-97A2-C79970640272','系统划分',null,'TestRun/BeforeTestRun/DeviceRun.aspx',1,'AD6E08B6-5571-4FFB-BDBE-9E6811770BD6','Menu_TestRun',0,1,1) +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('B4702BFB-8CEB-46AD-BDC0-751D146FE228','工作包设置',null,'TestRun/BeforeTestRun/SetWorkPackage.aspx',2,'AD6E08B6-5571-4FFB-BDBE-9E6811770BD6','Menu_TestRun',0,1,1) +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('34719347-E5EE-4491-9E92-B1270C187C7F','工作包裁剪',null,'TestRun/BeforeTestRun/SubSysWorkPackage.aspx',3,'AD6E08B6-5571-4FFB-BDBE-9E6811770BD6','Menu_TestRun',0,1,1) +INSERT INTO dbo.Sys_Menu(MenuId,MenuName,Icon,Url,SortIndex,SuperMenu,MenuType,IsOffice,IsEnd,IsUsed)VALUES('F0E06491-B1DA-4510-ABCA-D09F4B24EE50','子系统资产导入',null,'TestRun/BeforeTestRun/SysPipingDeviceImport.aspx',4,'AD6E08B6-5571-4FFB-BDBE-9E6811770BD6','Menu_TestRun',0,1,1) +go + +--==试车装置信息删除 +if object_id(N'PreRun_SysDevice',N'U') is not null +drop table dbo.PreRun_SysDevice +--==工作包设置删除 +if object_id(N'Work_Package',N'U') is not null +drop table dbo.Work_Package +--==子系统工作包管理删除 +if object_id(N'SubSys_WorkPackage',N'U') is not null +drop table dbo.SubSys_WorkPackage +--==管道一览表删除 +if object_id(N'Property_SysPiping',N'U') is not null +drop table dbo.Property_SysPiping +--==工艺设备一览表删除 +if object_id(N'Technology_SysPiping',N'U') is not null +drop table dbo.Technology_SysPiping +--==子系统选择管道信息删除 +if object_id(N'SubProperty_Select',N'U') is not null +drop table dbo.SubProperty_Select +--==子系统选择工艺设备信息删除 +if object_id(N'SubTechnology_Select',N'U') is not null +drop table dbo.SubTechnology_Select + +--==试车装置信息 +if object_id(N'PreRun_SysDevice',N'U') is not null +drop table dbo.PreRun_SysDevice +CREATE TABLE dbo.PreRun_SysDevice( + PreRunId varchar(50) NOT NULL,--主键 + PreRunCode varchar(50) NULL,--编码 + PreRunName varchar(50) NULL,--名称 + ProjectId varchar(50) NULL,--项目主键 + PreRunLevel int NULL,--类型1:装置 2:工序 3:系统 4:子系统 + InstallationId varchar(50) NULL,--装置主键(冗余字段,方便后期关联适用) + ProcessesId varchar(50) NULL,--工序主键(冗余字段,方便后期关联适用) + SystemId varchar(50) NULL,--系统主键(冗余字段,方便后期关联适用) + SubsystemId varchar(50) NULL,--子系统主键(冗余字段,方便后期关联适用) + ParentId varchar (50) NULL,--上级主键 + Remark nvarchar(150) NULL,--描述 + AddUser varchar(50) NULL,--添加人 + OperateTime datetime NULL,--操作日期 + Sort int NULL,--排序 + CONSTRAINT PK_PreRun_SysDevice PRIMARY KEY CLUSTERED +( + PreRunId 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 + +--==工作包设置 +if object_id(N'PreRun_WorkPackage',N'U') is not null +drop table dbo.PreRun_WorkPackage +CREATE TABLE dbo.PreRun_WorkPackage( + WorkPackId varchar(50) NOT NULL,--主键 + WorkPackCode varchar(50) NULL,--编码 + WorkPackName varchar(50) NULL,--名称 + Remark nvarchar(150) NULL,--备注 + AddUser varchar(50) NULL,--添加人 + AddTime datetime NULL,--添加日期 + Sort int NULL,--排序 + CONSTRAINT PK_PreRun_WorkPackage PRIMARY KEY CLUSTERED +( + WorkPackId 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 + +--预添加数据 +delete PreRun_WorkPackage where WorkPackId='1C01150C-977E-499A-9173-95F319BEEF87' +delete PreRun_WorkPackage where WorkPackId='641DA0F4-42A7-4DE3-9A57-95A606016655' +delete PreRun_WorkPackage where WorkPackId='BEB24AE8-F66D-458B-ADFD-3810405B5EB8' +delete PreRun_WorkPackage where WorkPackId='02BC1E1E-E531-4738-B6EC-5CE5BDC47B43' +delete PreRun_WorkPackage where WorkPackId='474F94B6-E927-4E9A-A544-F8E1AE63F6FF' +delete PreRun_WorkPackage where WorkPackId='3289A3D2-0691-4AD1-BDF3-1FD784564E71' +delete PreRun_WorkPackage where WorkPackId='445B915B-3E6D-47BE-BFF4-8762695ADB20' +delete PreRun_WorkPackage where WorkPackId='73C7D1D7-6DA3-44DD-A88B-7DF0FF15AA4F' +delete PreRun_WorkPackage where WorkPackId='8845C52D-4C56-442E-9237-CE33E8FC66AA' +delete PreRun_WorkPackage where WorkPackId='B0D040D4-5867-4335-9258-75504E73987E' +delete PreRun_WorkPackage where WorkPackId='84C6DAD6-3ED8-4869-ADB4-2EDA3512DB16' +delete PreRun_WorkPackage where WorkPackId='963E658B-CB53-4FEA-BA7D-723C538B2BD5' +delete PreRun_WorkPackage where WorkPackId='598A028A-5812-40E3-9D9D-5180A36F4453' +delete PreRun_WorkPackage where WorkPackId='6D827784-6ABD-4327-ABB7-FDABAC99853F' +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('1C01150C-977E-499A-9173-95F319BEEF87','WP01','单机试车','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),1) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('641DA0F4-42A7-4DE3-9A57-95A606016655','WP02','管道冲洗','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),2) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('BEB24AE8-F66D-458B-ADFD-3810405B5EB8','WP03','管道吹扫','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),3) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('02BC1E1E-E531-4738-B6EC-5CE5BDC47B43','WP04','蒸汽吹扫','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),4) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('474F94B6-E927-4E9A-A544-F8E1AE63F6FF','WP05','化学清洗','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),5) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('3289A3D2-0691-4AD1-BDF3-1FD784564E71','WP06','烘炉','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),6) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('445B915B-3E6D-47BE-BFF4-8762695ADB20','WP07','催化剂装填','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),7) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('73C7D1D7-6DA3-44DD-A88B-7DF0FF15AA4F','WP08','分子筛装填','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),8) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('8845C52D-4C56-442E-9237-CE33E8FC66AA','WP09','电气调试','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),9) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('B0D040D4-5867-4335-9258-75504E73987E','WP10','仪表调试','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),10) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('84C6DAD6-3ED8-4869-ADB4-2EDA3512DB16','WP11','汽轮机试车','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),11) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('963E658B-CB53-4FEA-BA7D-723C538B2BD5','WP12','大机组试车','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),12) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('598A028A-5812-40E3-9D9D-5180A36F4453','WP13','气密','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),13) +INSERT INTO dbo.PreRun_WorkPackage(WorkPackId,WorkPackCode,WorkPackName,Remark,AddUser,AddTime,Sort) +VALUES('6D827784-6ABD-4327-ABB7-FDABAC99853F','WP14','清洁度检查','','C4A62EC0-E5D3-4EBF-A5FA-E56AA89633C0',GETDATE(),14) +go + +--==子系统工作包管理 +if object_id(N'PreRun_SubSysWorkPackage',N'U') is not null +drop table dbo.PreRun_SubSysWorkPackage +CREATE TABLE dbo.PreRun_SubSysWorkPackage( + SubSysId varchar(50) NOT NULL,--主键 + SubSystemId varchar(50) NULL,--子系统主键 + WorkPackId varchar(50) NULL,--工作包主键 + WorkPackCode varchar(50) NULL,--工作包Code + Remark nvarchar(150) NULL,--备注 + AddUser varchar(50) NULL,--添加人 + AddTime datetime NULL,--添加日期 + Sort int NULL,--排序 + CONSTRAINT PK_PreRun_SubSysWorkPackage PRIMARY KEY CLUSTERED +( + SubSysId 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 + +--==管道一览表 +if object_id(N'PreRun_PropertySysPiping',N'U') is not null +drop table dbo.PreRun_PropertySysPiping +CREATE TABLE dbo.PreRun_PropertySysPiping( + PropertyId varchar(50) NOT NULL,--主键 + SystemId varchar(50) NULL,--系统主键 + ProjectId varchar(50) NULL,--项目主键 + PipingCode varchar(50) NULL,--管道号 + Diameter varchar(50) NULL,--直径 + MaterialLevel varchar(50) NULL,--管道材料等级 + AdiabatType varchar(50) NULL,--绝热伴热类型 + AdiabatThickness varchar(50) NULL,--绝热伴热厚度 + MediumState varchar(50) NULL,--介质相态 + DrawingNo varchar(50) NULL,--P&ID图号 + PipingStart varchar(50) NULL,--管道起点 + PipingEnd varchar(50) NULL,--管道止点 + PipingLevel varchar(50) NULL,--压力管道级别 + NormalTemperature varchar(50) NULL,--正常条件温度 + NormalPressure varchar(50) NULL,--正常条件压力 + DesignTemperature varchar(50) NULL,--设计条件温度 + DesignPressure varchar(50) NULL,--设计条件压力 + PaintLevel varchar(50) NULL,--涂漆等级 + Remark nvarchar(150) NULL,--备注 + AddUser varchar(50) NULL,--添加人 + AddTime datetime NULL,--添加日期 + Sort int NULL,--排序 + CONSTRAINT PK_PreRun_PropertySysPiping PRIMARY KEY CLUSTERED +( + PropertyId 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 + +--==工艺设备一览表 +if object_id(N'PreRun_TechnologySysPiping',N'U') is not null +drop table dbo.PreRun_TechnologySysPiping +CREATE TABLE dbo.PreRun_TechnologySysPiping( + TechnologyId varchar(50) NOT NULL,--主键 + SystemId varchar(50) NULL,--系统主键 + ProjectId varchar(50) NULL,--项目主键 + TagNumber varchar(50) NULL,--设备位号 + NameSpecifications varchar(max) NULL,--设备名称和规格 + DrawingNo varchar(50) NULL,--图号或型号 + Materials varchar(50) NULL,--制造材料 + NumOperate varchar(50) NULL,--数量操作 + NumStandby varchar(50) NULL,--数量备用 + WeightSingle varchar(50) NULL,--重量单重 + WeightTotal varchar(50) NULL,--重量总重 + Remark nvarchar(150) NULL,--备注 + AddUser varchar(50) NULL,--添加人 + AddTime datetime NULL,--添加日期 + Sort int NULL,--排序 + CONSTRAINT PK_PreRun_TechnologySysPiping PRIMARY KEY CLUSTERED +( + TechnologyId 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 + +--==子系统选择管道信息 +if object_id(N'PreRun_SubPropertySelect',N'U') is not null +drop table dbo.PreRun_SubPropertySelect +CREATE TABLE dbo.PreRun_SubPropertySelect( + SubPropertyId varchar(50) NOT NULL,--主键 + ProjectId varchar(50) NULL,--项目主键 + SubSystemId varchar(50) NULL,--子系统主键 + PropertyId varchar(50) NOT NULL,--管道主键 + Remark nvarchar(150) NULL,--备注 + AddUser varchar(50) NULL,--添加人 + AddTime datetime NULL,--添加日期 + Sort int NULL,--排序 + CONSTRAINT PK_PreRun_SubPropertySelect PRIMARY KEY CLUSTERED +( + SubPropertyId 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 + +--==子系统选择工艺设备信息 +if object_id(N'PreRun_SubTechnologySelect',N'U') is not null +drop table dbo.PreRun_SubTechnologySelect +CREATE TABLE dbo.PreRun_SubTechnologySelect( + SubTechnologyId varchar(50) NOT NULL,--主键 + ProjectId varchar(50) NULL,--项目主键 + SubSystemId varchar(50) NULL,--子系统主键 + TechnologyId varchar(50) NULL,--主键 + Remark nvarchar(150) NULL,--备注 + AddUser varchar(50) NULL,--添加人 + AddTime datetime NULL,--添加日期 + Sort int NULL,--排序 + CONSTRAINT PK_PreRun_SubTechnologySelect PRIMARY KEY CLUSTERED +( + SubTechnologyId 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 \ No newline at end of file diff --git a/SGGL/BLL/BLL.csproj b/SGGL/BLL/BLL.csproj index f4f68133..1772261c 100644 --- a/SGGL/BLL/BLL.csproj +++ b/SGGL/BLL/BLL.csproj @@ -193,6 +193,7 @@ + diff --git a/SGGL/BLL/Common/Const.cs b/SGGL/BLL/Common/Const.cs index 2918270d..e3a2ef11 100644 --- a/SGGL/BLL/Common/Const.cs +++ b/SGGL/BLL/Common/Const.cs @@ -3074,6 +3074,18 @@ namespace BLL /// public const string DesignDrawingsDataInUrl = "File\\Excel\\DataIn\\图纸收发记录导入模板.xls"; /// + /// 试车装置信息 + /// + public const string PreRunUrl = "File\\Excel\\TestRun\\系统划分.xlsx"; + /// + /// 管道一览表 + /// + public const string PropertyUrl = "File\\Excel\\TestRun\\管道一览表.xlsx"; + /// + /// 设备一览表 + /// + public const string TechnologyUrl = "File\\Excel\\TestRun\\设备一览表.xlsx"; + /// /// NCR管理导入模版文件原始的虚拟路径 /// public const string NCRManagementDataInUrl = "File\\Excel\\DataIn\\NCR管理导入模板.xls"; diff --git a/SGGL/BLL/Common/NPOIHelper.cs b/SGGL/BLL/Common/NPOIHelper.cs new file mode 100644 index 00000000..505431e9 --- /dev/null +++ b/SGGL/BLL/Common/NPOIHelper.cs @@ -0,0 +1,630 @@ +using NPOI.HSSF.UserModel; +using NPOI.SS.UserModel; +using NPOI.XSSF.UserModel; +using System; +using System.Collections; +using System.Collections.Generic; +using System.Data; +using System.IO; +using System.Linq; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace BLL +{ + public class NPOIHelper + { + #region 导入 + + /// + /// Excel转换成DataTable(.xls) + /// + /// Excel文件路径 + /// + public static DataTable ExcelToDataTable(string filePath) + { + var dt = new DataTable(); + using (var file = new FileStream(filePath, FileMode.Open, FileAccess.Read)) + { + var hssfworkbook = new HSSFWorkbook(file); + var sheet = hssfworkbook.GetSheetAt(0); + for (var j = 0; j < 5; j++) + { + dt.Columns.Add(Convert.ToChar(((int)'A') + j).ToString()); + } + var rows = sheet.GetRowEnumerator(); + while (rows.MoveNext()) + { + var row = (HSSFRow)rows.Current; + var dr = dt.NewRow(); + for (var i = 0; i < row.LastCellNum; i++) + { + var cell = row.GetCell(i); + if (cell == null) + { + dr[i] = null; + } + else + { + switch (cell.CellType) + { + case CellType.Blank: + dr[i] = "[null]"; + break; + case CellType.Boolean: + dr[i] = cell.BooleanCellValue; + break; + case CellType.Numeric: + dr[i] = cell.ToString(); + break; + case CellType.String: + dr[i] = cell.StringCellValue; + break; + case CellType.Error: + dr[i] = cell.ErrorCellValue; + break; + case CellType.Formula: + try + { + dr[i] = cell.NumericCellValue; + } + catch + { + dr[i] = cell.StringCellValue; + } + break; + default: + dr[i] = "=" + cell.CellFormula; + break; + } + } + } + dt.Rows.Add(dr); + } + } + return dt; + } + + /// + /// Excel转换成DataSet(.xlsx/.xls) + /// + /// Excel文件路径 + /// + /// 第一行是否为表头 + /// + public static DataSet ExcelToDataSet(string filePath, out string strMsg, bool firstTitle = false) + { + strMsg = ""; + DataSet ds = new DataSet(); + DataTable dt = new DataTable(); + string fileType = Path.GetExtension(filePath).ToLower(); + string fileName = Path.GetFileName(filePath).ToLower(); + try + { + ISheet sheet = null; + int sheetNumber = 0; + FileStream fs = new FileStream(filePath, FileMode.Open, FileAccess.Read); + if (fileType == ".xlsx") + { + // 2007版本 + fs.Position = 0; + XSSFWorkbook workbook = new XSSFWorkbook(fs); + sheetNumber = workbook.NumberOfSheets; + for (int i = 0; i < sheetNumber; i++) + { + string sheetName = workbook.GetSheetName(i); + sheet = workbook.GetSheet(sheetName); + if (sheet != null) + { + dt = firstTitle ? GetFirstSheetDataTable(sheet, out strMsg) : GetSheetDataTable(sheet, out strMsg); + if (dt != null) + { + dt.TableName = sheetName.Trim(); + ds.Tables.Add(dt); + } + else + { + strMsg = "Sheet数据获取失败,原因:" + strMsg; + } + } + } + } + else if (fileType == ".xls") + { + // 2003版本 + HSSFWorkbook workbook = new HSSFWorkbook(fs); + sheetNumber = workbook.NumberOfSheets; + for (int i = 0; i < sheetNumber; i++) + { + string sheetName = workbook.GetSheetName(i); + sheet = workbook.GetSheet(sheetName); + if (sheet != null) + { + //dt = GetSheetDataTable(sheet, out strMsg); + dt = firstTitle ? GetFirstSheetDataTable(sheet, out strMsg) : GetSheetDataTable(sheet, out strMsg); + if (dt != null) + { + dt.TableName = sheetName.Trim(); + ds.Tables.Add(dt); + } + else + { + strMsg = "Sheet数据获取失败,原因:" + strMsg; + } + } + } + } + return ds; + } + catch (Exception ex) + { + strMsg = ex.Message; + return null; + } + } + /// + /// 获取sheet表对应的DataTable + /// + /// Excel工作表 + /// + /// + private static DataTable GetSheetDataTable(ISheet sheet, out string strMsg) + { + strMsg = ""; + DataTable dt = new DataTable(); + string sheetName = sheet.SheetName; + int startIndex = 0;// sheet.FirstRowNum; + int lastIndex = sheet.LastRowNum; + //最大列数 + int cellCount = 0; + IRow maxRow = sheet.GetRow(0); + for (int i = startIndex; i <= lastIndex; i++) + { + IRow row = sheet.GetRow(i); + if (row != null && cellCount < row.LastCellNum) + { + cellCount = row.LastCellNum; + maxRow = row; + } + } + //列名设置 + try + { + for (int i = 0; i < maxRow.LastCellNum; i++) + { + dt.Columns.Add(Convert.ToChar(((int)'A') + i).ToString()); + } + } + catch + { + strMsg = "工作表" + sheetName + "中无数据"; + return null; + } + //数据填充 + for (int i = startIndex; i <= lastIndex; i++) + { + IRow row = sheet.GetRow(i); + DataRow drNew = dt.NewRow(); + if (row != null) + { + for (int j = row.FirstCellNum; j < row.LastCellNum; ++j) + { + if (row.GetCell(j) != null) + { + ICell cell = row.GetCell(j); + switch (cell.CellType) + { + case CellType.Blank: + drNew[j] = ""; + break; + case CellType.Numeric: + short format = cell.CellStyle.DataFormat; + //对时间格式(2015.12.5、2015/12/5、2015-12-5等)的处理 + if (format == 14 || format == 31 || format == 57 || format == 58) + drNew[j] = cell.DateCellValue; + else + drNew[j] = cell.NumericCellValue; + if (cell.CellStyle.DataFormat == 177 || cell.CellStyle.DataFormat == 178 || cell.CellStyle.DataFormat == 188) + drNew[j] = cell.NumericCellValue.ToString("#0.00"); + break; + case CellType.String: + drNew[j] = cell.StringCellValue; + break; + case CellType.Formula: + try + { + drNew[j] = cell.NumericCellValue; + if (cell.CellStyle.DataFormat == 177 || cell.CellStyle.DataFormat == 178 || cell.CellStyle.DataFormat == 188) + drNew[j] = cell.NumericCellValue.ToString("#0.00"); + } + catch + { + try + { + drNew[j] = cell.StringCellValue; + } + catch { } + } + break; + default: + drNew[j] = cell.StringCellValue; + break; + } + } + } + } + dt.Rows.Add(drNew); + } + return dt; + } + + /// + /// 默认第一行为表头,获取sheet表对应的DataTable + /// + /// Excel工作表 + /// + /// + private static DataTable GetFirstSheetDataTable(ISheet sheet, out string strMsg) + { + strMsg = string.Empty; + DataTable dt = new DataTable(); + FileStream file = null; + try + { + + //ISheet sheet = Workbook.GetSheetAt(0);//读取第一个sheet + System.Collections.IEnumerator rows = sheet.GetRowEnumerator(); + //得到Excel工作表的行 + IRow headerRow = sheet.GetRow(0); + //得到Excel工作表的总列数 + int cellCount = headerRow.LastCellNum; + + for (int j = 0; j < cellCount; j++) + { + //得到Excel工作表指定行的单元格 + ICell cell = headerRow.GetCell(j); + if (cell != null) + { + dt.Columns.Add(cell.ToString().Trim()); + } + else + { + dt.Columns.Add(j.ToString()); + } + } + + for (int i = (sheet.FirstRowNum + 1); i <= sheet.LastRowNum; i++) + { + IRow row = sheet.GetRow(i); + DataRow dataRow = dt.NewRow(); + + for (int j = row.FirstCellNum; j < cellCount; j++) + { + if (row.PhysicalNumberOfCells != 0 && row.GetCell(j) != null) + { + try + { + if (row.GetCell(j).CellType == CellType.Numeric && DateUtil.IsCellDateFormatted(row.GetCell(j))) + { + //dataRow[j] = row.GetCell(j).DateCellValue; + var cell = row.GetCell(j); + short format = cell.CellStyle.DataFormat; + //对时间格式(2015.12.5、2015/12/5、2015-12-5等)的处理 + if (HSSFDateUtil.IsCellDateFormatted(cell)) + { + dataRow[j] = DateTime.FromOADate(cell.NumericCellValue);//cell.DateCellValue; + } + else + { + dataRow[j] = cell.NumericCellValue; + } + if (cell.CellStyle.DataFormat == 177 || cell.CellStyle.DataFormat == 178 || cell.CellStyle.DataFormat == 188) + { + dataRow[j] = cell.NumericCellValue.ToString("#0.00"); + } + } + else + { + dataRow[j] = row.GetCell(j).ToString().Trim(); + } + } + catch (Exception ex) + { + dataRow[j] = ""; + } + } + } + dt.Rows.Add(dataRow); + } + + return dt; + + } + catch (Exception ex) + { + strMsg = ex.Message; + if (file != null) + { + file.Close();//关闭当前流并释放资源 + } + return null; + } + } + + /// 读取excel 到datatable + /// 默认第一行为表头,导入第一个工作表 + /// + /// excel文档路径 + /// + public static DataTable FirstTitleExcelToDataTable(string strFileName) + { + DataTable dt = new DataTable(); + FileStream file = null; + IWorkbook Workbook = null; + try + { + + using (file = new FileStream(strFileName, FileMode.Open, FileAccess.Read))//C#文件流读取文件 + { + if (strFileName.IndexOf(".xlsx") > 0) + //把xlsx文件中的数据写入Workbook中 + Workbook = new XSSFWorkbook(file); + + else if (strFileName.IndexOf(".xls") > 0) + //把xls文件中的数据写入Workbook中 + Workbook = new HSSFWorkbook(file); + + if (Workbook != null) + { + ISheet sheet = Workbook.GetSheetAt(0);//读取第一个sheet + System.Collections.IEnumerator rows = sheet.GetRowEnumerator(); + //得到Excel工作表的行 + IRow headerRow = sheet.GetRow(0); + //得到Excel工作表的总列数 + int cellCount = headerRow.LastCellNum; + + for (int j = 0; j < cellCount; j++) + { + //得到Excel工作表指定行的单元格 + ICell cell = headerRow.GetCell(j); + dt.Columns.Add(cell.ToString()); + } + + for (int i = (sheet.FirstRowNum + 1); i <= sheet.LastRowNum; i++) + { + IRow row = sheet.GetRow(i); + DataRow dataRow = dt.NewRow(); + + for (int j = row.FirstCellNum; j < cellCount; j++) + { + if (row.GetCell(j) != null) + dataRow[j] = row.GetCell(j).ToString(); + } + dt.Rows.Add(dataRow); + } + } + return dt; + } + } + catch (Exception) + { + if (file != null) + { + file.Close();//关闭当前流并释放资源 + } + return null; + } + + } + + #endregion + + #region 导出 + /// + /// DataSet导出excel,多个sheet + /// + /// + /// + /// + public static string DataSetToExcel(DataSet ds, string Path) + { + var result = string.Empty; + FileStream fs = null; + XSSFWorkbook workbook = new XSSFWorkbook(); + for (int i = 0; i < ds.Tables.Count; i++) + { + XSSFSheet sheet = (XSSFSheet)workbook.CreateSheet(ds.Tables[i].TableName); + + XSSFCellStyle dateStyle = (XSSFCellStyle)workbook.CreateCellStyle(); + XSSFDataFormat format = (XSSFDataFormat)workbook.CreateDataFormat(); + dateStyle.DataFormat = format.GetFormat("yyyy-mm-dd"); + + int rowIndex = 0; + + #region 新建表,填充表头,填充列头,样式 + if (rowIndex == 0) + { + //#region 列头及样式 + //{ + // XSSFRow headerRow = (XSSFRow)sheet.CreateRow(0); + // XSSFCellStyle headStyle = (XSSFCellStyle)workbook.CreateCellStyle(); + // //headStyle.Alignment = CellHorizontalAlignment.CENTER; + // XSSFFont font = (XSSFFont)workbook.CreateFont(); + // font.FontHeightInPoints = 10; + // font.Boldweight = 700; + // headStyle.SetFont(font); + //} + //#endregion + //填充表头 + XSSFRow dataRow = (XSSFRow)sheet.CreateRow(rowIndex); + foreach (DataColumn column in ds.Tables[i].Columns) + { + dataRow.CreateCell(column.Ordinal).SetCellValue(column.ColumnName); + } + + rowIndex = 1; + } + #endregion + + foreach (DataRow row in ds.Tables[i].Rows) + { + XSSFRow dataRow = (XSSFRow)sheet.CreateRow(rowIndex); + + #region 填充内容 + foreach (DataColumn column in ds.Tables[i].Columns) + { + XSSFCell newCell = (XSSFCell)dataRow.CreateCell(column.Ordinal); + string type = row[column].GetType().FullName.ToString(); + newCell.SetCellValue(GetValue(row[column].ToString(), type)); + } + #endregion + + rowIndex++; + } + } + + using (fs = File.OpenWrite(Path)) + { + workbook.Write(fs);//向打开的这个xls文件中写入数据 + result = Path; + } + return result; + } + + private static string GetValue(string cellValue, string type) + { + object value = string.Empty; + switch (type) + { + case "System.String"://字符串类型 + value = cellValue; + break; + case "System.DateTime"://日期类型 + System.DateTime dateV; + System.DateTime.TryParse(cellValue, out dateV); + value = dateV; + break; + case "System.Boolean"://布尔型 + bool boolV = false; + bool.TryParse(cellValue, out boolV); + value = boolV; + break; + case "System.Int16"://整型 + case "System.Int32": + case "System.Int64": + case "System.Byte": + int intV = 0; + int.TryParse(cellValue, out intV); + value = intV; + break; + case "System.Decimal"://浮点型 + case "System.Double": + double doubV = 0; + double.TryParse(cellValue, out doubV); + value = doubV; + break; + case "System.DBNull"://空值处理 + value = string.Empty; + break; + default: + value = string.Empty; + break; + } + return value.ToString(); + } + + #endregion + + #region List转DataTable + /// + /// 方法一 + /// + public static DataTable ToDataTable(List items) + { + var tb = new DataTable(typeof(T).Name); + + PropertyInfo[] props = typeof(T).GetProperties(BindingFlags.Public | BindingFlags.Instance); + + foreach (PropertyInfo prop in props) + { + Type t = GetCoreType(prop.PropertyType); + tb.Columns.Add(prop.Name, t); + } + + foreach (T item in items) + { + var values = new object[props.Length]; + + for (int i = 0; i < props.Length; i++) + { + values[i] = props[i].GetValue(item, null); + } + + tb.Rows.Add(values); + } + + return tb; + } + + /// + /// 字段类型 + /// + public static bool IsNullable(Type t) + { + return !t.IsValueType || (t.IsGenericType && t.GetGenericTypeDefinition() == typeof(Nullable<>)); + } + + /// + /// 返回字段值 + /// + public static Type GetCoreType(Type t) + { + if (t != null && IsNullable(t)) + { + if (!t.IsValueType) + { + return t; + } + else + { + return Nullable.GetUnderlyingType(t); + } + } + else + { + return t; + } + } + + /// + /// 方法二 + /// + /// + /// + /// + public static DataTable ToDataTable(IEnumerable collection) + { + var props = typeof(T).GetProperties(); + var dt = new DataTable(); + dt.Columns.AddRange(props.Select(p => new DataColumn(p.Name, p.PropertyType)).ToArray()); + if (collection.Count() > 0) + { + for (int i = 0; i < collection.Count(); i++) + { + ArrayList tempList = new ArrayList(); + foreach (PropertyInfo pi in props) + { + object obj = pi.GetValue(collection.ElementAt(i), null); + tempList.Add(obj); + } + object[] array = tempList.ToArray(); + dt.LoadDataRow(array, true); + } + } + return dt; + } + + #endregion + } +} diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionMachine.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionMachine.aspx.cs index 0cca4fab..d4b8fa5b 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionMachine.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionMachine.aspx.cs @@ -105,22 +105,26 @@ namespace FineUIPro.Web.Comprehensive DataRowView row = e.DataItem as DataRowView; string IsVerification = row["IsVerification"].ToString(); string NextTestDate = row["NextTestDate"].ToString(); - if (IsVerification=="是" && !string.IsNullOrEmpty(NextTestDate)) //在校验期内 + string InspectionType= row["InspectionType"].ToString(); + if (InspectionType == "计量") { - if (DateTime.Compare(DateTime.Parse(NextTestDate).AddDays(-15), DateTime.Now) < 0) + if (IsVerification == "是" && !string.IsNullOrEmpty(NextTestDate)) //在校验期内 { - // Grid1.Rows[e.RowIndex].RowCssClass = "Red"; - //过期为红色 - e.RowCssClass = "Red"; + if (DateTime.Compare(DateTime.Parse(NextTestDate).AddDays(-15), DateTime.Now) < 0) + { + // Grid1.Rows[e.RowIndex].RowCssClass = "Red"; + //过期为红色 + e.RowCssClass = "Red"; + + } + } + else + { + e.RowCssClass = "Yellow"; + } } - else - { - e.RowCssClass = "Yellow"; - - - } } #region 查询 diff --git a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonEdit.aspx.cs b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonEdit.aspx.cs index 7348c717..ff8d9a65 100644 --- a/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/CQMS/Comprehensive/InspectionPersonEdit.aspx.cs @@ -215,14 +215,14 @@ namespace FineUIPro.Web.CQMS.Comprehensive Alert.ShowInTop("请选择报验单位!", MessageBoxIcon.Warning); return; } - if (this.drpPostId.SelectedText == "焊工") - { - if (string.IsNullOrEmpty(txtWelderCode.Text.Trim())) - { - Alert.ShowInTop("焊工编号必填!", MessageBoxIcon.Warning); - return; - } - } + //if (this.drpPostId.SelectedText == "焊工") + //{ + //if (string.IsNullOrEmpty(txtWelderCode.Text.Trim())) + //{ + // Alert.ShowInTop("焊工编号必填!", MessageBoxIcon.Warning); + // return; + //} + //} // 焊工部分 Model.BS_Welder welder = new Model.BS_Welder(); if (this.drpUnitId.SelectedValue != BLL.Const._Null) diff --git a/SGGL/FineUIPro.Web/ErrLog.txt b/SGGL/FineUIPro.Web/ErrLog.txt index 02a6c9bc..068129e6 100644 --- a/SGGL/FineUIPro.Web/ErrLog.txt +++ b/SGGL/FineUIPro.Web/ErrLog.txt @@ -414,3 +414,107 @@ IP地址:::1 出错时间:06/26/2023 11:10:07 + +错误信息开始=====> +错误类型:ArgumentException +错误信息:提供的 URI 方案“http”无效,应为“https”。 +参数名: via +错误堆栈: + 在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via) + 在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via) + 在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.ChannelFactory`1.CreateChannel() + 在 System.ServiceModel.ClientBase`1.CreateChannel() + 在 System.ServiceModel.ClientBase`1.CreateChannelInternal() + 在 System.ServiceModel.ClientBase`1.get_Channel() + 在 BLL.CNCECHSSEService.HSSEServiceClient.GetSupervise_SubUnitReportListToSUB() 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\Service References\CNCECHSSEService\Reference.cs:行号 14204 + 在 BLL.CNCECHSSEWebService.getSupervise_SubUnitReport() 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 2158 +出错时间:06/26/2023 13:13:47 +出错时间:06/26/2023 13:13:47 + + +错误信息开始=====> +错误类型:ArgumentException +错误信息:提供的 URI 方案“http”无效,应为“https”。 +参数名: via +错误堆栈: + 在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via) + 在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via) + 在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.ChannelFactory`1.CreateChannel() + 在 System.ServiceModel.ClientBase`1.CreateChannel() + 在 System.ServiceModel.ClientBase`1.CreateChannelInternal() + 在 System.ServiceModel.ClientBase`1.get_Channel() + 在 BLL.CNCECHSSEService.HSSEServiceClient.GetCheck_CheckInfo_Table8ItemListToSUB(String unitId) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\Service References\CNCECHSSEService\Reference.cs:行号 14228 + 在 BLL.CNCECHSSEWebService.getCheck_CheckInfo_Table8Item() 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 2023 +出错时间:06/26/2023 13:13:47 +出错时间:06/26/2023 13:13:47 + + +错误信息开始=====> +错误类型:ArgumentException +错误信息:提供的 URI 方案“http”无效,应为“https”。 +参数名: via +错误堆栈: + 在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via) + 在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via) + 在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.ChannelFactory`1.CreateChannel() + 在 System.ServiceModel.ClientBase`1.CreateChannel() + 在 System.ServiceModel.ClientBase`1.CreateChannelInternal() + 在 System.ServiceModel.ClientBase`1.get_Channel() + 在 BLL.CNCECHSSEService.HSSEServiceClient.GetCheck_CheckRectifyListToSUB(String unitId) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\Service References\CNCECHSSEService\Reference.cs:行号 14220 + 在 BLL.CNCECHSSEWebService.getCheck_CheckRectify() 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 1919 +出错时间:06/26/2023 13:13:47 +出错时间:06/26/2023 13:13:47 + + +错误信息开始=====> +错误类型:ArgumentException +错误信息:提供的 URI 方案“http”无效,应为“https”。 +参数名: via +错误堆栈: + 在 System.ServiceModel.Channels.TransportChannelFactory`1.ValidateScheme(Uri via) + 在 System.ServiceModel.Channels.HttpChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.HttpsChannelFactory`1.ValidateCreateChannelParameters(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.HttpsChannelFactory`1.OnCreateChannelCore(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.HttpChannelFactory`1.OnCreateChannel(EndpointAddress remoteAddress, Uri via) + 在 System.ServiceModel.Channels.ChannelFactoryBase`1.InternalCreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ChannelFactoryBase`1.CreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.ServiceChannelFactoryOverRequest.CreateInnerChannelBinder(EndpointAddress to, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateServiceChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.Channels.ServiceChannelFactory.CreateChannel(Type channelType, EndpointAddress address, Uri via) + 在 System.ServiceModel.ChannelFactory`1.CreateChannel(EndpointAddress address, Uri via) + 在 System.ServiceModel.ChannelFactory`1.CreateChannel() + 在 System.ServiceModel.ClientBase`1.CreateChannel() + 在 System.ServiceModel.ClientBase`1.CreateChannelInternal() + 在 System.ServiceModel.ClientBase`1.get_Channel() + 在 BLL.CNCECHSSEService.HSSEServiceClient.GetInformation_UrgeReportToSUB(String unitId) 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\Service References\CNCECHSSEService\Reference.cs:行号 14020 + 在 BLL.CNCECHSSEWebService.getInformation_UrgeReport() 位置 E:\工作\五环施工平台\SGGL_CWCEC\SGGL\BLL\WebService\CNCECHSSEWebService.cs:行号 1861 +出错时间:06/26/2023 13:13:47 +出错时间:06/26/2023 13:13:47 + diff --git a/SGGL/FineUIPro.Web/File/Excel/TestRun/管道一览表.xlsx b/SGGL/FineUIPro.Web/File/Excel/TestRun/管道一览表.xlsx new file mode 100644 index 00000000..2c1f4f69 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/TestRun/管道一览表.xlsx differ diff --git a/SGGL/FineUIPro.Web/File/Excel/TestRun/系统划分.xlsx b/SGGL/FineUIPro.Web/File/Excel/TestRun/系统划分.xlsx new file mode 100644 index 00000000..25bfd477 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/TestRun/系统划分.xlsx differ diff --git a/SGGL/FineUIPro.Web/File/Excel/TestRun/设备一览表.xlsx b/SGGL/FineUIPro.Web/File/Excel/TestRun/设备一览表.xlsx new file mode 100644 index 00000000..c6be63f1 Binary files /dev/null and b/SGGL/FineUIPro.Web/File/Excel/TestRun/设备一览表.xlsx differ diff --git a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj index ed2b276f..9a33d0f3 100644 --- a/SGGL/FineUIPro.Web/FineUIPro.Web.csproj +++ b/SGGL/FineUIPro.Web/FineUIPro.Web.csproj @@ -1592,8 +1592,11 @@ + + + @@ -14794,6 +14797,20 @@ DeviceRunEdit.aspx + + SelectProperty.aspx + ASPXCodeBehind + + + SelectProperty.aspx + + + SelectTechnology.aspx + ASPXCodeBehind + + + SelectTechnology.aspx + SetWorkPackage.aspx ASPXCodeBehind @@ -14808,6 +14825,13 @@ SubSysWorkPackage.aspx + + SysPipingDeviceImport.aspx + ASPXCodeBehind + + + SysPipingDeviceImport.aspx + GoodsBuy.aspx ASPXCodeBehind diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx index f74fd6a5..bad3b6db 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx @@ -8,7 +8,7 @@
- + + + + + - @@ -38,11 +41,9 @@ - - - - - + + + diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx.cs index c7cce427..884d0a96 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Data.SqlClient; +using System.IO; using System.Linq; using System.Web; using System.Web.UI; @@ -32,7 +33,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun (case a.PreRunLevel when 1 then '装置' when 2 then '工序' when 3 then 'S系统' when 4 then 'SS子系统' else '' end) as RunLevelName, a.ParentId,a.Remark,a.OperateTime,a.Sort from PreRun_SysDevice as a - inner join Base_Project as b on a.ProjectId=b.ProjectId where a.ProjectId=@ProjectId "; + inner join Base_Project as b on a.ProjectId=b.ProjectId where a.ProjectId=@ProjectId order by a.Sort,a.PreRunLevel asc"; List listStr = new List(); listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); if (!string.IsNullOrEmpty(sRunName.Text.Trim())) @@ -149,14 +150,6 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun PageContext.RegisterStartupScript(Window1.GetShowReference($"DeviceRunEdit.aspx?RunId={rowId}&ParentId={parentId}", "编辑")); } - /// - /// 保存 - /// - protected void btnSave_Click(object sender, EventArgs e) - { - - } - /// /// 关闭 /// @@ -165,6 +158,442 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun DataBrid(); } + /// + /// 导入 + /// + protected void btnImport_Click(object sender, EventArgs e) + { + try + { + if (this.fileData.HasFile == false) + { + ShowNotify("请选择excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.fileData.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls" && IsXls != ".xlsx") + { + ShowNotify("excel文件类型错误!", MessageBoxIcon.Warning); + return; + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + Const.ExcelUrl; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + //指定上传文件名称 + string fileUrl = BLL.Funs.GetNewFileName() + IsXls; + //上传文件路径 + string filePath = initFullPath + fileUrl; + //文件上传服务器 + this.fileData.PostedFile.SaveAs(filePath); + //文件上传服务器后的名称 + string fileName = rootPath + Const.ExcelUrl + fileUrl; + //读取Excel + DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out string message, false); + if (ds == null) + { + ShowNotify("模板错误,请从系统下载正确的模板!", MessageBoxIcon.Warning); + return; + } + if (!string.IsNullOrWhiteSpace(message)) + { + ShowNotify(message, MessageBoxIcon.Warning); + return; + } + if (ds.Tables[0].Rows.Count > 1) + { + var fileVerify = VerifyFile(ds); + if (!fileVerify) + { + ShowNotify("请获取正确模板!", MessageBoxIcon.Warning); + return; + } + + int index = 1; + List list = new List(); + foreach (DataRow item in ds.Tables[0].Rows) + { + SysDeviceDto model = new SysDeviceDto(); + if (index == 1) + { + index++; + continue; + } + if (StrIsNumm(item[0]) || StrIsNumm(item[1])) + { + ShowNotify($"{index}行装置编码或名称为空!", MessageBoxIcon.Warning); + break; + } + + //判断是否为装置 + if (!StrIsNumm(item[0]) && !StrIsNumm(item[1]) && StrIsNumm(item[2]) && StrIsNumm(item[3]) && StrIsNumm(item[4]) && StrIsNumm(item[5]) && StrIsNumm(item[6]) && StrIsNumm(item[7])) + { + model.InstallationCode = item[0].ToString(); + model.InstallationName = item[1].ToString(); + model.Level = 1; + } + //判断是否为工序 + else if (!StrIsNumm(item[0]) && !StrIsNumm(item[1]) && !StrIsNumm(item[2]) && !StrIsNumm(item[3]) && StrIsNumm(item[4]) && StrIsNumm(item[5]) && StrIsNumm(item[6]) && StrIsNumm(item[7])) + { + model.InstallationCode = item[0].ToString(); + model.InstallationName = item[1].ToString(); + model.ProcessesCode = item[2].ToString(); + model.ProcessesName = item[3].ToString(); + model.Level = 2; + } + //判断是否为系统 + else if (!StrIsNumm(item[0]) && !StrIsNumm(item[1]) && !StrIsNumm(item[2]) && !StrIsNumm(item[3]) && !StrIsNumm(item[4]) && !StrIsNumm(item[5]) && StrIsNumm(item[6]) && StrIsNumm(item[7])) + { + model.InstallationCode = item[0].ToString(); + model.InstallationName = item[1].ToString(); + model.ProcessesCode = item[2].ToString(); + model.ProcessesName = item[3].ToString(); + model.SystemCode = item[4].ToString(); + model.SystemName = item[5].ToString(); + model.Level = 3; + } + //判断是否为子系统 + else if (!StrIsNumm(item[0]) && !StrIsNumm(item[1]) && !StrIsNumm(item[2]) && !StrIsNumm(item[3]) && !StrIsNumm(item[4]) && !StrIsNumm(item[5]) && !StrIsNumm(item[6]) && !StrIsNumm(item[7])) + { + model.InstallationCode = item[0].ToString(); + model.InstallationName = item[1].ToString(); + model.ProcessesCode = item[2].ToString(); + model.ProcessesName = item[3].ToString(); + model.SystemCode = item[4].ToString(); + model.SystemName = item[5].ToString(); + model.SubsystemCode = item[6].ToString(); + model.SubsystemName = item[7].ToString(); + model.Level = 4; + } + else + { + + ShowNotify($"{index}行数据存在错误,数据格式具体见模板说明为空!", MessageBoxIcon.Warning); + break; + } + list.Add(model); + index++; + } + + #region 数据验证 + + //验证装置编码 + if (list.Count(x => x.Level == 1) > 0) + { + var installationCodes = list.Where(x => x.Level == 1).Select(a => a.InstallationCode); + var importCodes = installationCodes.GroupBy(x => x).Where(x => x.Count() > 1).Select(x => x.Key).ToList(); + if (importCodes.Count > 0) + { + ShowNotify($"EXCEL中装置编码{string.Join(",", importCodes)}重复,请调整模板数据!", MessageBoxIcon.Warning); + return; + } + installationCodes = installationCodes.Distinct(); + if (installationCodes.Count() > 0) + { + var existInstallations = Funs.DB.PreRun_SysDevice.Where(a => installationCodes.Contains(a.PreRunCode) && a.PreRunLevel == 1 && a.ProjectId == this.CurrUser.LoginProjectId).ToList(); + if (existInstallations.Count > 0) + { + ShowNotify($"装置编码({string.Join(",", existInstallations.ConvertAll(s => s.PreRunCode))})已存在!", MessageBoxIcon.Warning); + return; + } + } + + } + //验证工序编码 + if (list.Count(x => x.Level == 2) > 0) + { + var processesCodes = list.Where(x => x.Level == 2).Select(a => a.ProcessesCode); + var importCodes = processesCodes.GroupBy(x => x).Where(x => x.Count() > 1).Select(x => x.Key).ToList(); + if (importCodes.Count > 0) + { + ShowNotify($"EXCEL中工序编码{string.Join(",", importCodes)}重复,请调整模板数据!", MessageBoxIcon.Warning); + return; + } + processesCodes = processesCodes.Distinct(); + if (processesCodes.Count() > 0) + { + var existProcessess = Funs.DB.PreRun_SysDevice.Where(a => processesCodes.Contains(a.PreRunCode) && a.PreRunLevel == 2 && a.ProjectId == this.CurrUser.LoginProjectId).ToList(); + if (existProcessess.Count > 0) + { + ShowNotify($"工序编码({string.Join(",", existProcessess.ConvertAll(s => s.PreRunCode))})已存在!", MessageBoxIcon.Warning); + return; + } + } + } + //验证系统编码 + if (list.Count(x => x.Level == 3) > 0) + { + var systemCodes = list.Where(x => x.Level == 3).Select(a => a.SystemCode); + var importCodes = systemCodes.GroupBy(x => x).Where(x => x.Count() > 1).Select(x => x.Key).ToList(); + if (importCodes.Count > 0) + { + ShowNotify($"EXCEL中系统编码{string.Join(",", importCodes)}重复,请调整模板数据!", MessageBoxIcon.Warning); + return; + } + systemCodes = systemCodes.Distinct().ToList(); + if (systemCodes.Count() > 0) + { + var existSystems = Funs.DB.PreRun_SysDevice.Where(a => systemCodes.Contains(a.PreRunCode) && a.PreRunLevel == 3 && a.ProjectId == this.CurrUser.LoginProjectId).ToList(); + if (existSystems.Count > 0) + { + ShowNotify($"系统编码({string.Join(",", existSystems.ConvertAll(s => s.PreRunCode))})已存在!", MessageBoxIcon.Warning); + return; + } + } + } + //验证子系统编码 + if (list.Count(x => x.Level == 4) > 0) + { + var subsystemCodes = list.Where(x => x.Level == 4).Select(a => a.SubsystemCode); + var importCodes = subsystemCodes.GroupBy(x => x).Where(x => x.Count() > 1).Select(x => x.Key).ToList(); + if (importCodes.Count > 0) + { + ShowNotify($"EXCEL中子系统编码{string.Join(",", importCodes)}重复,请调整模板数据!", MessageBoxIcon.Warning); + return; + } + subsystemCodes = subsystemCodes.Distinct().ToList(); + if (subsystemCodes.Count() > 0) + { + var existSubsystems = Funs.DB.PreRun_SysDevice.Where(a => subsystemCodes.Contains(a.PreRunCode) && a.PreRunLevel == 4 && a.ProjectId == this.CurrUser.LoginProjectId).ToList(); + if (existSubsystems.Count > 0) + { + ShowNotify($"子系统编码({string.Join(",", existSubsystems.ConvertAll(s => s.PreRunCode))})已存在!", MessageBoxIcon.Warning); + return; + } + } + } + + #endregion + + #region 数据处理 + + var installationData = new List(); + var processesData = new List(); + var systemData = new List(); + + //处理装置 + if (list.Count(x => x.Level == 1) > 0) + { + list.Where(x => x.Level == 1).ToList().ForEach(a => + { + a.InstallationId = Guid.NewGuid().ToString(); + }); + } + //处理工序 + if (list.Count(x => x.Level == 2) > 0) + { + var codes = list.ConvertAll(a => a.InstallationCode).Distinct(); + installationData = Funs.DB.PreRun_SysDevice.Where(x => x.PreRunLevel == 1 && codes.Contains(x.PreRunCode)).ToList(); + list.Where(x => x.Level == 2).ToList().ForEach(a => + { + //装置 + if (list.Count(p => p.InstallationCode == a.InstallationCode && p.Level == 1) > 0) + { + a.InstallationId = list.FirstOrDefault(p => p.InstallationCode == a.InstallationCode && p.Level == 1).InstallationId; + } + else if (installationData.Count(p => p.PreRunCode == a.InstallationCode) > 0) + { + a.InstallationId = installationData.FirstOrDefault(p => p.PreRunCode == a.InstallationCode).PreRunId; + } + //上级编码 + a.ParentId = a.InstallationId; + //工序 + a.ProcessesId = Guid.NewGuid().ToString(); + }); + } + //处理系统 + if (list.Count(x => x.Level == 3) > 0) + { + var codes = list.ConvertAll(a => a.ProcessesCode).Distinct(); + processesData = Funs.DB.PreRun_SysDevice.Where(x => x.PreRunLevel == 2 && codes.Contains(x.PreRunCode)).ToList(); + list.Where(x => x.Level == 3).ToList().ForEach(a => + { + //装置 + if (list.Count(p => p.InstallationCode == a.InstallationCode && p.Level == 1) > 0) + { + a.InstallationId = list.FirstOrDefault(p => p.InstallationCode == a.InstallationCode && p.Level == 1).InstallationId; + } + else if (installationData.Count(p => p.PreRunCode == a.InstallationCode) > 0) + { + a.InstallationId = installationData.FirstOrDefault(p => p.PreRunCode == a.InstallationCode).PreRunId; + } + //工序 + if (list.Count(p => p.ProcessesCode == a.ProcessesCode && p.Level == 2) > 0) + { + a.ProcessesId = list.FirstOrDefault(p => p.ProcessesCode == a.ProcessesCode && p.Level == 2).ProcessesId; + } + else if (processesData.Count(p => p.PreRunCode == a.ProcessesCode) > 0) + { + a.ProcessesId = processesData.FirstOrDefault(p => p.PreRunCode == a.ProcessesCode).PreRunId; + } + //上级编码 + a.ParentId = a.ProcessesId; + //系统 + a.SystemId = Guid.NewGuid().ToString(); + }); + } + //处理子系统 + if (list.Count(x => x.Level == 4) > 0) + { + var codes = list.ConvertAll(a => a.SystemCode).Distinct(); + systemData = Funs.DB.PreRun_SysDevice.Where(x => x.PreRunLevel == 3 && codes.Contains(x.PreRunCode)).ToList(); + list.Where(x => x.Level == 4).ToList().ForEach(a => + { + //装置 + if (list.Count(p => p.InstallationCode == a.InstallationCode && p.Level == 1) > 0) + { + a.InstallationId = list.FirstOrDefault(p => p.InstallationCode == a.InstallationCode && p.Level == 1).InstallationId; + } + else if (installationData.Count(p => p.PreRunCode == a.InstallationCode) > 0) + { + a.InstallationId = installationData.FirstOrDefault(p => p.PreRunCode == a.InstallationCode).PreRunId; + } + //工序 + if (list.Count(p => p.ProcessesCode == a.ProcessesCode && p.Level == 2) > 0) + { + a.ProcessesId = list.FirstOrDefault(p => p.ProcessesCode == a.ProcessesCode && p.Level == 2).ProcessesId; + } + else if (processesData.Count(p => p.PreRunCode == a.ProcessesCode) > 0) + { + a.ProcessesId = processesData.FirstOrDefault(p => p.PreRunCode == a.ProcessesCode).PreRunId; + } + //系统 + if (list.Count(p => p.SystemCode == a.SystemCode && p.Level == 3) > 0) + { + a.SystemId = list.FirstOrDefault(p => p.SystemCode == a.SystemCode && p.Level == 3).SystemId; + } + else if (systemData.Count(p => p.PreRunCode == a.SystemCode) > 0) + { + a.SystemId = systemData.FirstOrDefault(p => p.PreRunCode == a.SystemCode).PreRunId; + } + //上级编码 + a.ParentId = a.SystemId; + //子系统 + a.SubsystemId = Guid.NewGuid().ToString(); + }); + } + + #endregion + + #region 数据入库 + + var listData = new List(); + int oneIndex = 1; + int twoIndex = 1; + int threeIndex = 1; + int fourIndex = 1; + foreach (var itemData in list) + { + var model = new PreRun_SysDevice(); + model.ProjectId = this.CurrUser.LoginProjectId; + model.PreRunLevel = itemData.Level; + if (itemData.Level == 1) + { + model.PreRunId = itemData.InstallationId; + model.PreRunCode = itemData.InstallationCode; + model.PreRunName = itemData.InstallationName; + model.ParentId = itemData.ParentId; + model.AddUser = CurrUser.Account; + model.OperateTime = DateTime.Now; + model.Sort = Funs.DB.PreRun_SysDevice.Count(p => p.ProjectId == CurrUser.LoginProjectId) + oneIndex; + oneIndex++; + } + if (itemData.Level == 2) + { + model.PreRunId = itemData.ProcessesId; + model.ProcessesId = itemData.ProcessesId; + model.PreRunCode = itemData.ProcessesCode; + model.PreRunName = itemData.ProcessesName; + model.InstallationId = itemData.InstallationId; + model.ParentId = itemData.ParentId; + model.AddUser = CurrUser.Account; + model.OperateTime = DateTime.Now; + model.Sort = Funs.DB.PreRun_SysDevice.Count(p => p.ProjectId == CurrUser.LoginProjectId) + twoIndex; + twoIndex++; + } + if (itemData.Level == 3) + { + model.PreRunId = itemData.SystemId; + model.SystemId = itemData.SystemId; + model.PreRunCode = itemData.SystemCode; + model.PreRunName = itemData.SystemName; + model.InstallationId = itemData.InstallationId; + model.ProcessesId = itemData.ProcessesId; + model.ParentId = itemData.ParentId; + model.AddUser = CurrUser.Account; + model.OperateTime = DateTime.Now; + model.Sort = Funs.DB.PreRun_SysDevice.Count(p => p.ProjectId == CurrUser.LoginProjectId) + threeIndex; + threeIndex++; + } + if (itemData.Level == 4) + { + model.PreRunId = itemData.SubsystemId; + model.SubsystemId = itemData.SubsystemId; + model.PreRunCode = itemData.SubsystemCode; + model.PreRunName = itemData.SubsystemName; + model.InstallationId = itemData.InstallationId; + model.ProcessesId = itemData.ProcessesId; + model.SystemId = itemData.SystemId; + model.ParentId = itemData.ParentId; + model.AddUser = CurrUser.Account; + model.OperateTime = DateTime.Now; + model.Sort = Funs.DB.PreRun_SysDevice.Count(p => p.ProjectId == CurrUser.LoginProjectId) + fourIndex; + fourIndex++; + } + listData.Add(model); + } + + Funs.DB.PreRun_SysDevice.InsertAllOnSubmit(listData); + Funs.DB.SubmitChanges(); + ShowNotify("导入成功!", MessageBoxIcon.Success); + + #endregion + } + else + { + ShowNotify("文件无数据!", MessageBoxIcon.Warning); + } + DataBrid(); + } + catch (Exception ex) + { + ShowNotify(ex.Message, MessageBoxIcon.Warning); + } + } + + /// + /// 下载模板 + /// + 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"))); + } + + /// + /// 下载导入模板 + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirm_OK") + { + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + Const.PreRunUrl; + string filePath = Const.PreRunUrl; + 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 #region 私有方法 @@ -196,6 +625,129 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun } } + /// + /// 验证管道模板是否正确 + /// + /// + /// + private bool VerifyFile(DataSet ds) + { + var result = true; + if (ds.Tables[0].Rows[1][0].ToString().Contains("装置编码")) result = false; + if (ds.Tables[0].Rows[1][1].ToString().Contains("装置名称")) result = false; + if (ds.Tables[0].Rows[1][2].ToString().Contains("工序编码")) result = false; + if (ds.Tables[0].Rows[1][3].ToString().Contains("工序名称")) result = false; + if (ds.Tables[0].Rows[1][4].ToString().Contains("系统编码")) result = false; + if (ds.Tables[0].Rows[1][5].ToString().Contains("系统名称")) result = false; + if (ds.Tables[0].Rows[1][6].ToString().Contains("子系统编码")) result = false; + if (ds.Tables[0].Rows[1][7].ToString().Contains("子系统名称")) result = false; + return result; + } + + /// + /// 验证datatable某列是否存在重复 + /// + /// + public bool HasRepeatData(DataTable dt, string[] colName) + { + bool flag = false; + DataView myDataView = new DataView(dt); + if (myDataView.ToTable(true, colName).Rows.Count < dt.Rows.Count) + { + flag = true; + } + return flag; + } + + /// + /// 获取某一列的所有值 + /// + /// 列数据类型 + /// 数据表 + /// 列名 + /// + public static List GetColumnValues(DataTable dtSource, string filedName) + { + return (from r in dtSource.AsEnumerable() select r.Field(filedName)).ToList(); + } + + /// + /// 判断是否为空 + /// + /// + public bool StrIsNumm(object value) + { + bool result = false; + if (value == null) result = true; + if (string.IsNullOrWhiteSpace(value.ToString())) result = true; + return result; + } + + /// + /// 试车装置信息 + /// + public class SysDeviceDto + { + /// + /// 上级主键 + /// + public string ParentId { get; set; } + /// + /// 主键编码 + /// + public string InstallationId { get; set; } + /// + /// 装置编码 + /// + public string InstallationCode { get; set; } + /// + /// 装置名称 + /// + public string InstallationName { get; set; } + /// + /// 工序主键 + /// + public string ProcessesId { get; set; } + /// + /// 工序编码 + /// + public string ProcessesCode { get; set; } + /// + /// 工序名称 + /// + public string ProcessesName { get; set; } + /// + /// 系统主键 + /// + public string SystemId { get; set; } + /// + /// 系统编码 + /// + public string SystemCode { get; set; } + /// + /// 系统名称 + /// + public string SystemName { get; set; } + /// + /// 子系统主键 + /// + public string SubsystemId { get; set; } + /// + /// 子系统编码 + /// + public string SubsystemCode { get; set; } + /// + /// 子系统名称 + /// + public string SubsystemName { get; set; } + /// + /// 级别1:装置 2:工序 3:系统 4:子系统 + /// + public int Level { get; set; } + + } + #endregion + } } \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx.designer.cs index 2cab8d9f..90e32a9f 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRun.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.TestRun.BeforeTestRun { - - - public partial class DeviceRun { - +namespace FineUIPro.Web.TestRun.BeforeTestRun +{ + + + public partial class DeviceRun + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar1 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// sRunName 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox sRunName; - + /// /// btnSearch 控件。 /// @@ -74,7 +76,34 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSearch; - + + /// + /// fileData 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload fileData; + + /// + /// btnImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnImport; + + /// + /// btnDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnDownLoad; + /// /// btnAdd 控件。 /// @@ -83,7 +112,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnAdd; - + /// /// btnParentAdd 控件。 /// @@ -92,7 +121,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnParentAdd; - + /// /// btnEdit 控件。 /// @@ -101,7 +130,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnEdit; - + /// /// btnDelete 控件。 /// @@ -110,25 +139,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnDelete; - - /// - /// btnSave 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Button btnSave; - - /// - /// txtRemark 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextBox txtRemark; - + /// /// Window1 控件。 /// diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx index c27ea4b4..84894cf8 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx @@ -64,6 +64,7 @@ + diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx.cs index 03fd6bbc..7b81f0ba 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx.cs @@ -67,6 +67,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { num = Funs.DB.PreRun_SysDevice.Count(p => p.ProjectId == this.CurrUser.LoginProjectId && p.PreRunLevel == 2) + 1; txtRunCode.Text = string.Format("PA{0}", string.Format("{0:d2}", num)); + txtSort.Text = num.ToString(); } txtRunName.Label = "工序名称"; txtRunCode.Label = "工序编码"; @@ -92,6 +93,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { num = Funs.DB.PreRun_SysDevice.Count(p => p.ProjectId == this.CurrUser.LoginProjectId && p.PreRunLevel == 3) + 1; txtRunCode.Text = string.Format("S{0}", string.Format("{0:d2}", num)); + txtSort.Text = num.ToString(); } txtRunName.Label = "S系统名称"; txtRunCode.Label = "S系统编码"; @@ -123,6 +125,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { num = Funs.DB.PreRun_SysDevice.Count(p => p.ProjectId == this.CurrUser.LoginProjectId && p.PreRunLevel == 4) + 1; txtRunCode.Text = string.Format("SS{0}", string.Format("{0:d2}", num)); + txtSort.Text = num.ToString(); } txtRunName.Label = "SS子系统名称"; txtRunCode.Label = "SS子系统编码"; @@ -138,6 +141,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun txtRunCode.Label = "装置编码"; num = Funs.DB.PreRun_SysDevice.Count(p => p.ProjectId == this.CurrUser.LoginProjectId && p.PreRunLevel == 1) + 1; txtRunCode.Text = string.Format("P{0}", string.Format("{0:d2}", num)); + txtSort.Text = num.ToString(); } } if (!string.IsNullOrWhiteSpace(this.RunId)) @@ -148,6 +152,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun txtRunCode.Text = deviceModel.PreRunCode; txtRunName.Text = deviceModel.PreRunName; txtRemark.Text = deviceModel.Remark; + txtSort.Text = deviceModel.Sort.ToString(); if (deviceModel.PreRunLevel == 1) { @@ -208,6 +213,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { model.InstallationId = oneModel.PreRunId; model.ParentId = oneModel.PreRunId; + model.ProcessesId = model.PreRunId; model.PreRunLevel = 2; } var twoModel = parenLs.FirstOrDefault(p => p.PreRunLevel == 2); @@ -215,6 +221,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { model.ProcessesId = twoModel.PreRunId; model.ParentId = twoModel.PreRunId; + model.SystemId = model.PreRunId; model.PreRunLevel = 3; } var threeModel = parenLs.FirstOrDefault(p => p.PreRunLevel == 3); @@ -233,7 +240,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun } model.AddUser = CurrUser.Account; model.OperateTime = DateTime.Now; - model.Sort = Funs.DB.PreRun_SysDevice.Count(p => p.ProjectId == CurrUser.LoginProjectId) + 1; + model.Sort = !string.IsNullOrEmpty(txtSort.Text) ? int.Parse(txtSort.Text) : Funs.DB.PreRun_SysDevice.Count(p => p.ProjectId == CurrUser.LoginProjectId && p.PreRunLevel == model.PreRunLevel) + 1; model.PreRunCode = txtRunCode.Text; model.PreRunName = txtRunName.Text; model.Remark = txtRemark.Text; diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx.designer.cs index 58445fd4..f42fb15b 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/DeviceRunEdit.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.TestRun.BeforeTestRun { - - - public partial class DeviceRunEdit { - +namespace FineUIPro.Web.TestRun.BeforeTestRun +{ + + + public partial class DeviceRunEdit + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// SimpleForm1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form SimpleForm1; - + /// /// Toolbar1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// ToolbarFill1 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnSave 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSave; - + /// /// hdAttachUrl 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hdAttachUrl; - + /// /// hdId 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hdId; - + /// /// ContentPanel2 控件。 /// @@ -92,7 +94,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ContentPanel ContentPanel2; - + /// /// Form2 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Form Form2; - + /// /// zz 控件。 /// @@ -110,7 +112,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.FormRow zz; - + /// /// lblzzmc 控件。 /// @@ -119,7 +121,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lblzzmc; - + /// /// lblzzbm 控件。 /// @@ -128,7 +130,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lblzzbm; - + /// /// gx 控件。 /// @@ -137,7 +139,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.FormRow gx; - + /// /// lblgxmc 控件。 /// @@ -146,7 +148,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lblgxmc; - + /// /// lblgxbm 控件。 /// @@ -155,7 +157,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lblgxbm; - + /// /// sxt 控件。 /// @@ -164,7 +166,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.FormRow sxt; - + /// /// lblsxtmc 控件。 /// @@ -173,7 +175,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lblsxtmc; - + /// /// lblsxtbm 控件。 /// @@ -182,7 +184,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Label lblsxtbm; - + /// /// txtRunName 控件。 /// @@ -191,7 +193,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtRunName; - + /// /// txtRunCode 控件。 /// @@ -200,7 +202,16 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtRunCode; - + + /// + /// txtSort 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSort; + /// /// txtRemark 控件。 /// diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectProperty.aspx b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectProperty.aspx new file mode 100644 index 00000000..9eee4838 --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectProperty.aspx @@ -0,0 +1,210 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectProperty.aspx.cs" Inherits="FineUIPro.Web.TestRun.BeforeTestRun.SelectProperty" %> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectProperty.aspx.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectProperty.aspx.cs new file mode 100644 index 00000000..69ea00b3 --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectProperty.aspx.cs @@ -0,0 +1,158 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.TestRun.BeforeTestRun +{ + public partial class SelectProperty : PageBase + { + /// + /// 子系统id + /// + public string SubSystemId + { + get { return (string)ViewState["SubSystemId"]; } + set { ViewState["SubSystemId"] = value; } + } + + /// + /// 系统id + /// + public string SystemId + { + get { return (string)ViewState["SystemId"]; } + set { ViewState["SystemId"] = value; } + } + + /// + /// 选中的id + /// + public string SelectPropertyIds + { + get { return (string)ViewState["SelectPropertyIds"]; } + set { ViewState["SelectPropertyIds"] = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.SubSystemId = Request["SubSystemId"]; + this.SystemId = Request["SystemId"]; + this.SelectPropertyIds = Request["SelectPropertyIds"]; + // 绑定表格 + BindGrid(); + } + } + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"select * from PreRun_PropertySysPiping where ProjectId=@ProjectId and SystemId=@SystemId "; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@SystemId", this.SystemId)); + if (!string.IsNullOrWhiteSpace(SelectPropertyIds)) + { + var ids = SelectPropertyIds.Split(',').ToList(); + strSql += $" and PropertyId not in ('{string.Join("','", ids)}')"; + } + + 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(); + } + + #region 确认 + + /// + /// 确认 + /// + protected void btnSave_Click(object sender, EventArgs e) + { + var requestIds = SelectPropertyIds.Split(',').ToList(); + string ids = SelectPropertyIds; + foreach (var item in this.Grid1.SelectedRowIDArray) + { + if (requestIds.Contains(item)) continue; + if (string.IsNullOrWhiteSpace(ids)) + { + ids = item; + } + else + { + ids += "," + item; + } + } + PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(ids) + ActiveWindow.GetHidePostBackReference()); + } + + #endregion + + #region 表排序、分页、关闭窗口 + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + + /// + /// 分页下拉框 + /// + protected void ddlPageSize_SelectedIndexChanged1(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + #endregion + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectProperty.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectProperty.aspx.designer.cs new file mode 100644 index 00000000..0927ddae --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectProperty.aspx.designer.cs @@ -0,0 +1,242 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.TestRun.BeforeTestRun +{ + + + public partial class SelectProperty + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// txtPipingCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipingCode; + + /// + /// txtDiameter 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDiameter; + + /// + /// txtMaterialLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMaterialLevel; + + /// + /// txtAdiabatType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAdiabatType; + + /// + /// txtAdiabatThickness 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAdiabatThickness; + + /// + /// txtMediumState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMediumState; + + /// + /// txtDrawingNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDrawingNo; + + /// + /// txtPipingStart 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipingStart; + + /// + /// txtPipingEnd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipingEnd; + + /// + /// txtPipingLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipingLevel; + + /// + /// txtNormalTemperature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNormalTemperature; + + /// + /// txtNormalPressure 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNormalPressure; + + /// + /// txtDesignTemperature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDesignTemperature; + + /// + /// txtDesignPressure 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDesignPressure; + + /// + /// txtPaintLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPaintLevel; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtRemark; + + /// + /// ToolbarSeparator2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator2; + + /// + /// ToolbarText2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText2; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + } +} diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectTechnology.aspx b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectTechnology.aspx new file mode 100644 index 00000000..f623d092 --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectTechnology.aspx @@ -0,0 +1,121 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SelectTechnology.aspx.cs" Inherits="FineUIPro.Web.TestRun.BeforeTestRun.SelectTechnology" %> + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectTechnology.aspx.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectTechnology.aspx.cs new file mode 100644 index 00000000..420e8c8d --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectTechnology.aspx.cs @@ -0,0 +1,158 @@ +using BLL; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.TestRun.BeforeTestRun +{ + public partial class SelectTechnology : PageBase + { + /// + /// 子系统id + /// + public string SubSystemId + { + get { return (string)ViewState["SubSystemId"]; } + set { ViewState["SubSystemId"] = value; } + } + + /// + /// 系统id + /// + public string SystemId + { + get { return (string)ViewState["SystemId"]; } + set { ViewState["SystemId"] = value; } + } + + /// + /// 选中的id + /// + public string SelectTechnologyIds + { + get { return (string)ViewState["SelectTechnologyIds"]; } + set { ViewState["SelectTechnologyIds"] = value; } + } + + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.SubSystemId = Request["SubSystemId"]; + this.SystemId = Request["SystemId"]; + this.SelectTechnologyIds = Request["SelectTechnologyIds"]; + // 绑定表格 + BindGrid(); + } + } + + + /// + /// 绑定数据 + /// + private void BindGrid() + { + string strSql = @"select * from PreRun_TechnologySysPiping where ProjectId=@ProjectId and SystemId=@SystemId "; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@SystemId", this.SystemId)); + if (!string.IsNullOrWhiteSpace(SelectTechnologyIds)) + { + var ids = SelectTechnologyIds.Split(',').ToList(); + strSql += $" and TechnologyId not in ('{string.Join("','", ids)}')"; + } + + 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(); + } + + #region 确认 + + /// + /// 确认 + /// + protected void btnSave_Click(object sender, EventArgs e) + { + var requestIds = SelectTechnologyIds.Split(',').ToList(); + string ids = SelectTechnologyIds; + foreach (var item in this.Grid1.SelectedRowIDArray) + { + if (requestIds.Contains(item)) continue; + if (string.IsNullOrWhiteSpace(ids)) + { + ids = item; + } + else + { + ids += "," + item; + } + } + PageContext.RegisterStartupScript(ActiveWindow.GetWriteBackValueReference(ids) + ActiveWindow.GetHidePostBackReference()); + } + + #endregion + + #region 表排序、分页、关闭窗口 + + /// + /// 分页 + /// + /// + /// + protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + { + Grid1.PageIndex = e.NewPageIndex; + BindGrid(); + } + + /// + /// 排序 + /// + /// + /// + protected void Grid1_Sort(object sender, GridSortEventArgs e) + { + BindGrid(); + } + + /// + /// 分页显示条数下拉框 + /// + /// + /// + protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + BindGrid(); + } + + /// + /// 关闭弹出窗 + /// + /// + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + BindGrid(); + } + + /// + /// 分页下拉框 + /// + protected void ddlPageSize_SelectedIndexChanged1(object sender, EventArgs e) + { + Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + BindGrid(); + } + + #endregion + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectTechnology.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectTechnology.aspx.designer.cs new file mode 100644 index 00000000..500d824b --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SelectTechnology.aspx.designer.cs @@ -0,0 +1,179 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.TestRun.BeforeTestRun +{ + + + public partial class SelectTechnology + { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// Grid1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid Grid1; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + + /// + /// txtTagNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTagNumber; + + /// + /// txtNameSpecifications 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNameSpecifications; + + /// + /// txtgyDrawingNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtgyDrawingNo; + + /// + /// txtMaterials 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMaterials; + + /// + /// txtNumOperate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNumOperate; + + /// + /// txtNumStandby 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNumStandby; + + /// + /// txtWeightSingle 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWeightSingle; + + /// + /// txtWeightTotal 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWeightTotal; + + /// + /// txtgyRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtgyRemark; + + /// + /// ToolbarSeparator2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator2; + + /// + /// ToolbarText2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText2; + + /// + /// ddlPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlPageSize; + } +} diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx index 62fa440b..52face44 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx @@ -26,7 +26,10 @@ - + + + @@ -56,6 +59,9 @@ + + @@ -112,6 +118,7 @@ var hfFormIDClientID = '<%= hfFormID.ClientID %>'; var txtWorkPackNameClientID = '<%= txtWorkPackName.ClientID %>'; + var txtWorkPackCodeClientID = '<%= txtWorkPackCode.ClientID %>'; var txtRemarkClientID = '<%= txtRemark.ClientID %>'; @@ -127,6 +134,7 @@ // 使用当前行数据填充表单字段 F(hfFormIDClientID).setValue(rowId); F(txtWorkPackNameClientID).setValue(rowValue['WorkPackName']); + F(txtWorkPackCodeClientID).setValue(rowValue['WorkPackCode']); F(txtRemarkClientID).setValue(rowValue['Remark']); // 更新提交按钮文本 diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx.cs index 9d3d400b..713f2460 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx.cs @@ -30,7 +30,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun /// private void BindGrid() { - string strSql = @"select WorkPackId,WorkPackName,Remark,AddTime,Sort from Work_Package WHERE 1=1 "; + string strSql = @"select WorkPackId,WorkPackName,WorkPackCode,Remark,AddTime,Sort from PreRun_WorkPackage WHERE 1=1 "; List listStr = new List(); if (!string.IsNullOrEmpty(this.txtsWorkPackName.Text.Trim())) { @@ -104,11 +104,11 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun /// protected void btnDelete_Click(object sender, EventArgs e) { - var isData = Funs.DB.SubSys_WorkPackage.Count(p => p.WorkPackId == hfFormID.Text); + var isData = Funs.DB.PreRun_SubSysWorkPackage.Count(p => p.WorkPackId == hfFormID.Text); if (isData == 0) { - var mdoel = Funs.DB.Work_Package.FirstOrDefault(p => p.WorkPackId == hfFormID.Text); - Funs.DB.Work_Package.DeleteOnSubmit(mdoel); + var mdoel = Funs.DB.PreRun_WorkPackage.FirstOrDefault(p => p.WorkPackId == hfFormID.Text); + Funs.DB.PreRun_WorkPackage.DeleteOnSubmit(mdoel); Funs.DB.SubmitChanges(); // 重新绑定表格,并模拟点击[新增按钮] BindGrid(); @@ -143,14 +143,14 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun } foreach (int rowIndex in Grid1.SelectedRowIndexArray) { - var isData = Funs.DB.SubSys_WorkPackage.Count(p => p.WorkPackId == hfFormID.Text); + var isData = Funs.DB.PreRun_SubSysWorkPackage.Count(p => p.WorkPackId == hfFormID.Text); if (isData == 0) { string rowID = Grid1.DataKeys[rowIndex][0].ToString(); - var model = Funs.DB.Work_Package.FirstOrDefault(e => e.WorkPackId == rowID); + var model = Funs.DB.PreRun_WorkPackage.FirstOrDefault(e => e.WorkPackId == rowID); if (model != null) { - Funs.DB.Work_Package.DeleteOnSubmit(model); + Funs.DB.PreRun_WorkPackage.DeleteOnSubmit(model); Funs.DB.SubmitChanges(); ShowNotify("删除成功!", MessageBoxIcon.Error); return; @@ -190,7 +190,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun return; } string Id = Grid1.SelectedRowID; - var model = Funs.DB.Work_Package.FirstOrDefault(e => e.WorkPackId == Id); + var model = Funs.DB.PreRun_WorkPackage.FirstOrDefault(e => e.WorkPackId == Id); if (model != null) { this.txtWorkPackName.Text = model.WorkPackName; @@ -210,29 +210,36 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun protected void btnSave_Click(object sender, EventArgs e) { string strRowID = hfFormID.Text; - var deteion = Funs.DB.Work_Package.Count(p => p.WorkPackName == txtWorkPackName.Text.Trim() && p.WorkPackId != strRowID); - + var deteion = Funs.DB.PreRun_WorkPackage.Count(p => p.WorkPackName == txtWorkPackName.Text.Trim() && p.WorkPackId != strRowID); if (deteion > 0) { - Alert.ShowInTop("此工作包已存在!", MessageBoxIcon.Warning); + Alert.ShowInTop("此工作包名称已存在!", MessageBoxIcon.Warning); + return; + } + var deteionCode = Funs.DB.PreRun_WorkPackage.Count(p => p.WorkPackCode == txtWorkPackCode.Text.Trim() && p.WorkPackId != strRowID); + if (deteionCode > 0) + { + Alert.ShowInTop("此工作包编码已存在!", MessageBoxIcon.Warning); return; } if (string.IsNullOrEmpty(strRowID)) { - Work_Package model = new Work_Package(); + PreRun_WorkPackage model = new PreRun_WorkPackage(); model.WorkPackId = Guid.NewGuid().ToString(); model.WorkPackName = this.txtWorkPackName.Text.Trim(); + model.WorkPackCode = this.txtWorkPackCode.Text.Trim(); model.Remark = this.txtRemark.Text.Trim(); - Funs.DB.Work_Package.InsertOnSubmit(model); + Funs.DB.PreRun_WorkPackage.InsertOnSubmit(model); Funs.DB.SubmitChanges(); } else { - Model.Work_Package model = Funs.DB.Work_Package.FirstOrDefault(p => p.WorkPackId == strRowID); + Model.PreRun_WorkPackage model = Funs.DB.PreRun_WorkPackage.FirstOrDefault(p => p.WorkPackId == strRowID); if (model != null) { model.WorkPackName = this.txtWorkPackName.Text.Trim(); + model.WorkPackCode = this.txtWorkPackCode.Text.Trim(); model.Remark = this.txtRemark.Text.Trim(); Funs.DB.SubmitChanges(); } diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx.designer.cs index dd16c35e..7ecabb64 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SetWorkPackage.aspx.designer.cs @@ -7,11 +7,13 @@ // //------------------------------------------------------------------------------ -namespace FineUIPro.Web.TestRun.BeforeTestRun { - - - public partial class SetWorkPackage { - +namespace FineUIPro.Web.TestRun.BeforeTestRun +{ + + + public partial class SetWorkPackage + { + /// /// form1 控件。 /// @@ -20,7 +22,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::System.Web.UI.HtmlControls.HtmlForm form1; - + /// /// PageManager1 控件。 /// @@ -29,7 +31,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.PageManager PageManager1; - + /// /// Panel1 控件。 /// @@ -38,7 +40,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Panel Panel1; - + /// /// Grid1 控件。 /// @@ -47,7 +49,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Grid Grid1; - + /// /// Toolbar2 控件。 /// @@ -56,7 +58,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar2; - + /// /// txtsWorkPackName 控件。 /// @@ -65,7 +67,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtsWorkPackName; - + /// /// ToolbarSeparator1 控件。 /// @@ -74,7 +76,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; - + /// /// ToolbarText1 控件。 /// @@ -83,7 +85,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarText ToolbarText1; - + /// /// ddlPageSize 控件。 /// @@ -92,7 +94,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.DropDownList ddlPageSize; - + /// /// SimpleForm1 控件。 /// @@ -101,7 +103,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.SimpleForm SimpleForm1; - + /// /// hfFormID 控件。 /// @@ -110,7 +112,16 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.HiddenField hfFormID; - + + /// + /// txtWorkPackCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWorkPackCode; + /// /// txtWorkPackName 控件。 /// @@ -119,7 +130,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextBox txtWorkPackName; - + /// /// txtRemark 控件。 /// @@ -128,7 +139,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.TextArea txtRemark; - + /// /// Toolbar1 控件。 /// @@ -137,7 +148,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Toolbar Toolbar1; - + /// /// btnNew 控件。 /// @@ -146,7 +157,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnNew; - + /// /// btnDelete 控件。 /// @@ -155,7 +166,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnDelete; - + /// /// ToolbarFill1 控件。 /// @@ -164,7 +175,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.ToolbarFill ToolbarFill1; - + /// /// btnSave 控件。 /// @@ -173,7 +184,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Button btnSave; - + /// /// Menu1 控件。 /// @@ -182,7 +193,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Menu Menu1; - + /// /// btnMenuEdit 控件。 /// @@ -191,7 +202,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.MenuButton btnMenuEdit; - + /// /// btnMenuDelete 控件。 /// diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx index 54f2141d..bf17dce7 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx @@ -56,26 +56,29 @@ @@ -105,7 +108,7 @@ - + @@ -121,7 +124,7 @@ - diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx.cs index 8b637ab6..1a80eb10 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx.cs +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx.cs @@ -15,9 +15,12 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun public partial class SubSysWorkPackage : PageBase { /// - /// 热处理委托主键 + /// 点击树状主键 /// public string TreePreRunId { get { return (string)ViewState["TreePreRunId"]; } set { ViewState["TreePreRunId"] = value; } } + /// + /// 子系统主键 + /// public string SsubSystemId { get { return (string)ViewState["SsubSystemId"]; } set { ViewState["SsubSystemId"] = value; } } protected void Page_Load(object sender, EventArgs e) @@ -126,30 +129,30 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun if (list.Count(p => p.PreRunLevel == 1) > 0) { zz.Hidden = false; - lblzzbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 1).PreRunName; - lblzzmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 1).PreRunCode; + lblzzbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 1).PreRunCode; + lblzzmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 1).PreRunName; } if (list.Count(p => p.PreRunLevel == 2) > 0) { gx.Hidden = false; - lblgxmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 2).PreRunCode; - lblgxbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 2).PreRunName; + lblgxmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 2).PreRunName; + lblgxbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 2).PreRunCode; } if (list.Count(p => p.PreRunLevel == 3) > 0) { sxt.Hidden = false; - lblsxtmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 3).PreRunCode; - lblsxtbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 3).PreRunName; + lblsxtmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 3).PreRunName; + lblsxtbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 3).PreRunCode; } if (list.Count(p => p.PreRunLevel == 4) > 0) { sszxt.Hidden = false; gzb.Hidden = false; BridWorkPackGrid(); - lblszxtmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 4).PreRunCode; - lblszxtbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 4).PreRunName; + lblszxtmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 4).PreRunName; + lblszxtbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 4).PreRunCode; this.SsubSystemId = list.FirstOrDefault(p => p.PreRunLevel == 4).PreRunId; - var workPackages = Funs.DB.SubSys_WorkPackage.Where(p => p.SubSystemId == this.SsubSystemId).ToList(); + var workPackages = Funs.DB.PreRun_SubSysWorkPackage.Where(p => p.SubSystemId == this.SsubSystemId).ToList(); if (workPackages.Count > 0) { var workIds = workPackages.ConvertAll(p => p.WorkPackId); @@ -177,8 +180,8 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { if (prerunModel.PreRunLevel == 4) { - var deleteLs = Funs.DB.SubSys_WorkPackage.Where(p => p.SubSystemId == prerunModel.PreRunId); - Funs.DB.SubSys_WorkPackage.DeleteAllOnSubmit(deleteLs); + var deleteLs = Funs.DB.PreRun_SubSysWorkPackage.Where(p => p.SubSystemId == prerunModel.PreRunId); + Funs.DB.PreRun_SubSysWorkPackage.DeleteAllOnSubmit(deleteLs); Funs.DB.SubmitChanges(); JArray mergedData = Grid1.GetMergedData(); int[] selections = Grid1.SelectedRowIndexArray; @@ -188,7 +191,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun JObject values = mergedRow.Value("values"); int i = mergedRow.Value("index"); var workId = Grid1.DataKeys[i][0].ToString(); - var model = new SubSys_WorkPackage(); + var model = new PreRun_SubSysWorkPackage(); model.SubSysId = Guid.NewGuid().ToString(); model.SubSystemId = prerunModel.PreRunId; model.WorkPackId = workId; @@ -196,8 +199,8 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun model.Remark = values.Value("Remark"); model.AddTime = DateTime.Now; model.AddUser = this.CurrUser.UserId; - model.Sort = Funs.DB.SubSys_WorkPackage.Count(); - Funs.DB.SubSys_WorkPackage.InsertOnSubmit(model); + model.Sort = Funs.DB.PreRun_SubSysWorkPackage.Count(); + Funs.DB.PreRun_SubSysWorkPackage.InsertOnSubmit(model); } Funs.DB.SubmitChanges(); ShowNotify("保存成功!", MessageBoxIcon.Success); @@ -210,7 +213,7 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun /// public void BridWorkPackGrid() { - GridWorkPack.DataSource = Funs.DB.Work_Package.OrderBy(p => p.Sort).ToList(); + GridWorkPack.DataSource = Funs.DB.PreRun_WorkPackage.OrderBy(p => p.Sort).ToList(); GridWorkPack.DataBind(); } @@ -221,8 +224,8 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { if (!string.IsNullOrWhiteSpace(this.SsubSystemId)) { - var data = from a in Funs.DB.Work_Package.Where(p => workPackIds.Contains(p.WorkPackId)) - join b in Funs.DB.SubSys_WorkPackage.Where(p => p.SubSystemId == this.SsubSystemId) on a.WorkPackId equals b.WorkPackId into bb + var data = from a in Funs.DB.PreRun_WorkPackage.Where(p => workPackIds.Contains(p.WorkPackId)) + join b in Funs.DB.PreRun_SubSysWorkPackage.Where(p => p.SubSystemId == this.SsubSystemId) on a.WorkPackId equals b.WorkPackId into bb from t in bb.DefaultIfEmpty() select new WorkData() { @@ -283,10 +286,13 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun if (e.CommandName == "Delete") { string rowID = e.RowID; - var model = Funs.DB.SubSys_WorkPackage.FirstOrDefault(p => p.WorkPackId == rowID); - Funs.DB.SubSys_WorkPackage.DeleteOnSubmit(model); - Funs.DB.SubmitChanges(); - var workPackages = Funs.DB.SubSys_WorkPackage.Where(p => p.SubSystemId == this.SsubSystemId).ToList(); + var model = Funs.DB.PreRun_SubSysWorkPackage.FirstOrDefault(p => p.WorkPackId == rowID); + if (model != null) + { + Funs.DB.PreRun_SubSysWorkPackage.DeleteOnSubmit(model); + Funs.DB.SubmitChanges(); + } + var workPackages = Funs.DB.PreRun_SubSysWorkPackage.Where(p => p.SubSystemId == this.SsubSystemId).ToList(); var workIds = workPackages.ConvertAll(p => p.WorkPackId); BridSelectWorkPack(workIds); drpWorkPack.Values = workIds.ToArray(); diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx.designer.cs index e0d97e5b..afcb7e51 100644 --- a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SubSysWorkPackage.aspx.designer.cs @@ -120,15 +120,6 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// protected global::FineUIPro.FormRow zz; - /// - /// lblzzmc 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label lblzzmc; - /// /// lblzzbm 控件。 /// @@ -138,6 +129,15 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// protected global::FineUIPro.Label lblzzbm; + /// + /// lblzzmc 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblzzmc; + /// /// gx 控件。 /// @@ -147,15 +147,6 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// protected global::FineUIPro.FormRow gx; - /// - /// lblgxmc 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label lblgxmc; - /// /// lblgxbm 控件。 /// @@ -165,6 +156,15 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// protected global::FineUIPro.Label lblgxbm; + /// + /// lblgxmc 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblgxmc; + /// /// sxt 控件。 /// @@ -174,15 +174,6 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// protected global::FineUIPro.FormRow sxt; - /// - /// lblsxtmc 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label lblsxtmc; - /// /// lblsxtbm 控件。 /// @@ -192,6 +183,15 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// protected global::FineUIPro.Label lblsxtbm; + /// + /// lblsxtmc 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblsxtmc; + /// /// sszxt 控件。 /// @@ -201,15 +201,6 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// protected global::FineUIPro.FormRow sszxt; - /// - /// lblszxtmc 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label lblszxtmc; - /// /// lblszxtbm 控件。 /// @@ -219,6 +210,15 @@ namespace FineUIPro.Web.TestRun.BeforeTestRun { /// protected global::FineUIPro.Label lblszxtbm; + /// + /// lblszxtmc 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblszxtmc; + /// /// gzb 控件。 /// diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx new file mode 100644 index 00000000..270cd340 --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx @@ -0,0 +1,617 @@ +<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SysPipingDeviceImport.aspx.cs" Inherits="FineUIPro.Web.TestRun.BeforeTestRun.SysPipingDeviceImport" %> + + + + + + 子系统工作包管理 + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs new file mode 100644 index 00000000..cb55b6fa --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.cs @@ -0,0 +1,1076 @@ +using BLL; +using Model; +using Newtonsoft.Json.Linq; +using System; +using System.Collections.Generic; +using System.Data; +using System.Data.SqlClient; +using System.IO; +using System.Linq; +using System.Web; +using System.Web.UI; +using System.Web.UI.WebControls; + +namespace FineUIPro.Web.TestRun.BeforeTestRun +{ + public partial class SysPipingDeviceImport : PageBase + { + /// + /// 点击树状主键 + /// + public string TreePreRunId { get { return (string)ViewState["TreePreRunId"]; } set { ViewState["TreePreRunId"] = value; } } + /// + /// 子系统主键 + /// + public string SsubSystemId { get { return (string)ViewState["SsubSystemId"]; } set { ViewState["SsubSystemId"] = value; } } + protected void Page_Load(object sender, EventArgs e) + { + if (!IsPostBack) + { + this.InitTreeMenu();//加载树 + TabStrip1.ActiveTabIndex = 0; + } + } + + #region 加载树 + + /// + /// 加载树 + /// + private void InitTreeMenu() + { + this.tvControlItem.Nodes.Clear(); + TreeNode rootNode = new TreeNode(); + rootNode.Text = "系统划分"; + rootNode.NodeID = "0"; + rootNode.Expanded = true; + rootNode.ToolTip = ""; + rootNode.EnableClickEvent = true; + this.tvControlItem.Nodes.Add(rootNode); + var allPreRunLs = Funs.DB.PreRun_SysDevice.Where(p => p.ProjectId == this.CurrUser.LoginProjectId).ToList(); + var onePreRunLs = allPreRunLs.Where(p => p.PreRunLevel == 1); + foreach (var item in onePreRunLs) + { + TreeNode rootUnitNode = new TreeNode();//定义根节点 + rootUnitNode.NodeID = item.PreRunId; + rootUnitNode.Text = item.PreRunName; + rootUnitNode.ToolTip = item.PreRunName; + rootUnitNode.CommandName = ""; + rootUnitNode.EnableClickEvent = true; + rootUnitNode.EnableExpandEvent = true; + rootNode.Nodes.Add(rootUnitNode); + rootUnitNode.Expanded = true; + var otherPreRunls = allPreRunLs.Where(p => p.PreRunLevel != 1).ToList(); + this.BindNodes(rootUnitNode, otherPreRunls, item.PreRunId); + } + } + + /// + /// 绑定树节点 + /// + private void BindNodes(TreeNode node, List list, string parentId) + { + + var itemList = list.Where(p => p.ParentId == parentId).ToList(); + if (itemList.Count > 0) + { + foreach (var item in itemList) + { + TreeNode newNode = new TreeNode(); + newNode.Text = item.PreRunName; + newNode.NodeID = item.PreRunId; + newNode.ToolTip = item.PreRunName; + newNode.CommandName = ""; + newNode.EnableClickEvent = true; + node.Nodes.Add(newNode); + BindNodes(newNode, list, item.PreRunId); + } + } + } + + /// + /// 数加载 + /// + protected void tvControlItem_NodeExpand(object sender, TreeNodeEventArgs e) + { + if (e.Node.Nodes != null) + { + e.Node.Nodes.Clear(); + } + var allPreRunLs = Funs.DB.PreRun_SysDevice.Where(p => p.ProjectId == this.CurrUser.LoginProjectId).ToList(); + this.BindNodes(e.Node, allPreRunLs, e.NodeID); + } + + /// + /// 点击TreeView + /// + /// + /// + protected void tvControlItem_NodeCommand(object sender, TreeCommandEventArgs e) + { + this.TreePreRunId = tvControlItem.SelectedNodeID; + this.PageBase(); + } + + /// + /// 数据显示 + /// + public void PageBase() + { + zxtsc.Hidden = true; + zxtsxt.Hidden = true; + zz.Hidden = true; + gx.Hidden = true; + sxt.Hidden = true; + sszxt.Hidden = true; + var model = Funs.DB.PreRun_SysDevice.FirstOrDefault(p => p.PreRunId == this.TreePreRunId); + if (model != null) + { + var ids = new List(); + if (!string.IsNullOrWhiteSpace(model.InstallationId)) ids.Add(model.InstallationId); + if (!string.IsNullOrWhiteSpace(model.ProcessesId)) ids.Add(model.ProcessesId); + if (!string.IsNullOrWhiteSpace(model.SystemId)) ids.Add(model.SystemId); + if (!string.IsNullOrWhiteSpace(model.SubsystemId)) ids.Add(model.SubsystemId); + var list = Funs.DB.PreRun_SysDevice.Where(p => ids.Contains(p.PreRunId)).ToList(); + + if (list.Count(p => p.PreRunLevel == 1) > 0) + { + zz.Hidden = false; + lblzzbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 1).PreRunCode; + lblzzmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 1).PreRunName; + } + if (list.Count(p => p.PreRunLevel == 2) > 0) + { + gx.Hidden = false; + lblgxmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 2).PreRunName; + lblgxbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 2).PreRunCode; + } + if (list.Count(p => p.PreRunLevel == 3) > 0) + { + sxt.Hidden = false; + lblsxtmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 3).PreRunName; + lblsxtbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 3).PreRunCode; + } + if (list.Count(p => p.PreRunLevel == 4) > 0) + { + sszxt.Hidden = false; + lblszxtmc.Text = list.FirstOrDefault(p => p.PreRunLevel == 4).PreRunName; + lblszxtbm.Text = list.FirstOrDefault(p => p.PreRunLevel == 4).PreRunCode; + } + + //判断是否为S系统 + if (model.PreRunLevel == 3) + { + zxtsc.Hidden = false; + ZxtgdBrid(); + } + + //判断是否为SS系统 + if (model.PreRunLevel == 4) + { + hidSystemId.Text = model.SystemId; + zxtsxt.Hidden = false; + SubPropertyBrid(); + } + } + } + + #endregion + + #region S系统管道一览表导入 + + /// + /// 绑定管道号 + /// + public void ZxtgdBrid() + { + string strSql = @"select * from PreRun_PropertySysPiping where ProjectId=@ProjectId and SystemId=@SystemId "; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@SystemId", this.tvControlItem.SelectedNodeID)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + GridZxtgd.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(GridZxtgd, tb); + GridZxtgd.DataSource = table; + GridZxtgd.DataBind(); + TabStrip1.ActiveTabIndex = 0; + } + + /// + /// 行按钮事件 + /// + protected void GridZxtgd_RowCommand(object sender, GridCommandEventArgs e) + { + if (e.CommandName == "Delete") + { + string rowID = e.RowID; + var model = Funs.DB.PreRun_PropertySysPiping.FirstOrDefault(p => p.PropertyId == rowID); + Funs.DB.PreRun_PropertySysPiping.DeleteOnSubmit(model); + Funs.DB.SubmitChanges(); + ZxtgdBrid(); + ShowNotify("删除成功!"); + } + } + + /// + /// 分页 + /// + protected void GridZxtgd_PageIndexChange(object sender, GridPageEventArgs e) + { + GridZxtgd.PageIndex = e.NewPageIndex; + ZxtgdBrid(); + } + + /// + /// 排序 + /// + protected void GridZxtgd_Sort(object sender, GridSortEventArgs e) + { + GridZxtgd.SortDirection = e.SortDirection; + GridZxtgd.SortField = e.SortField; + ZxtgdBrid(); + } + + /// + /// 分页下拉框事件 + /// + protected void ddlZxtgdPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + GridZxtgd.PageSize = Convert.ToInt32(ddlZxtgdPageSize.SelectedValue); + ZxtgdBrid(); + } + + /// + /// 导入管道一览表 + /// + protected void btnZxtgdImport_Click(object sender, EventArgs e) + { + try + { + if (this.fileData.HasFile == false) + { + ShowNotify("请选择excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.fileData.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls" && IsXls != ".xlsx") + { + ShowNotify("excel文件类型错误!", MessageBoxIcon.Warning); + return; + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + Const.ExcelUrl; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + //指定上传文件名称 + string fileUrl = BLL.Funs.GetNewFileName() + IsXls; + //上传文件路径 + string filePath = initFullPath + fileUrl; + //文件上传服务器 + this.fileData.PostedFile.SaveAs(filePath); + //文件上传服务器后的名称 + string fileName = rootPath + Const.ExcelUrl + fileUrl; + //读取Excel + DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out string message, false); + if (ds == null) + { + ShowNotify("模板错误,请从系统下载正确的模板!", MessageBoxIcon.Warning); + return; + } + if (!string.IsNullOrWhiteSpace(message)) + { + ShowNotify(message, MessageBoxIcon.Warning); + return; + } + if (ds.Tables[0].Rows.Count > 3) + { + var fileVerify = PropertyVerifyFile(ds); + if (!fileVerify) + { + ShowNotify("请获取正确模板!", MessageBoxIcon.Warning); + return; + } + var columVerify = HasRepeatData(ds.Tables[0], new string[] { "A" }); + if (columVerify) + { + ShowNotify("模板中存在管道号相同的数据!", MessageBoxIcon.Warning); + return; + } + var pipingCodes = GetColumnValues(ds.Tables[0], "A"); + var removeCodes = new List() { "管道号", "管道说明", "" }; + pipingCodes.RemoveAll(a => removeCodes.Contains(a)); + var existPropertys = Funs.DB.PreRun_PropertySysPiping.Where(a => pipingCodes.Contains(a.PipingCode) && a.SystemId == tvControlItem.SelectedNodeID && a.ProjectId == this.CurrUser.LoginProjectId).ToList(); + if (existPropertys.Count > 0) + { + ShowNotify($"管道号({string.Join(",", existPropertys.ConvertAll(s => s.PipingCode))})已存在!", MessageBoxIcon.Warning); + return; + } + List list = new List(); + //数据导入 + for (int i = 3; i < ds.Tables[0].Rows.Count; i++) + { + if (ds.Tables[0].Rows[i][0] == null) continue; + + PreRun_PropertySysPiping model = new PreRun_PropertySysPiping(); + model.PropertyId = Guid.NewGuid().ToString(); + model.SystemId = tvControlItem.SelectedNodeID; + model.ProjectId = this.CurrUser.LoginProjectId; + model.PipingCode = ds.Tables[0].Rows[i][0].ToString(); + model.Diameter = ds.Tables[0].Rows[i][1] != null ? ds.Tables[0].Rows[i][1].ToString() : string.Empty; + model.MaterialLevel = ds.Tables[0].Rows[i][2] != null ? ds.Tables[0].Rows[i][2].ToString() : string.Empty; + model.AdiabatType = ds.Tables[0].Rows[i][3] != null ? ds.Tables[0].Rows[i][3].ToString() : string.Empty; + model.AdiabatThickness = ds.Tables[0].Rows[i][4] != null ? ds.Tables[0].Rows[i][4].ToString() : string.Empty; + model.MediumState = ds.Tables[0].Rows[i][5] != null ? ds.Tables[0].Rows[i][5].ToString() : string.Empty; + model.DrawingNo = ds.Tables[0].Rows[i][6] != null ? ds.Tables[0].Rows[i][6].ToString() : string.Empty; + model.PipingStart = ds.Tables[0].Rows[i][7] != null ? ds.Tables[0].Rows[i][7].ToString() : string.Empty; + model.PipingEnd = ds.Tables[0].Rows[i][8] != null ? ds.Tables[0].Rows[i][8].ToString() : string.Empty; + model.PipingLevel = ds.Tables[0].Rows[i][9] != null ? ds.Tables[0].Rows[i][9].ToString() : string.Empty; + model.NormalTemperature = ds.Tables[0].Rows[i][10] != null ? ds.Tables[0].Rows[i][10].ToString() : string.Empty; + model.NormalPressure = ds.Tables[0].Rows[i][11] != null ? ds.Tables[0].Rows[i][11].ToString() : string.Empty; + model.DesignTemperature = ds.Tables[0].Rows[i][12] != null ? ds.Tables[0].Rows[i][12].ToString() : string.Empty; + model.DesignPressure = ds.Tables[0].Rows[i][13] != null ? ds.Tables[0].Rows[i][13].ToString() : string.Empty; + model.PaintLevel = ds.Tables[0].Rows[i][14] != null ? ds.Tables[0].Rows[i][14].ToString() : string.Empty; + model.Remark = ds.Tables[0].Rows[i][15] != null ? ds.Tables[0].Rows[i][15].ToString() : string.Empty; + model.AddUser = this.CurrUser.UserId; + model.AddTime = DateTime.Now; + model.Sort = i - 2; + list.Add(model); + } + Funs.DB.PreRun_PropertySysPiping.InsertAllOnSubmit(list); + Funs.DB.SubmitChanges(); + } + else + { + ShowNotify("文件无数据!", MessageBoxIcon.Warning); + } + ZxtgdBrid(); + } + catch (Exception ex) + { + ShowNotify(ex.Message, MessageBoxIcon.Warning); + } + } + + /// + /// 管道一览表保存 + /// + protected void btnZxtgdSave_Click(object sender, EventArgs e) + { + try + { + JArray mergedData = GridZxtgd.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + string status = mergedRow.Value("status"); + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + var propertyId = this.GridZxtgd.Rows[i].DataKeys[0].ToString(); + PreRun_PropertySysPiping model = Funs.DB.PreRun_PropertySysPiping.FirstOrDefault(x => x.PropertyId == propertyId); + if (model == null) continue; + + model.PipingCode = values.Value("PipingCode"); + model.Diameter = values.Value("Diameter"); + model.MaterialLevel = values.Value("MaterialLevel"); + model.AdiabatType = values.Value("AdiabatType"); + model.AdiabatThickness = values.Value("AdiabatThickness"); + model.MediumState = values.Value("MediumState"); + model.DrawingNo = values.Value("DrawingNo"); + model.PipingStart = values.Value("PipingStart"); + model.PipingEnd = values.Value("PipingEnd"); + model.PipingLevel = values.Value("PipingLevel"); + model.NormalTemperature = values.Value("NormalTemperature"); + model.NormalPressure = values.Value("NormalPressure"); + model.DesignTemperature = values.Value("DesignTemperature"); + model.DesignPressure = values.Value("DesignPressure"); + model.PaintLevel = values.Value("PaintLevel"); + model.Remark = values.Value("Remark"); + Funs.DB.SubmitChanges(); + } + ZxtgdBrid(); + ShowNotify("修改成功!"); + } + catch (Exception ex) + { + ShowNotify(ex.Message, MessageBoxIcon.Error); + } + } + + /// + /// 管道模板下载 + /// + protected void btnGdDownLoad_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("是否确认下载模板?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirmgd_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + #endregion + + #region S系统工艺设备一览表导入 + + /// + /// 绑定工艺设备 + /// + public void ZxtgyBrid() + { + string strSql = @"select * from PreRun_TechnologySysPiping where ProjectId=@ProjectId and SystemId=@SystemId "; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@SystemId", this.tvControlItem.SelectedNodeID)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + GridZxtgy.RecordCount = tb.Rows.Count; + var table = this.GetPagedDataTable(GridZxtgy, tb); + GridZxtgy.DataSource = table; + GridZxtgy.DataBind(); + TabStrip1.ActiveTabIndex = 1; + } + + /// + /// 分页 + /// + protected void GridZxtgy_PageIndexChange(object sender, GridPageEventArgs e) + { + GridZxtgy.PageIndex = e.NewPageIndex; + ZxtgyBrid(); + } + + /// + /// 排序 + /// + protected void GridZxtgy_Sort(object sender, GridSortEventArgs e) + { + GridZxtgy.SortDirection = e.SortDirection; + GridZxtgy.SortField = e.SortField; + ZxtgyBrid(); + } + + /// + /// 行点击事件 + /// + protected void GridZxtgy_RowCommand(object sender, GridCommandEventArgs e) + { + if (e.CommandName == "Delete") + { + string rowID = e.RowID; + var model = Funs.DB.PreRun_TechnologySysPiping.FirstOrDefault(p => p.TechnologyId == rowID); + Funs.DB.PreRun_TechnologySysPiping.DeleteOnSubmit(model); + Funs.DB.SubmitChanges(); + ZxtgyBrid(); + ShowNotify("删除成功!"); + } + } + + /// + /// 分页下拉框事件 + /// + protected void ddlZxtgyPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + GridZxtgy.PageSize = Convert.ToInt32(ddlZxtgyPageSize.SelectedValue); + ZxtgyBrid(); + } + + /// + /// 工艺设备导入 + /// + protected void btnZxtgyImport_Click(object sender, EventArgs e) + { + try + { + if (this.filegyData.HasFile == false) + { + ShowNotify("请选择excel文件!", MessageBoxIcon.Warning); + return; + } + string IsXls = Path.GetExtension(this.filegyData.FileName).ToString().Trim().ToLower(); + if (IsXls != ".xls" && IsXls != ".xlsx") + { + ShowNotify("excel文件类型错误!", MessageBoxIcon.Warning); + return; + } + string rootPath = Server.MapPath("~/"); + string initFullPath = rootPath + Const.ExcelUrl; + if (!Directory.Exists(initFullPath)) + { + Directory.CreateDirectory(initFullPath); + } + //指定上传文件名称 + string fileUrl = BLL.Funs.GetNewFileName() + IsXls; + //上传文件路径 + string filePath = initFullPath + fileUrl; + //文件上传服务器 + this.filegyData.PostedFile.SaveAs(filePath); + //文件上传服务器后的名称 + string fileName = rootPath + Const.ExcelUrl + fileUrl; + //读取Excel + DataSet ds = NPOIHelper.ExcelToDataSet(fileName, out string message, false); + if (ds == null) + { + ShowNotify("模板错误,请从系统下载正确的模板!", MessageBoxIcon.Warning); + return; + } + if (!string.IsNullOrWhiteSpace(message)) + { + ShowNotify(message, MessageBoxIcon.Warning); + return; + } + if (ds.Tables[0].Rows.Count > 2) + { + var fileVerify = TechnologyVerifyFile(ds); + if (!fileVerify) + { + ShowNotify("请获取正确模板!", MessageBoxIcon.Warning); + return; + } + var columVerify = HasRepeatData(ds.Tables[0], new string[] { "A" }); + if (columVerify) + { + ShowNotify("模板中存在设备位号相同的数据!", MessageBoxIcon.Warning); + return; + } + var tagNumbers = GetColumnValues(ds.Tables[0], "A"); + var removeNumbers = new List() { "设备位号", "" }; + tagNumbers.RemoveAll(a => removeNumbers.Contains(a)); + var existTechnologys = Funs.DB.PreRun_TechnologySysPiping.Where(a => tagNumbers.Contains(a.TagNumber) && a.SystemId == tvControlItem.SelectedNodeID && a.ProjectId == this.CurrUser.LoginProjectId).ToList(); + if (existTechnologys.Count > 0) + { + ShowNotify($"设备位号({string.Join(",", existTechnologys.ConvertAll(s => s.TagNumber))})已存在!", MessageBoxIcon.Warning); + return; + } + List list = new List(); + //数据导入 + for (int i = 2; i < ds.Tables[0].Rows.Count; i++) + { + if (ds.Tables[0].Rows[i][0] == null) continue; + + PreRun_TechnologySysPiping model = new PreRun_TechnologySysPiping(); + model.TechnologyId = Guid.NewGuid().ToString(); + model.SystemId = tvControlItem.SelectedNodeID; + model.ProjectId = this.CurrUser.LoginProjectId; + model.TagNumber = ds.Tables[0].Rows[i][0].ToString(); + model.NameSpecifications = ds.Tables[0].Rows[i][1] != null ? ds.Tables[0].Rows[i][1].ToString() : string.Empty; + model.DrawingNo = ds.Tables[0].Rows[i][2] != null ? ds.Tables[0].Rows[i][2].ToString() : string.Empty; + model.Materials = ds.Tables[0].Rows[i][3] != null ? ds.Tables[0].Rows[i][3].ToString() : string.Empty; + model.NumOperate = ds.Tables[0].Rows[i][4] != null ? ds.Tables[0].Rows[i][4].ToString() : string.Empty; + model.NumStandby = ds.Tables[0].Rows[i][5] != null ? ds.Tables[0].Rows[i][5].ToString() : string.Empty; + model.WeightSingle = ds.Tables[0].Rows[i][6] != null ? ds.Tables[0].Rows[i][6].ToString() : string.Empty; + model.WeightTotal = ds.Tables[0].Rows[i][7] != null ? ds.Tables[0].Rows[i][7].ToString() : string.Empty; + model.Remark = ds.Tables[0].Rows[i][8] != null ? ds.Tables[0].Rows[i][8].ToString() : string.Empty; + model.AddUser = this.CurrUser.UserId; + model.AddTime = DateTime.Now; + model.Sort = i - 1; + list.Add(model); + } + Funs.DB.PreRun_TechnologySysPiping.InsertAllOnSubmit(list); + Funs.DB.SubmitChanges(); + } + else + { + ShowNotify("文件无数据!", MessageBoxIcon.Warning); + } + ZxtgyBrid(); + } + catch (Exception ex) + { + ShowNotify(ex.Message, MessageBoxIcon.Warning); + } + } + + /// + /// 工艺设备保存 + /// + protected void btnZxtgySave_Click(object sender, EventArgs e) + { + try + { + JArray mergedData = GridZxtgy.GetMergedData(); + foreach (JObject mergedRow in mergedData) + { + string status = mergedRow.Value("status"); + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + var technologyId = this.GridZxtgy.Rows[i].DataKeys[0].ToString(); + PreRun_TechnologySysPiping model = Funs.DB.PreRun_TechnologySysPiping.FirstOrDefault(x => x.TechnologyId == technologyId); + if (model == null) continue; + model.TagNumber = values.Value("TagNumber"); + model.NameSpecifications = values.Value("NameSpecifications"); + model.DrawingNo = values.Value("DrawingNo"); + model.Materials = values.Value("Materials"); + model.NumOperate = values.Value("NumOperate"); + model.NumStandby = values.Value("NumStandby"); + model.WeightSingle = values.Value("WeightSingle"); + model.WeightTotal = values.Value("WeightTotal"); + model.Remark = values.Value("Remark"); + Funs.DB.SubmitChanges(); + } + ZxtgyBrid(); + ShowNotify("修改成功!"); + } + catch (Exception ex) + { + ShowNotify(ex.Message, MessageBoxIcon.Error); + } + } + + /// + /// 工艺设备模板下载 + /// + protected void btnGysbDownLoad_Click(object sender, EventArgs e) + { + PageContext.RegisterStartupScript(Confirm.GetShowReference("是否确认下载模板?", String.Empty, MessageBoxIcon.Question, PageManager1.GetCustomEventReference(false, "Confirmgy_OK"), PageManager1.GetCustomEventReference("Confirm_Cancel"))); + } + + #endregion + + #region SS子系统管道一览表选择 + + /// + /// 绑定 + /// + public void SubPropertyBrid(List selectPropertys = null) + { + var datatb = new DataTable(); + var addTb = new DataTable(); + string strSql = @"select a.PropertyId,a.SystemId,a.ProjectId,a.PipingCode,a.Diameter,a.MaterialLevel,a.AdiabatType,a.AdiabatThickness,a.MediumState,a.DrawingNo,a.PipingStart,a.PipingEnd,a.PipingLevel,a.NormalTemperature,a.NormalPressure,a.DesignTemperature,a.DesignPressure,a.PaintLevel,a.Remark,a.AddUser,a.AddTime,a.Sort from PreRun_PropertySysPiping as a inner join PreRun_SubPropertySelect as b on a.PropertyId=b.PropertyId where 1=1 and a.ProjectId=@ProjectId and b.SubSystemId=@SubSystemId "; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@SubSystemId", this.tvControlItem.SelectedNodeID)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + if (selectPropertys != null && selectPropertys.Count > 0) + { + var existPropertyIds = GetColumnValues(tb, "PropertyId"); + if (existPropertyIds.Count > 0) selectPropertys.RemoveAll(a => existPropertyIds.Contains(a)); + + if (selectPropertys.Count > 0) + { + var addtbRowSql = $"select a.PropertyId,a.SystemId,a.ProjectId,a.PipingCode,a.Diameter,a.MaterialLevel,a.AdiabatType,a.AdiabatThickness,a.MediumState,a.DrawingNo,a.PipingStart,a.PipingEnd,a.PipingLevel,a.NormalTemperature,a.NormalPressure,a.DesignTemperature,a.DesignPressure,a.PaintLevel,a.Remark,a.AddUser,a.AddTime,a.Sort from PreRun_PropertySysPiping as a where 1=1 and a.PropertyId in ('{string.Join("','", selectPropertys)}')"; + addTb = SQLHelper.GetDataTableRunText(addtbRowSql); + } + } + if (addTb.Rows.Count > 0) datatb.Load(addTb.CreateDataReader()); + if (tb.Rows.Count > 0) datatb.Load(tb.CreateDataReader()); + if (datatb.Rows.Count > 0) + { + var pids = GetColumnValues(datatb, "PropertyId"); + if (pids.Count > 0) hidSelectProperty.Text = string.Join(",", pids); + } + else + { + hidSelectProperty.Text = string.Empty; + } + + gvSsxtgdxz.RecordCount = datatb.Rows.Count; + var table = this.GetPagedDataTable(GridZxtgd, datatb); + gvSsxtgdxz.DataSource = table; + gvSsxtgdxz.DataBind(); + TabStrip2.ActiveTabIndex = 0; + } + + /// + /// 分页 + /// + protected void gvSsxtgdxz_PageIndexChange(object sender, GridPageEventArgs e) + { + gvSsxtgdxz.PageIndex = e.NewPageIndex; + SubPropertyBrid(); + } + + /// + /// 排序 + /// + protected void gvSsxtgdxz_Sort(object sender, GridSortEventArgs e) + { + gvSsxtgdxz.SortDirection = e.SortDirection; + gvSsxtgdxz.SortField = e.SortField; + SubPropertyBrid(); + } + + /// + /// 行按钮事件 + /// + protected void gvSsxtgdxz_RowCommand(object sender, GridCommandEventArgs e) + { + if (e.CommandName == "Delete") + { + var ids = new List(); + string rowID = e.RowID; + var model = Funs.DB.PreRun_SubPropertySelect.FirstOrDefault(p => p.SubPropertyId == rowID); + if (model != null) + { + Funs.DB.PreRun_SubPropertySelect.DeleteOnSubmit(model); + Funs.DB.SubmitChanges(); + } + if (!string.IsNullOrWhiteSpace(hidSelectTechnology.Text)) + { + ids = hidSelectProperty.Text.Split(',').ToList(); + ids.RemoveAll(a => a == rowID); + } + SubPropertyBrid(ids); + ShowNotify("删除成功!"); + } + } + + /// + /// 分页下拉框事件 + /// + protected void ddlSubPropertyPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + gvSsxtgdxz.PageSize = Convert.ToInt32(ddlSubPropertyPageSize.SelectedValue); + SubPropertyBrid(); + } + + /// + /// 选择 + /// + protected void btnSelect_Click(object sender, EventArgs e) + { + string window = $"SelectProperty.aspx?SubSystemId={this.tvControlItem.SelectedNodeID}&SystemId={hidSystemId.Text}&SelectPropertyIds={hidSelectProperty.Text}"; + PageContext.RegisterStartupScript(Window1.GetSaveStateReference(this.hidSelectProperty.ClientID) + Window1.GetShowReference(window)); + } + + /// + /// 关闭 + /// + protected void Window1_Close(object sender, WindowCloseEventArgs e) + { + var list = hidSelectProperty.Text.Split(',').ToList(); + SubPropertyBrid(list); + } + + /// + /// 保存 + /// + protected void btnSelectSave_Click(object sender, EventArgs e) + { + try + { + JArray mergedData = gvSsxtgdxz.GetMergedData(); + List list = new List(); + foreach (JObject mergedRow in mergedData) + { + string status = mergedRow.Value("status"); + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + var deleteSubs = Funs.DB.PreRun_SubPropertySelect.Where(x => x.SubSystemId == this.tvControlItem.SelectedNodeID); + Funs.DB.PreRun_SubPropertySelect.DeleteAllOnSubmit(deleteSubs); + var model = new PreRun_SubPropertySelect(); + model.SubPropertyId = Guid.NewGuid().ToString(); + model.ProjectId = this.CurrUser.LoginProjectId; + model.SubSystemId = this.tvControlItem.SelectedNodeID; + model.PropertyId = gvSsxtgdxz.DataKeys[i][0].ToString(); + model.AddUser = this.CurrUser.UserId; + model.AddTime = DateTime.Now; + model.Sort = i; + list.Add(model); + } + if (list.Count > 0) + { + Funs.DB.PreRun_SubPropertySelect.InsertAllOnSubmit(list); + Funs.DB.SubmitChanges(); + } + SubPropertyBrid(); + ShowNotify("保存成功!"); + } + catch (Exception ex) + { + ShowNotify(ex.Message, MessageBoxIcon.Error); + } + } + + #endregion + + #region SS系统工艺设备一览表选择 + + /// + /// 绑定数据 + /// + public void SubTechnologyBrid(List selectTechnologys = null) + { + var datatb = new DataTable(); + var addTb = new DataTable(); + string strSql = @"select a.TechnologyId,a.SystemId,a.ProjectId,a.TagNumber,a.NameSpecifications,a.DrawingNo,a.Materials,a.NumOperate,a.NumStandby,a.WeightSingle,a.WeightTotal,a.Remark,a.AddUser,a.AddTime,a.Sort from PreRun_TechnologySysPiping as a inner join PreRun_SubTechnologySelect as b on a.TechnologyId=b.TechnologyId where 1=1 and a.ProjectId=@ProjectId and b.SubSystemId=@SubSystemId "; + List listStr = new List(); + listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId)); + listStr.Add(new SqlParameter("@SubSystemId", this.tvControlItem.SelectedNodeID)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + + if (selectTechnologys != null && selectTechnologys.Count > 0) + { + var existTechnologyIds = GetColumnValues(tb, "TechnologyId"); + if (existTechnologyIds.Count > 0) selectTechnologys.RemoveAll(a => existTechnologyIds.Contains(a)); + if (selectTechnologys.Count > 0) + { + var addtbRowSql = $"select a.TechnologyId,a.SystemId,a.ProjectId,a.TagNumber,a.NameSpecifications,a.DrawingNo,a.Materials,a.NumOperate,a.NumStandby,a.WeightSingle,a.WeightTotal,a.Remark,a.AddUser,a.AddTime,a.Sort from PreRun_TechnologySysPiping as a where 1=1 and a.TechnologyId in ('{string.Join("','", selectTechnologys)}')"; + addTb = SQLHelper.GetDataTableRunText(addtbRowSql); + } + } + if (addTb.Rows.Count > 0) datatb.Load(addTb.CreateDataReader()); + if (tb.Rows.Count > 0) datatb.Load(tb.CreateDataReader()); + if (datatb.Rows.Count > 0) + { + var tids = GetColumnValues(datatb, "TechnologyId"); + if (tids.Count > 0) hidSelectTechnology.Text = string.Join(",", tids); + } + else + { + hidSelectTechnology.Text = string.Empty; + } + + gvSsxtgyxz.RecordCount = datatb.Rows.Count; + var table = this.GetPagedDataTable(gvSsxtgyxz, datatb); + gvSsxtgyxz.DataSource = table; + gvSsxtgyxz.DataBind(); + TabStrip2.ActiveTabIndex = 1; + } + + /// + /// 分页 + /// + protected void gvSsxtgyxz_PageIndexChange(object sender, GridPageEventArgs e) + { + gvSsxtgyxz.PageIndex = e.NewPageIndex; + SubTechnologyBrid(); + } + + /// + /// 排序 + /// + protected void gvSsxtgyxz_Sort(object sender, GridSortEventArgs e) + { + gvSsxtgyxz.SortDirection = e.SortDirection; + gvSsxtgyxz.SortField = e.SortField; + SubTechnologyBrid(); + } + + /// + /// 行事件 + /// + protected void gvSsxtgyxz_RowCommand(object sender, GridCommandEventArgs e) + { + if (e.CommandName == "Delete") + { + var ids = new List(); + string rowID = e.RowID; + var model = Funs.DB.PreRun_SubTechnologySelect.FirstOrDefault(p => p.TechnologyId == rowID); + if (model != null) + { + Funs.DB.PreRun_SubTechnologySelect.DeleteOnSubmit(model); + Funs.DB.SubmitChanges(); + } + if (!string.IsNullOrWhiteSpace(hidSelectTechnology.Text)) + { + ids = hidSelectTechnology.Text.Split(',').ToList(); + ids.RemoveAll(a => a == rowID); + } + SubTechnologyBrid(ids); + ShowNotify("删除成功!"); + } + } + + /// + /// 分页下拉框事件 + /// + protected void ddlSubTechnologyPageSize_SelectedIndexChanged(object sender, EventArgs e) + { + gvSsxtgyxz.PageSize = Convert.ToInt32(ddlSubTechnologyPageSize.SelectedValue); + SubTechnologyBrid(); + } + + /// + /// 关闭 + /// + protected void Window2_Close(object sender, WindowCloseEventArgs e) + { + var list = hidSelectTechnology.Text.Split(',').ToList(); + SubTechnologyBrid(list); + } + + /// + /// 选择 + /// + protected void btngySelect_Click(object sender, EventArgs e) + { + string window = $"SelectTechnology.aspx?SubSystemId={this.tvControlItem.SelectedNodeID}&SystemId={hidSystemId.Text}&SelectTechnologyIds={hidSelectTechnology.Text}"; + PageContext.RegisterStartupScript(Window2.GetSaveStateReference(this.hidSelectTechnology.ClientID) + Window2.GetShowReference(window)); + } + + /// + /// 保存 + /// + protected void btngySelectSave_Click(object sender, EventArgs e) + { + try + { + JArray mergedData = gvSsxtgyxz.GetMergedData(); + List list = new List(); + foreach (JObject mergedRow in mergedData) + { + string status = mergedRow.Value("status"); + JObject values = mergedRow.Value("values"); + int i = mergedRow.Value("index"); + var deleteSubs = Funs.DB.PreRun_SubTechnologySelect.Where(x => x.SubSystemId == this.tvControlItem.SelectedNodeID); + Funs.DB.PreRun_SubTechnologySelect.DeleteAllOnSubmit(deleteSubs); + var model = new PreRun_SubTechnologySelect(); + model.SubTechnologyId = Guid.NewGuid().ToString(); + model.ProjectId = this.CurrUser.LoginProjectId; + model.SubSystemId = this.tvControlItem.SelectedNodeID; + model.TechnologyId = gvSsxtgyxz.DataKeys[i][0].ToString(); + model.AddUser = this.CurrUser.UserId; + model.AddTime = DateTime.Now; + model.Sort = i; + list.Add(model); + } + if (list.Count > 0) + { + Funs.DB.PreRun_SubTechnologySelect.InsertAllOnSubmit(list); + Funs.DB.SubmitChanges(); + } + SubTechnologyBrid(); + ShowNotify("保存成功!"); + } + catch (Exception ex) + { + ShowNotify(ex.Message, MessageBoxIcon.Error); + } + } + + #endregion + + #region 私有方法 + + /// + /// 验证管道模板是否正确 + /// + /// + /// + private bool PropertyVerifyFile(DataSet ds) + { + var result = true; + + if (ds.Tables[0].Rows[1][0].ToString() != "管道号") result = false; + if (ds.Tables[0].Rows[1][1].ToString() != "公称") result = false; + if (ds.Tables[0].Rows[1][2].ToString() != "管道材料等级") result = false; + if (ds.Tables[0].Rows[1][3].ToString() != "绝热伴热") result = false; + + return result; + } + + /// + /// 验证管道模板是否正确 + /// + /// + /// + private bool TechnologyVerifyFile(DataSet ds) + { + var result = true; + + if (ds.Tables[0].Rows[0][0].ToString() != "设备位号") result = false; + if (ds.Tables[0].Rows[0][1].ToString() != "设备名称和规格") result = false; + if (ds.Tables[0].Rows[0][2].ToString() != "图号或型号") result = false; + if (ds.Tables[0].Rows[0][3].ToString() != "制造材料") result = false; + + return result; + } + + /// + /// 验证datatable某列是否存在重复 + /// + /// + public bool HasRepeatData(DataTable dt, string[] colName) + { + bool flag = false; + DataView myDataView = new DataView(dt); + if (myDataView.ToTable(true, colName).Rows.Count < dt.Rows.Count) + { + flag = true; + } + return flag; + } + + /// + /// 获取某一列的所有值 + /// + /// 列数据类型 + /// 数据表 + /// 列名 + /// + public static List GetColumnValues(DataTable dtSource, string filedName) + { + return (from r in dtSource.AsEnumerable() select r.Field(filedName)).ToList(); + } + + /// + /// 导入管道和工艺tab选择 + /// + protected void TabStrip1_TabIndexChanged(object sender, EventArgs e) + { + if (TabStrip1.ActiveTabIndex == 0) + { + //管道一览表 + ZxtgdBrid(); + } + else if (TabStrip1.ActiveTabIndex == 1) + { + //工艺设备一览表 + ZxtgyBrid(); + } + } + + /// + /// 选择管道和工艺tab选择 + /// + protected void TabStrip2_TabIndexChanged(object sender, EventArgs e) + { + if (TabStrip2.ActiveTabIndex == 0) + { + //管道 + SubPropertyBrid(); + } + else if (TabStrip2.ActiveTabIndex == 1) + { + //工艺设备 + SubTechnologyBrid(); + } + } + + /// + /// 下载导入模板 + /// + protected void PageManager1_CustomEvent(object sender, CustomEventArgs e) + { + if (e.EventArgument == "Confirmgd_OK" || e.EventArgument == "Confirmgy_OK") + { + string constUrl = string.Empty; + if (e.EventArgument == "Confirmgd_OK") + { + constUrl = Const.PropertyUrl; + } + else if (e.EventArgument == "Confirmgy_OK") + { + constUrl = Const.TechnologyUrl; + } + string rootPath = Server.MapPath("~/"); + string uploadfilepath = rootPath + constUrl; + string filePath = constUrl; + 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 + + } +} \ No newline at end of file diff --git a/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.designer.cs b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.designer.cs new file mode 100644 index 00000000..0818981b --- /dev/null +++ b/SGGL/FineUIPro.Web/TestRun/BeforeTestRun/SysPipingDeviceImport.aspx.designer.cs @@ -0,0 +1,834 @@ +//------------------------------------------------------------------------------ +// <自动生成> +// 此代码由工具生成。 +// +// 对此文件的更改可能导致不正确的行为,如果 +// 重新生成代码,则所做更改将丢失。 +// +//------------------------------------------------------------------------------ + +namespace FineUIPro.Web.TestRun.BeforeTestRun { + + + public partial class SysPipingDeviceImport { + + /// + /// form1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::System.Web.UI.HtmlControls.HtmlForm form1; + + /// + /// PageManager1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.PageManager PageManager1; + + /// + /// Panel1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel Panel1; + + /// + /// panelLeftRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelLeftRegion; + + /// + /// tvControlItem 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Tree tvControlItem; + + /// + /// panelCenterRegion 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Panel panelCenterRegion; + + /// + /// Toolbar2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar2; + + /// + /// hdTrustID 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hdTrustID; + + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// zz 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow zz; + + /// + /// lblzzbm 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblzzbm; + + /// + /// lblzzmc 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblzzmc; + + /// + /// gx 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow gx; + + /// + /// lblgxbm 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblgxbm; + + /// + /// lblgxmc 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblgxmc; + + /// + /// sxt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow sxt; + + /// + /// lblsxtbm 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblsxtbm; + + /// + /// lblsxtmc 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblsxtmc; + + /// + /// sszxt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow sszxt; + + /// + /// lblszxtbm 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblszxtbm; + + /// + /// lblszxtmc 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Label lblszxtmc; + + /// + /// zxtsc 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow zxtsc; + + /// + /// TabStrip1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TabStrip TabStrip1; + + /// + /// GridZxtgd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid GridZxtgd; + + /// + /// Toolbar1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar1; + + /// + /// fileData 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload fileData; + + /// + /// btnZxtgdImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnZxtgdImport; + + /// + /// ToolbarFill 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill; + + /// + /// btnGdDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGdDownLoad; + + /// + /// btnZxtgdSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnZxtgdSave; + + /// + /// txtPipingCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipingCode; + + /// + /// txtDiameter 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDiameter; + + /// + /// txtMaterialLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMaterialLevel; + + /// + /// txtAdiabatType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAdiabatType; + + /// + /// txtAdiabatThickness 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtAdiabatThickness; + + /// + /// txtMediumState 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMediumState; + + /// + /// txtDrawingNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDrawingNo; + + /// + /// txtPipingStart 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipingStart; + + /// + /// txtPipingEnd 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipingEnd; + + /// + /// txtPipingLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipingLevel; + + /// + /// txtNormalTemperature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNormalTemperature; + + /// + /// txtNormalPressure 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNormalPressure; + + /// + /// txtDesignTemperature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDesignTemperature; + + /// + /// txtDesignPressure 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDesignPressure; + + /// + /// txtPaintLevel 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPaintLevel; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtRemark; + + /// + /// ToolbarSeparator1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + + /// + /// ToolbarText1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText1; + + /// + /// ddlZxtgdPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlZxtgdPageSize; + + /// + /// GridZxtgy 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid GridZxtgy; + + /// + /// Toolbar3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar3; + + /// + /// filegyData 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FileUpload filegyData; + + /// + /// btnZxtgyImport 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnZxtgyImport; + + /// + /// ToolbarFill1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill1; + + /// + /// btnGysbDownLoad 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnGysbDownLoad; + + /// + /// btnZxtgySave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnZxtgySave; + + /// + /// txtTagNumber 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTagNumber; + + /// + /// txtNameSpecifications 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNameSpecifications; + + /// + /// txtgyDrawingNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtgyDrawingNo; + + /// + /// txtMaterials 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtMaterials; + + /// + /// txtNumOperate 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNumOperate; + + /// + /// txtNumStandby 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtNumStandby; + + /// + /// txtWeightSingle 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWeightSingle; + + /// + /// txtWeightTotal 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtWeightTotal; + + /// + /// txtgyRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtgyRemark; + + /// + /// ToolbarSeparator2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator2; + + /// + /// ToolbarText2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText2; + + /// + /// ddlZxtgyPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlZxtgyPageSize; + + /// + /// zxtsxt 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.FormRow zxtsxt; + + /// + /// TabStrip2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TabStrip TabStrip2; + + /// + /// gvSsxtgdxz 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvSsxtgdxz; + + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// ToolbarFill2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// btnSelect 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSelect; + + /// + /// btnSelectSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSelectSave; + + /// + /// hidSelectProperty 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hidSelectProperty; + + /// + /// hidSystemId 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hidSystemId; + + /// + /// ToolbarSeparator3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator3; + + /// + /// ToolbarText3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText3; + + /// + /// ddlSubPropertyPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlSubPropertyPageSize; + + /// + /// gvSsxtgyxz 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Grid gvSsxtgyxz; + + /// + /// Toolbar5 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar5; + + /// + /// ToolbarFill3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill3; + + /// + /// btngySelect 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btngySelect; + + /// + /// btngySelectSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btngySelectSave; + + /// + /// hidSelectTechnology 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.HiddenField hidSelectTechnology; + + /// + /// ToolbarSeparator4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarSeparator ToolbarSeparator4; + + /// + /// ToolbarText4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarText ToolbarText4; + + /// + /// ddlSubTechnologyPageSize 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList ddlSubTechnologyPageSize; + + /// + /// Window1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window1; + + /// + /// Window2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Window Window2; + } +} diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 43d868f4..a1008b3a 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -1607,9 +1607,27 @@ namespace Model partial void InsertPersonTrain_TrainPlan(PersonTrain_TrainPlan instance); partial void UpdatePersonTrain_TrainPlan(PersonTrain_TrainPlan instance); partial void DeletePersonTrain_TrainPlan(PersonTrain_TrainPlan instance); + partial void InsertPreRun_PropertySysPiping(PreRun_PropertySysPiping instance); + partial void UpdatePreRun_PropertySysPiping(PreRun_PropertySysPiping instance); + partial void DeletePreRun_PropertySysPiping(PreRun_PropertySysPiping instance); + partial void InsertPreRun_SubPropertySelect(PreRun_SubPropertySelect instance); + partial void UpdatePreRun_SubPropertySelect(PreRun_SubPropertySelect instance); + partial void DeletePreRun_SubPropertySelect(PreRun_SubPropertySelect instance); + partial void InsertPreRun_SubSysWorkPackage(PreRun_SubSysWorkPackage instance); + partial void UpdatePreRun_SubSysWorkPackage(PreRun_SubSysWorkPackage instance); + partial void DeletePreRun_SubSysWorkPackage(PreRun_SubSysWorkPackage instance); + partial void InsertPreRun_SubTechnologySelect(PreRun_SubTechnologySelect instance); + partial void UpdatePreRun_SubTechnologySelect(PreRun_SubTechnologySelect instance); + partial void DeletePreRun_SubTechnologySelect(PreRun_SubTechnologySelect instance); partial void InsertPreRun_SysDevice(PreRun_SysDevice instance); partial void UpdatePreRun_SysDevice(PreRun_SysDevice instance); partial void DeletePreRun_SysDevice(PreRun_SysDevice instance); + partial void InsertPreRun_TechnologySysPiping(PreRun_TechnologySysPiping instance); + partial void UpdatePreRun_TechnologySysPiping(PreRun_TechnologySysPiping instance); + partial void DeletePreRun_TechnologySysPiping(PreRun_TechnologySysPiping instance); + partial void InsertPreRun_WorkPackage(PreRun_WorkPackage instance); + partial void UpdatePreRun_WorkPackage(PreRun_WorkPackage instance); + partial void DeletePreRun_WorkPackage(PreRun_WorkPackage instance); partial void InsertProcessControl_HotProessManage(ProcessControl_HotProessManage instance); partial void UpdateProcessControl_HotProessManage(ProcessControl_HotProessManage instance); partial void DeleteProcessControl_HotProessManage(ProcessControl_HotProessManage instance); @@ -1970,9 +1988,6 @@ namespace Model partial void InsertSolution_SolutionTemplate(Solution_SolutionTemplate instance); partial void UpdateSolution_SolutionTemplate(Solution_SolutionTemplate instance); partial void DeleteSolution_SolutionTemplate(Solution_SolutionTemplate instance); - partial void InsertSubSys_WorkPackage(SubSys_WorkPackage instance); - partial void UpdateSubSys_WorkPackage(SubSys_WorkPackage instance); - partial void DeleteSubSys_WorkPackage(SubSys_WorkPackage instance); partial void InsertSupervise_SubUnitCheckRectify(Supervise_SubUnitCheckRectify instance); partial void UpdateSupervise_SubUnitCheckRectify(Supervise_SubUnitCheckRectify instance); partial void DeleteSupervise_SubUnitCheckRectify(Supervise_SubUnitCheckRectify instance); @@ -2315,9 +2330,6 @@ namespace Model partial void InsertWelder_WelderQualify(Welder_WelderQualify instance); partial void UpdateWelder_WelderQualify(Welder_WelderQualify instance); partial void DeleteWelder_WelderQualify(Welder_WelderQualify instance); - partial void InsertWork_Package(Work_Package instance); - partial void UpdateWork_Package(Work_Package instance); - partial void DeleteWork_Package(Work_Package instance); partial void InsertWPQ_WPQList(WPQ_WPQList instance); partial void UpdateWPQ_WPQList(WPQ_WPQList instance); partial void DeleteWPQ_WPQList(WPQ_WPQList instance); @@ -6599,6 +6611,38 @@ namespace Model } } + public System.Data.Linq.Table PreRun_PropertySysPiping + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table PreRun_SubPropertySelect + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table PreRun_SubSysWorkPackage + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table PreRun_SubTechnologySelect + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table PreRun_SysDevice { get @@ -6607,6 +6651,22 @@ namespace Model } } + public System.Data.Linq.Table PreRun_TechnologySysPiping + { + get + { + return this.GetTable(); + } + } + + public System.Data.Linq.Table PreRun_WorkPackage + { + get + { + return this.GetTable(); + } + } + public System.Data.Linq.Table ProcessControl_HotProessManage { get @@ -7575,14 +7635,6 @@ namespace Model } } - public System.Data.Linq.Table SubSys_WorkPackage - { - get - { - return this.GetTable(); - } - } - public System.Data.Linq.Table Supervise_SubUnitCheckRectify { get @@ -9479,14 +9531,6 @@ namespace Model } } - public System.Data.Linq.Table Work_Package - { - get - { - return this.GetTable(); - } - } - public System.Data.Linq.Table WPQ_WPQList { get @@ -49272,7 +49316,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WED_Class", DbType="VarChar(4)")] + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WED_Class", DbType="NVarChar(50)")] public string WED_Class { get @@ -255560,6 +255604,1262 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.PreRun_PropertySysPiping")] + public partial class PreRun_PropertySysPiping : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _PropertyId; + + private string _SystemId; + + private string _ProjectId; + + private string _PipingCode; + + private string _Diameter; + + private string _MaterialLevel; + + private string _AdiabatType; + + private string _AdiabatThickness; + + private string _MediumState; + + private string _DrawingNo; + + private string _PipingStart; + + private string _PipingEnd; + + private string _PipingLevel; + + private string _NormalTemperature; + + private string _NormalPressure; + + private string _DesignTemperature; + + private string _DesignPressure; + + private string _PaintLevel; + + private string _Remark; + + private string _AddUser; + + private System.Nullable _AddTime; + + private System.Nullable _Sort; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnPropertyIdChanging(string value); + partial void OnPropertyIdChanged(); + partial void OnSystemIdChanging(string value); + partial void OnSystemIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnPipingCodeChanging(string value); + partial void OnPipingCodeChanged(); + partial void OnDiameterChanging(string value); + partial void OnDiameterChanged(); + partial void OnMaterialLevelChanging(string value); + partial void OnMaterialLevelChanged(); + partial void OnAdiabatTypeChanging(string value); + partial void OnAdiabatTypeChanged(); + partial void OnAdiabatThicknessChanging(string value); + partial void OnAdiabatThicknessChanged(); + partial void OnMediumStateChanging(string value); + partial void OnMediumStateChanged(); + partial void OnDrawingNoChanging(string value); + partial void OnDrawingNoChanged(); + partial void OnPipingStartChanging(string value); + partial void OnPipingStartChanged(); + partial void OnPipingEndChanging(string value); + partial void OnPipingEndChanged(); + partial void OnPipingLevelChanging(string value); + partial void OnPipingLevelChanged(); + partial void OnNormalTemperatureChanging(string value); + partial void OnNormalTemperatureChanged(); + partial void OnNormalPressureChanging(string value); + partial void OnNormalPressureChanged(); + partial void OnDesignTemperatureChanging(string value); + partial void OnDesignTemperatureChanged(); + partial void OnDesignPressureChanging(string value); + partial void OnDesignPressureChanged(); + partial void OnPaintLevelChanging(string value); + partial void OnPaintLevelChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + partial void OnAddUserChanging(string value); + partial void OnAddUserChanged(); + partial void OnAddTimeChanging(System.Nullable value); + partial void OnAddTimeChanged(); + partial void OnSortChanging(System.Nullable value); + partial void OnSortChanged(); + #endregion + + public PreRun_PropertySysPiping() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PropertyId", DbType="VarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string PropertyId + { + get + { + return this._PropertyId; + } + set + { + if ((this._PropertyId != value)) + { + this.OnPropertyIdChanging(value); + this.SendPropertyChanging(); + this._PropertyId = value; + this.SendPropertyChanged("PropertyId"); + this.OnPropertyIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SystemId", DbType="VarChar(50)")] + public string SystemId + { + get + { + return this._SystemId; + } + set + { + if ((this._SystemId != value)) + { + this.OnSystemIdChanging(value); + this.SendPropertyChanging(); + this._SystemId = value; + this.SendPropertyChanged("SystemId"); + this.OnSystemIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="VarChar(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="_PipingCode", DbType="VarChar(50)")] + public string PipingCode + { + get + { + return this._PipingCode; + } + set + { + if ((this._PipingCode != value)) + { + this.OnPipingCodeChanging(value); + this.SendPropertyChanging(); + this._PipingCode = value; + this.SendPropertyChanged("PipingCode"); + this.OnPipingCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Diameter", DbType="VarChar(50)")] + public string Diameter + { + get + { + return this._Diameter; + } + set + { + if ((this._Diameter != value)) + { + this.OnDiameterChanging(value); + this.SendPropertyChanging(); + this._Diameter = value; + this.SendPropertyChanged("Diameter"); + this.OnDiameterChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MaterialLevel", DbType="VarChar(50)")] + public string MaterialLevel + { + get + { + return this._MaterialLevel; + } + set + { + if ((this._MaterialLevel != value)) + { + this.OnMaterialLevelChanging(value); + this.SendPropertyChanging(); + this._MaterialLevel = value; + this.SendPropertyChanged("MaterialLevel"); + this.OnMaterialLevelChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AdiabatType", DbType="VarChar(50)")] + public string AdiabatType + { + get + { + return this._AdiabatType; + } + set + { + if ((this._AdiabatType != value)) + { + this.OnAdiabatTypeChanging(value); + this.SendPropertyChanging(); + this._AdiabatType = value; + this.SendPropertyChanged("AdiabatType"); + this.OnAdiabatTypeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AdiabatThickness", DbType="VarChar(50)")] + public string AdiabatThickness + { + get + { + return this._AdiabatThickness; + } + set + { + if ((this._AdiabatThickness != value)) + { + this.OnAdiabatThicknessChanging(value); + this.SendPropertyChanging(); + this._AdiabatThickness = value; + this.SendPropertyChanged("AdiabatThickness"); + this.OnAdiabatThicknessChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_MediumState", DbType="VarChar(50)")] + public string MediumState + { + get + { + return this._MediumState; + } + set + { + if ((this._MediumState != value)) + { + this.OnMediumStateChanging(value); + this.SendPropertyChanging(); + this._MediumState = value; + this.SendPropertyChanged("MediumState"); + this.OnMediumStateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DrawingNo", DbType="VarChar(50)")] + public string DrawingNo + { + get + { + return this._DrawingNo; + } + set + { + if ((this._DrawingNo != value)) + { + this.OnDrawingNoChanging(value); + this.SendPropertyChanging(); + this._DrawingNo = value; + this.SendPropertyChanged("DrawingNo"); + this.OnDrawingNoChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipingStart", DbType="VarChar(50)")] + public string PipingStart + { + get + { + return this._PipingStart; + } + set + { + if ((this._PipingStart != value)) + { + this.OnPipingStartChanging(value); + this.SendPropertyChanging(); + this._PipingStart = value; + this.SendPropertyChanged("PipingStart"); + this.OnPipingStartChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipingEnd", DbType="VarChar(50)")] + public string PipingEnd + { + get + { + return this._PipingEnd; + } + set + { + if ((this._PipingEnd != value)) + { + this.OnPipingEndChanging(value); + this.SendPropertyChanging(); + this._PipingEnd = value; + this.SendPropertyChanged("PipingEnd"); + this.OnPipingEndChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PipingLevel", DbType="VarChar(50)")] + public string PipingLevel + { + get + { + return this._PipingLevel; + } + set + { + if ((this._PipingLevel != value)) + { + this.OnPipingLevelChanging(value); + this.SendPropertyChanging(); + this._PipingLevel = value; + this.SendPropertyChanged("PipingLevel"); + this.OnPipingLevelChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NormalTemperature", DbType="VarChar(50)")] + public string NormalTemperature + { + get + { + return this._NormalTemperature; + } + set + { + if ((this._NormalTemperature != value)) + { + this.OnNormalTemperatureChanging(value); + this.SendPropertyChanging(); + this._NormalTemperature = value; + this.SendPropertyChanged("NormalTemperature"); + this.OnNormalTemperatureChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NormalPressure", DbType="VarChar(50)")] + public string NormalPressure + { + get + { + return this._NormalPressure; + } + set + { + if ((this._NormalPressure != value)) + { + this.OnNormalPressureChanging(value); + this.SendPropertyChanging(); + this._NormalPressure = value; + this.SendPropertyChanged("NormalPressure"); + this.OnNormalPressureChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DesignTemperature", DbType="VarChar(50)")] + public string DesignTemperature + { + get + { + return this._DesignTemperature; + } + set + { + if ((this._DesignTemperature != value)) + { + this.OnDesignTemperatureChanging(value); + this.SendPropertyChanging(); + this._DesignTemperature = value; + this.SendPropertyChanged("DesignTemperature"); + this.OnDesignTemperatureChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DesignPressure", DbType="VarChar(50)")] + public string DesignPressure + { + get + { + return this._DesignPressure; + } + set + { + if ((this._DesignPressure != value)) + { + this.OnDesignPressureChanging(value); + this.SendPropertyChanging(); + this._DesignPressure = value; + this.SendPropertyChanged("DesignPressure"); + this.OnDesignPressureChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PaintLevel", DbType="VarChar(50)")] + public string PaintLevel + { + get + { + return this._PaintLevel; + } + set + { + if ((this._PaintLevel != value)) + { + this.OnPaintLevelChanging(value); + this.SendPropertyChanging(); + this._PaintLevel = value; + this.SendPropertyChanged("PaintLevel"); + this.OnPaintLevelChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(150)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this.OnRemarkChanging(value); + this.SendPropertyChanging(); + this._Remark = value; + this.SendPropertyChanged("Remark"); + this.OnRemarkChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddUser", DbType="VarChar(50)")] + public string AddUser + { + get + { + return this._AddUser; + } + set + { + if ((this._AddUser != value)) + { + this.OnAddUserChanging(value); + this.SendPropertyChanging(); + this._AddUser = value; + this.SendPropertyChanged("AddUser"); + this.OnAddUserChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddTime", DbType="DateTime")] + public System.Nullable AddTime + { + get + { + return this._AddTime; + } + set + { + if ((this._AddTime != value)) + { + this.OnAddTimeChanging(value); + this.SendPropertyChanging(); + this._AddTime = value; + this.SendPropertyChanged("AddTime"); + this.OnAddTimeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort", DbType="Int")] + public System.Nullable Sort + { + get + { + return this._Sort; + } + set + { + if ((this._Sort != value)) + { + this.OnSortChanging(value); + this.SendPropertyChanging(); + this._Sort = value; + this.SendPropertyChanged("Sort"); + this.OnSortChanged(); + } + } + } + + 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.PreRun_SubPropertySelect")] + public partial class PreRun_SubPropertySelect : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _SubPropertyId; + + private string _ProjectId; + + private string _SubSystemId; + + private string _PropertyId; + + private string _Remark; + + private string _AddUser; + + private System.Nullable _AddTime; + + private System.Nullable _Sort; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnSubPropertyIdChanging(string value); + partial void OnSubPropertyIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnSubSystemIdChanging(string value); + partial void OnSubSystemIdChanged(); + partial void OnPropertyIdChanging(string value); + partial void OnPropertyIdChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + partial void OnAddUserChanging(string value); + partial void OnAddUserChanged(); + partial void OnAddTimeChanging(System.Nullable value); + partial void OnAddTimeChanged(); + partial void OnSortChanging(System.Nullable value); + partial void OnSortChanged(); + #endregion + + public PreRun_SubPropertySelect() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubPropertyId", DbType="VarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string SubPropertyId + { + get + { + return this._SubPropertyId; + } + set + { + if ((this._SubPropertyId != value)) + { + this.OnSubPropertyIdChanging(value); + this.SendPropertyChanging(); + this._SubPropertyId = value; + this.SendPropertyChanged("SubPropertyId"); + this.OnSubPropertyIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="VarChar(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="_SubSystemId", DbType="VarChar(50)")] + public string SubSystemId + { + get + { + return this._SubSystemId; + } + set + { + if ((this._SubSystemId != value)) + { + this.OnSubSystemIdChanging(value); + this.SendPropertyChanging(); + this._SubSystemId = value; + this.SendPropertyChanged("SubSystemId"); + this.OnSubSystemIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_PropertyId", DbType="VarChar(50) NOT NULL", CanBeNull=false)] + public string PropertyId + { + get + { + return this._PropertyId; + } + set + { + if ((this._PropertyId != value)) + { + this.OnPropertyIdChanging(value); + this.SendPropertyChanging(); + this._PropertyId = value; + this.SendPropertyChanged("PropertyId"); + this.OnPropertyIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(150)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this.OnRemarkChanging(value); + this.SendPropertyChanging(); + this._Remark = value; + this.SendPropertyChanged("Remark"); + this.OnRemarkChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddUser", DbType="VarChar(50)")] + public string AddUser + { + get + { + return this._AddUser; + } + set + { + if ((this._AddUser != value)) + { + this.OnAddUserChanging(value); + this.SendPropertyChanging(); + this._AddUser = value; + this.SendPropertyChanged("AddUser"); + this.OnAddUserChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddTime", DbType="DateTime")] + public System.Nullable AddTime + { + get + { + return this._AddTime; + } + set + { + if ((this._AddTime != value)) + { + this.OnAddTimeChanging(value); + this.SendPropertyChanging(); + this._AddTime = value; + this.SendPropertyChanged("AddTime"); + this.OnAddTimeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort", DbType="Int")] + public System.Nullable Sort + { + get + { + return this._Sort; + } + set + { + if ((this._Sort != value)) + { + this.OnSortChanging(value); + this.SendPropertyChanging(); + this._Sort = value; + this.SendPropertyChanged("Sort"); + this.OnSortChanged(); + } + } + } + + 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.PreRun_SubSysWorkPackage")] + public partial class PreRun_SubSysWorkPackage : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _SubSysId; + + private string _SubSystemId; + + private string _WorkPackId; + + private string _WorkPackCode; + + private string _Remark; + + private string _AddUser; + + private System.Nullable _AddTime; + + private System.Nullable _Sort; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnSubSysIdChanging(string value); + partial void OnSubSysIdChanged(); + partial void OnSubSystemIdChanging(string value); + partial void OnSubSystemIdChanged(); + partial void OnWorkPackIdChanging(string value); + partial void OnWorkPackIdChanged(); + partial void OnWorkPackCodeChanging(string value); + partial void OnWorkPackCodeChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + partial void OnAddUserChanging(string value); + partial void OnAddUserChanged(); + partial void OnAddTimeChanging(System.Nullable value); + partial void OnAddTimeChanged(); + partial void OnSortChanging(System.Nullable value); + partial void OnSortChanged(); + #endregion + + public PreRun_SubSysWorkPackage() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubSysId", DbType="VarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string SubSysId + { + get + { + return this._SubSysId; + } + set + { + if ((this._SubSysId != value)) + { + this.OnSubSysIdChanging(value); + this.SendPropertyChanging(); + this._SubSysId = value; + this.SendPropertyChanged("SubSysId"); + this.OnSubSysIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubSystemId", DbType="VarChar(50)")] + public string SubSystemId + { + get + { + return this._SubSystemId; + } + set + { + if ((this._SubSystemId != value)) + { + this.OnSubSystemIdChanging(value); + this.SendPropertyChanging(); + this._SubSystemId = value; + this.SendPropertyChanged("SubSystemId"); + this.OnSubSystemIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackId", DbType="VarChar(50)")] + public string WorkPackId + { + get + { + return this._WorkPackId; + } + set + { + if ((this._WorkPackId != value)) + { + this.OnWorkPackIdChanging(value); + this.SendPropertyChanging(); + this._WorkPackId = value; + this.SendPropertyChanged("WorkPackId"); + this.OnWorkPackIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackCode", DbType="VarChar(50)")] + public string WorkPackCode + { + get + { + return this._WorkPackCode; + } + set + { + if ((this._WorkPackCode != value)) + { + this.OnWorkPackCodeChanging(value); + this.SendPropertyChanging(); + this._WorkPackCode = value; + this.SendPropertyChanged("WorkPackCode"); + this.OnWorkPackCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(150)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this.OnRemarkChanging(value); + this.SendPropertyChanging(); + this._Remark = value; + this.SendPropertyChanged("Remark"); + this.OnRemarkChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddUser", DbType="VarChar(50)")] + public string AddUser + { + get + { + return this._AddUser; + } + set + { + if ((this._AddUser != value)) + { + this.OnAddUserChanging(value); + this.SendPropertyChanging(); + this._AddUser = value; + this.SendPropertyChanged("AddUser"); + this.OnAddUserChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddTime", DbType="DateTime")] + public System.Nullable AddTime + { + get + { + return this._AddTime; + } + set + { + if ((this._AddTime != value)) + { + this.OnAddTimeChanging(value); + this.SendPropertyChanging(); + this._AddTime = value; + this.SendPropertyChanged("AddTime"); + this.OnAddTimeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort", DbType="Int")] + public System.Nullable Sort + { + get + { + return this._Sort; + } + set + { + if ((this._Sort != value)) + { + this.OnSortChanging(value); + this.SendPropertyChanging(); + this._Sort = value; + this.SendPropertyChanged("Sort"); + this.OnSortChanged(); + } + } + } + + 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.PreRun_SubTechnologySelect")] + public partial class PreRun_SubTechnologySelect : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _SubTechnologyId; + + private string _ProjectId; + + private string _SubSystemId; + + private string _TechnologyId; + + private string _Remark; + + private string _AddUser; + + private System.Nullable _AddTime; + + private System.Nullable _Sort; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnSubTechnologyIdChanging(string value); + partial void OnSubTechnologyIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnSubSystemIdChanging(string value); + partial void OnSubSystemIdChanged(); + partial void OnTechnologyIdChanging(string value); + partial void OnTechnologyIdChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + partial void OnAddUserChanging(string value); + partial void OnAddUserChanged(); + partial void OnAddTimeChanging(System.Nullable value); + partial void OnAddTimeChanged(); + partial void OnSortChanging(System.Nullable value); + partial void OnSortChanged(); + #endregion + + public PreRun_SubTechnologySelect() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubTechnologyId", DbType="VarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string SubTechnologyId + { + get + { + return this._SubTechnologyId; + } + set + { + if ((this._SubTechnologyId != value)) + { + this.OnSubTechnologyIdChanging(value); + this.SendPropertyChanging(); + this._SubTechnologyId = value; + this.SendPropertyChanged("SubTechnologyId"); + this.OnSubTechnologyIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="VarChar(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="_SubSystemId", DbType="VarChar(50)")] + public string SubSystemId + { + get + { + return this._SubSystemId; + } + set + { + if ((this._SubSystemId != value)) + { + this.OnSubSystemIdChanging(value); + this.SendPropertyChanging(); + this._SubSystemId = value; + this.SendPropertyChanged("SubSystemId"); + this.OnSubSystemIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TechnologyId", DbType="VarChar(50)")] + public string TechnologyId + { + get + { + return this._TechnologyId; + } + set + { + if ((this._TechnologyId != value)) + { + this.OnTechnologyIdChanging(value); + this.SendPropertyChanging(); + this._TechnologyId = value; + this.SendPropertyChanged("TechnologyId"); + this.OnTechnologyIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(150)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this.OnRemarkChanging(value); + this.SendPropertyChanging(); + this._Remark = value; + this.SendPropertyChanged("Remark"); + this.OnRemarkChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddUser", DbType="VarChar(50)")] + public string AddUser + { + get + { + return this._AddUser; + } + set + { + if ((this._AddUser != value)) + { + this.OnAddUserChanging(value); + this.SendPropertyChanging(); + this._AddUser = value; + this.SendPropertyChanged("AddUser"); + this.OnAddUserChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddTime", DbType="DateTime")] + public System.Nullable AddTime + { + get + { + return this._AddTime; + } + set + { + if ((this._AddTime != value)) + { + this.OnAddTimeChanging(value); + this.SendPropertyChanging(); + this._AddTime = value; + this.SendPropertyChanged("AddTime"); + this.OnAddTimeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort", DbType="Int")] + public System.Nullable Sort + { + get + { + return this._Sort; + } + set + { + if ((this._Sort != value)) + { + this.OnSortChanging(value); + this.SendPropertyChanging(); + this._Sort = value; + this.SendPropertyChanged("Sort"); + this.OnSortChanged(); + } + } + } + + 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.PreRun_SysDevice")] public partial class PreRun_SysDevice : INotifyPropertyChanging, INotifyPropertyChanged { @@ -255934,6 +257234,610 @@ namespace Model } } + [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.PreRun_TechnologySysPiping")] + public partial class PreRun_TechnologySysPiping : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _TechnologyId; + + private string _SystemId; + + private string _ProjectId; + + private string _TagNumber; + + private string _NameSpecifications; + + private string _DrawingNo; + + private string _Materials; + + private string _NumOperate; + + private string _NumStandby; + + private string _WeightSingle; + + private string _WeightTotal; + + private string _Remark; + + private string _AddUser; + + private System.Nullable _AddTime; + + private System.Nullable _Sort; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnTechnologyIdChanging(string value); + partial void OnTechnologyIdChanged(); + partial void OnSystemIdChanging(string value); + partial void OnSystemIdChanged(); + partial void OnProjectIdChanging(string value); + partial void OnProjectIdChanged(); + partial void OnTagNumberChanging(string value); + partial void OnTagNumberChanged(); + partial void OnNameSpecificationsChanging(string value); + partial void OnNameSpecificationsChanged(); + partial void OnDrawingNoChanging(string value); + partial void OnDrawingNoChanged(); + partial void OnMaterialsChanging(string value); + partial void OnMaterialsChanged(); + partial void OnNumOperateChanging(string value); + partial void OnNumOperateChanged(); + partial void OnNumStandbyChanging(string value); + partial void OnNumStandbyChanged(); + partial void OnWeightSingleChanging(string value); + partial void OnWeightSingleChanged(); + partial void OnWeightTotalChanging(string value); + partial void OnWeightTotalChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + partial void OnAddUserChanging(string value); + partial void OnAddUserChanged(); + partial void OnAddTimeChanging(System.Nullable value); + partial void OnAddTimeChanged(); + partial void OnSortChanging(System.Nullable value); + partial void OnSortChanged(); + #endregion + + public PreRun_TechnologySysPiping() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_TechnologyId", DbType="VarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string TechnologyId + { + get + { + return this._TechnologyId; + } + set + { + if ((this._TechnologyId != value)) + { + this.OnTechnologyIdChanging(value); + this.SendPropertyChanging(); + this._TechnologyId = value; + this.SendPropertyChanged("TechnologyId"); + this.OnTechnologyIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SystemId", DbType="VarChar(50)")] + public string SystemId + { + get + { + return this._SystemId; + } + set + { + if ((this._SystemId != value)) + { + this.OnSystemIdChanging(value); + this.SendPropertyChanging(); + this._SystemId = value; + this.SendPropertyChanged("SystemId"); + this.OnSystemIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_ProjectId", DbType="VarChar(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="_TagNumber", DbType="VarChar(50)")] + public string TagNumber + { + get + { + return this._TagNumber; + } + set + { + if ((this._TagNumber != value)) + { + this.OnTagNumberChanging(value); + this.SendPropertyChanging(); + this._TagNumber = value; + this.SendPropertyChanged("TagNumber"); + this.OnTagNumberChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NameSpecifications", DbType="VarChar(MAX)", UpdateCheck=UpdateCheck.Never)] + public string NameSpecifications + { + get + { + return this._NameSpecifications; + } + set + { + if ((this._NameSpecifications != value)) + { + this.OnNameSpecificationsChanging(value); + this.SendPropertyChanging(); + this._NameSpecifications = value; + this.SendPropertyChanged("NameSpecifications"); + this.OnNameSpecificationsChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_DrawingNo", DbType="VarChar(50)")] + public string DrawingNo + { + get + { + return this._DrawingNo; + } + set + { + if ((this._DrawingNo != value)) + { + this.OnDrawingNoChanging(value); + this.SendPropertyChanging(); + this._DrawingNo = value; + this.SendPropertyChanged("DrawingNo"); + this.OnDrawingNoChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Materials", DbType="VarChar(50)")] + public string Materials + { + get + { + return this._Materials; + } + set + { + if ((this._Materials != value)) + { + this.OnMaterialsChanging(value); + this.SendPropertyChanging(); + this._Materials = value; + this.SendPropertyChanged("Materials"); + this.OnMaterialsChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumOperate", DbType="VarChar(50)")] + public string NumOperate + { + get + { + return this._NumOperate; + } + set + { + if ((this._NumOperate != value)) + { + this.OnNumOperateChanging(value); + this.SendPropertyChanging(); + this._NumOperate = value; + this.SendPropertyChanged("NumOperate"); + this.OnNumOperateChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_NumStandby", DbType="VarChar(50)")] + public string NumStandby + { + get + { + return this._NumStandby; + } + set + { + if ((this._NumStandby != value)) + { + this.OnNumStandbyChanging(value); + this.SendPropertyChanging(); + this._NumStandby = value; + this.SendPropertyChanged("NumStandby"); + this.OnNumStandbyChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeightSingle", DbType="VarChar(50)")] + public string WeightSingle + { + get + { + return this._WeightSingle; + } + set + { + if ((this._WeightSingle != value)) + { + this.OnWeightSingleChanging(value); + this.SendPropertyChanging(); + this._WeightSingle = value; + this.SendPropertyChanged("WeightSingle"); + this.OnWeightSingleChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WeightTotal", DbType="VarChar(50)")] + public string WeightTotal + { + get + { + return this._WeightTotal; + } + set + { + if ((this._WeightTotal != value)) + { + this.OnWeightTotalChanging(value); + this.SendPropertyChanging(); + this._WeightTotal = value; + this.SendPropertyChanged("WeightTotal"); + this.OnWeightTotalChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(150)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this.OnRemarkChanging(value); + this.SendPropertyChanging(); + this._Remark = value; + this.SendPropertyChanged("Remark"); + this.OnRemarkChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddUser", DbType="VarChar(50)")] + public string AddUser + { + get + { + return this._AddUser; + } + set + { + if ((this._AddUser != value)) + { + this.OnAddUserChanging(value); + this.SendPropertyChanging(); + this._AddUser = value; + this.SendPropertyChanged("AddUser"); + this.OnAddUserChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddTime", DbType="DateTime")] + public System.Nullable AddTime + { + get + { + return this._AddTime; + } + set + { + if ((this._AddTime != value)) + { + this.OnAddTimeChanging(value); + this.SendPropertyChanging(); + this._AddTime = value; + this.SendPropertyChanged("AddTime"); + this.OnAddTimeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort", DbType="Int")] + public System.Nullable Sort + { + get + { + return this._Sort; + } + set + { + if ((this._Sort != value)) + { + this.OnSortChanging(value); + this.SendPropertyChanging(); + this._Sort = value; + this.SendPropertyChanged("Sort"); + this.OnSortChanged(); + } + } + } + + 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.PreRun_WorkPackage")] + public partial class PreRun_WorkPackage : INotifyPropertyChanging, INotifyPropertyChanged + { + + private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); + + private string _WorkPackId; + + private string _WorkPackCode; + + private string _WorkPackName; + + private string _Remark; + + private string _AddUser; + + private System.Nullable _AddTime; + + private System.Nullable _Sort; + + #region 可扩展性方法定义 + partial void OnLoaded(); + partial void OnValidate(System.Data.Linq.ChangeAction action); + partial void OnCreated(); + partial void OnWorkPackIdChanging(string value); + partial void OnWorkPackIdChanged(); + partial void OnWorkPackCodeChanging(string value); + partial void OnWorkPackCodeChanged(); + partial void OnWorkPackNameChanging(string value); + partial void OnWorkPackNameChanged(); + partial void OnRemarkChanging(string value); + partial void OnRemarkChanged(); + partial void OnAddUserChanging(string value); + partial void OnAddUserChanged(); + partial void OnAddTimeChanging(System.Nullable value); + partial void OnAddTimeChanged(); + partial void OnSortChanging(System.Nullable value); + partial void OnSortChanged(); + #endregion + + public PreRun_WorkPackage() + { + OnCreated(); + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackId", DbType="VarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] + public string WorkPackId + { + get + { + return this._WorkPackId; + } + set + { + if ((this._WorkPackId != value)) + { + this.OnWorkPackIdChanging(value); + this.SendPropertyChanging(); + this._WorkPackId = value; + this.SendPropertyChanged("WorkPackId"); + this.OnWorkPackIdChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackCode", DbType="VarChar(50)")] + public string WorkPackCode + { + get + { + return this._WorkPackCode; + } + set + { + if ((this._WorkPackCode != value)) + { + this.OnWorkPackCodeChanging(value); + this.SendPropertyChanging(); + this._WorkPackCode = value; + this.SendPropertyChanged("WorkPackCode"); + this.OnWorkPackCodeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackName", DbType="VarChar(50)")] + public string WorkPackName + { + get + { + return this._WorkPackName; + } + set + { + if ((this._WorkPackName != value)) + { + this.OnWorkPackNameChanging(value); + this.SendPropertyChanging(); + this._WorkPackName = value; + this.SendPropertyChanged("WorkPackName"); + this.OnWorkPackNameChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(150)")] + public string Remark + { + get + { + return this._Remark; + } + set + { + if ((this._Remark != value)) + { + this.OnRemarkChanging(value); + this.SendPropertyChanging(); + this._Remark = value; + this.SendPropertyChanged("Remark"); + this.OnRemarkChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddUser", DbType="VarChar(50)")] + public string AddUser + { + get + { + return this._AddUser; + } + set + { + if ((this._AddUser != value)) + { + this.OnAddUserChanging(value); + this.SendPropertyChanging(); + this._AddUser = value; + this.SendPropertyChanged("AddUser"); + this.OnAddUserChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddTime", DbType="DateTime")] + public System.Nullable AddTime + { + get + { + return this._AddTime; + } + set + { + if ((this._AddTime != value)) + { + this.OnAddTimeChanging(value); + this.SendPropertyChanging(); + this._AddTime = value; + this.SendPropertyChanged("AddTime"); + this.OnAddTimeChanged(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort", DbType="Int")] + public System.Nullable Sort + { + get + { + return this._Sort; + } + set + { + if ((this._Sort != value)) + { + this.OnSortChanging(value); + this.SendPropertyChanging(); + this._Sort = value; + this.SendPropertyChanged("Sort"); + this.OnSortChanged(); + } + } + } + + 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.ProcessControl_HotProessManage")] public partial class ProcessControl_HotProessManage : INotifyPropertyChanging, INotifyPropertyChanged { @@ -309204,236 +311108,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.SubSys_WorkPackage")] - public partial class SubSys_WorkPackage : INotifyPropertyChanging, INotifyPropertyChanged - { - - private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); - - private string _SubSysId; - - private string _SubSystemId; - - private string _WorkPackId; - - private string _WorkPackCode; - - private string _Remark; - - private string _AddUser; - - private System.Nullable _AddTime; - - private System.Nullable _Sort; - - #region 可扩展性方法定义 - partial void OnLoaded(); - partial void OnValidate(System.Data.Linq.ChangeAction action); - partial void OnCreated(); - partial void OnSubSysIdChanging(string value); - partial void OnSubSysIdChanged(); - partial void OnSubSystemIdChanging(string value); - partial void OnSubSystemIdChanged(); - partial void OnWorkPackIdChanging(string value); - partial void OnWorkPackIdChanged(); - partial void OnWorkPackCodeChanging(string value); - partial void OnWorkPackCodeChanged(); - partial void OnRemarkChanging(string value); - partial void OnRemarkChanged(); - partial void OnAddUserChanging(string value); - partial void OnAddUserChanged(); - partial void OnAddTimeChanging(System.Nullable value); - partial void OnAddTimeChanged(); - partial void OnSortChanging(System.Nullable value); - partial void OnSortChanged(); - #endregion - - public SubSys_WorkPackage() - { - OnCreated(); - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubSysId", DbType="VarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] - public string SubSysId - { - get - { - return this._SubSysId; - } - set - { - if ((this._SubSysId != value)) - { - this.OnSubSysIdChanging(value); - this.SendPropertyChanging(); - this._SubSysId = value; - this.SendPropertyChanged("SubSysId"); - this.OnSubSysIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SubSystemId", DbType="VarChar(50)")] - public string SubSystemId - { - get - { - return this._SubSystemId; - } - set - { - if ((this._SubSystemId != value)) - { - this.OnSubSystemIdChanging(value); - this.SendPropertyChanging(); - this._SubSystemId = value; - this.SendPropertyChanged("SubSystemId"); - this.OnSubSystemIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackId", DbType="VarChar(50)")] - public string WorkPackId - { - get - { - return this._WorkPackId; - } - set - { - if ((this._WorkPackId != value)) - { - this.OnWorkPackIdChanging(value); - this.SendPropertyChanging(); - this._WorkPackId = value; - this.SendPropertyChanged("WorkPackId"); - this.OnWorkPackIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackCode", DbType="VarChar(50)")] - public string WorkPackCode - { - get - { - return this._WorkPackCode; - } - set - { - if ((this._WorkPackCode != value)) - { - this.OnWorkPackCodeChanging(value); - this.SendPropertyChanging(); - this._WorkPackCode = value; - this.SendPropertyChanged("WorkPackCode"); - this.OnWorkPackCodeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(150)")] - public string Remark - { - get - { - return this._Remark; - } - set - { - if ((this._Remark != value)) - { - this.OnRemarkChanging(value); - this.SendPropertyChanging(); - this._Remark = value; - this.SendPropertyChanged("Remark"); - this.OnRemarkChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddUser", DbType="VarChar(50)")] - public string AddUser - { - get - { - return this._AddUser; - } - set - { - if ((this._AddUser != value)) - { - this.OnAddUserChanging(value); - this.SendPropertyChanging(); - this._AddUser = value; - this.SendPropertyChanged("AddUser"); - this.OnAddUserChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddTime", DbType="DateTime")] - public System.Nullable AddTime - { - get - { - return this._AddTime; - } - set - { - if ((this._AddTime != value)) - { - this.OnAddTimeChanging(value); - this.SendPropertyChanging(); - this._AddTime = value; - this.SendPropertyChanged("AddTime"); - this.OnAddTimeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort", DbType="Int")] - public System.Nullable Sort - { - get - { - return this._Sort; - } - set - { - if ((this._Sort != value)) - { - this.OnSortChanging(value); - this.SendPropertyChanging(); - this._Sort = value; - this.SendPropertyChanged("Sort"); - this.OnSortChanged(); - } - } - } - - 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.Supervise_SubUnitCheckRectify")] public partial class Supervise_SubUnitCheckRectify : INotifyPropertyChanging, INotifyPropertyChanged { @@ -392777,6 +394451,8 @@ namespace Model private string _ProjectId; + private string _EquipmentMaterialTypeName; + public View_WBS_CostControlDetailStatistics() { } @@ -392924,6 +394600,22 @@ namespace Model } } } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_EquipmentMaterialTypeName", DbType="NVarChar(50)")] + public string EquipmentMaterialTypeName + { + get + { + return this._EquipmentMaterialTypeName; + } + set + { + if ((this._EquipmentMaterialTypeName != value)) + { + this._EquipmentMaterialTypeName = value; + } + } + } } [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.View_WBS_CostControlParentDetail")] @@ -408540,212 +410232,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.Work_Package")] - public partial class Work_Package : INotifyPropertyChanging, INotifyPropertyChanged - { - - private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); - - private string _WorkPackId; - - private string _WorkPackCode; - - private string _WorkPackName; - - private string _Remark; - - private string _AddUser; - - private System.Nullable _AddTime; - - private System.Nullable _Sort; - - #region 可扩展性方法定义 - partial void OnLoaded(); - partial void OnValidate(System.Data.Linq.ChangeAction action); - partial void OnCreated(); - partial void OnWorkPackIdChanging(string value); - partial void OnWorkPackIdChanged(); - partial void OnWorkPackCodeChanging(string value); - partial void OnWorkPackCodeChanged(); - partial void OnWorkPackNameChanging(string value); - partial void OnWorkPackNameChanged(); - partial void OnRemarkChanging(string value); - partial void OnRemarkChanged(); - partial void OnAddUserChanging(string value); - partial void OnAddUserChanged(); - partial void OnAddTimeChanging(System.Nullable value); - partial void OnAddTimeChanged(); - partial void OnSortChanging(System.Nullable value); - partial void OnSortChanged(); - #endregion - - public Work_Package() - { - OnCreated(); - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackId", DbType="VarChar(50) NOT NULL", CanBeNull=false, IsPrimaryKey=true)] - public string WorkPackId - { - get - { - return this._WorkPackId; - } - set - { - if ((this._WorkPackId != value)) - { - this.OnWorkPackIdChanging(value); - this.SendPropertyChanging(); - this._WorkPackId = value; - this.SendPropertyChanged("WorkPackId"); - this.OnWorkPackIdChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackCode", DbType="VarChar(50)")] - public string WorkPackCode - { - get - { - return this._WorkPackCode; - } - set - { - if ((this._WorkPackCode != value)) - { - this.OnWorkPackCodeChanging(value); - this.SendPropertyChanging(); - this._WorkPackCode = value; - this.SendPropertyChanged("WorkPackCode"); - this.OnWorkPackCodeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_WorkPackName", DbType="VarChar(50)")] - public string WorkPackName - { - get - { - return this._WorkPackName; - } - set - { - if ((this._WorkPackName != value)) - { - this.OnWorkPackNameChanging(value); - this.SendPropertyChanging(); - this._WorkPackName = value; - this.SendPropertyChanged("WorkPackName"); - this.OnWorkPackNameChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Remark", DbType="NVarChar(150)")] - public string Remark - { - get - { - return this._Remark; - } - set - { - if ((this._Remark != value)) - { - this.OnRemarkChanging(value); - this.SendPropertyChanging(); - this._Remark = value; - this.SendPropertyChanged("Remark"); - this.OnRemarkChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddUser", DbType="VarChar(50)")] - public string AddUser - { - get - { - return this._AddUser; - } - set - { - if ((this._AddUser != value)) - { - this.OnAddUserChanging(value); - this.SendPropertyChanging(); - this._AddUser = value; - this.SendPropertyChanged("AddUser"); - this.OnAddUserChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_AddTime", DbType="DateTime")] - public System.Nullable AddTime - { - get - { - return this._AddTime; - } - set - { - if ((this._AddTime != value)) - { - this.OnAddTimeChanging(value); - this.SendPropertyChanging(); - this._AddTime = value; - this.SendPropertyChanged("AddTime"); - this.OnAddTimeChanged(); - } - } - } - - [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_Sort", DbType="Int")] - public System.Nullable Sort - { - get - { - return this._Sort; - } - set - { - if ((this._Sort != value)) - { - this.OnSortChanging(value); - this.SendPropertyChanging(); - this._Sort = value; - this.SendPropertyChanged("Sort"); - this.OnSortChanged(); - } - } - } - - 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.WPQ_WPQList")] public partial class WPQ_WPQList : INotifyPropertyChanging, INotifyPropertyChanged { diff --git a/SGGLPackFile.rar b/SGGLPackFile.rar new file mode 100644 index 00000000..2db99940 Binary files /dev/null and b/SGGLPackFile.rar differ