From 51d20396ea6da941622e71b310188c1db4b85f7a Mon Sep 17 00:00:00 2001 From: xiaju <1784803958@qq.com> Date: Sat, 14 Dec 2024 10:27:27 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E4=BA=A4=E5=AD=90=E8=A1=A8=E8=A1=A5?= =?UTF-8?q?=E5=85=85=E6=8E=92=E5=BA=8F=E5=BA=8F=E5=8F=B7SN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../版本日志/SUBQHSE_V2024-12-10-xiaj.sql | 18 --- .../版本日志/SUBQHSE_V2024-12-14-xiaj.sql | 61 +++++++++ .../Transfer/Chart/PunchlistFromChartNew.aspx | 2 +- .../Transfer/Chart/Systemstatus.aspx.cs | 2 +- .../Transfer/CivilStructure.aspx | 3 +- .../Transfer/CivilStructureDataIn.aspx.cs | 15 +++ .../Transfer/CivilStructureEdit.aspx | 2 + .../Transfer/CivilStructureEdit.aspx.cs | 12 ++ .../CivilStructureEdit.aspx.designer.cs | 9 ++ SGGL/FineUIPro.Web/Transfer/Electrical.aspx | 3 +- .../Transfer/ElectricalDataIn.aspx.cs | 15 +++ .../Transfer/ElectricalEdit.aspx | 2 + .../Transfer/ElectricalEdit.aspx.cs | 12 ++ .../Transfer/ElectricalEdit.aspx.designer.cs | 9 ++ .../Transfer/RotatingEquipment.aspx | 2 +- .../Transfer/RotatingEquipmentDataIn.aspx.cs | 15 +++ .../Transfer/RotatingEquipmentEdit.aspx | 2 + .../Transfer/RotatingEquipmentEdit.aspx.cs | 12 ++ .../RotatingEquipmentEdit.aspx.designer.cs | 9 ++ .../Transfer/StaticEquipment.aspx | 2 +- .../Transfer/StaticEquipmentDataIn.aspx.cs | 15 +++ .../Transfer/StaticEquipmentEdit.aspx | 2 + .../Transfer/StaticEquipmentEdit.aspx.cs | 12 ++ .../StaticEquipmentEdit.aspx.designer.cs | 9 ++ SGGL/FineUIPro.Web/Transfer/Telecom.aspx | 3 +- .../Transfer/TelecomDataIn.aspx.cs | 15 +++ SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx | 2 + .../Transfer/TelecomEdit.aspx.cs | 13 +- .../Transfer/TelecomEdit.aspx.designer.cs | 9 ++ SGGL/Model/Model.cs | 120 ++++++++++++++++++ 30 files changed, 381 insertions(+), 26 deletions(-) delete mode 100644 DataBase/版本日志/SUBQHSE_V2024-12-10-xiaj.sql create mode 100644 DataBase/版本日志/SUBQHSE_V2024-12-14-xiaj.sql diff --git a/DataBase/版本日志/SUBQHSE_V2024-12-10-xiaj.sql b/DataBase/版本日志/SUBQHSE_V2024-12-10-xiaj.sql deleted file mode 100644 index 181672c6..00000000 --- a/DataBase/版本日志/SUBQHSE_V2024-12-10-xiaj.sql +++ /dev/null @@ -1,18 +0,0 @@ - - ---SUBQHSE_V2024-12-10-xiaj - ---1ܵSNк -IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Transfer_Piping' AND COLUMN_NAME = 'SN') -BEGIN - ALTER TABLE Transfer_Piping ADD SN INT NOT NULL DEFAULT 1000; -END - -GO ---2DZSNк -IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Transfer_Instrumentation' AND COLUMN_NAME = 'SN') -BEGIN - ALTER TABLE Transfer_Instrumentation ADD SN INT NOT NULL DEFAULT 1000; -END - -GO \ No newline at end of file diff --git a/DataBase/版本日志/SUBQHSE_V2024-12-14-xiaj.sql b/DataBase/版本日志/SUBQHSE_V2024-12-14-xiaj.sql new file mode 100644 index 00000000..a2c8336b --- /dev/null +++ b/DataBase/版本日志/SUBQHSE_V2024-12-14-xiaj.sql @@ -0,0 +1,61 @@ + +--SUBQHSE_V2024-12-10-xiaj + +--1ܵSNк +IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Transfer_Piping' AND COLUMN_NAME = 'SN') +BEGIN + ALTER TABLE Transfer_Piping ADD SN INT NOT NULL DEFAULT 1000; +END + +GO +--2DZSNк +IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Transfer_Instrumentation' AND COLUMN_NAME = 'SN') +BEGIN + ALTER TABLE Transfer_Instrumentation ADD SN INT NOT NULL DEFAULT 1000; +END + +GO +--3豸SNк +IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Transfer_StaticEquipment' AND COLUMN_NAME = 'SN') +BEGIN + ALTER TABLE Transfer_StaticEquipment ADD SN INT NOT NULL DEFAULT 1000; +END + +GO + +--4豸SNк +IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Transfer_RotatingEquipment' AND COLUMN_NAME = 'SN') +BEGIN + ALTER TABLE Transfer_RotatingEquipment ADD SN INT NOT NULL DEFAULT 1000; +END + +GO + + +--5SNк +IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Transfer_Electrical' AND COLUMN_NAME = 'SN') +BEGIN + ALTER TABLE Transfer_Electrical ADD SN INT NOT NULL DEFAULT 1000; +END + +GO + + +--6SNк +IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Transfer_Civil_Structure' AND COLUMN_NAME = 'SN') +BEGIN + ALTER TABLE Transfer_Civil_Structure ADD SN INT NOT NULL DEFAULT 1000; +END + +GO + +--7űSNк +IF NOT EXISTS (SELECT 1 FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Transfer_Telecom' AND COLUMN_NAME = 'SN') +BEGIN + ALTER TABLE Transfer_Telecom ADD SN INT NOT NULL DEFAULT 1000; +END + +GO + + + diff --git a/SGGL/FineUIPro.Web/Transfer/Chart/PunchlistFromChartNew.aspx b/SGGL/FineUIPro.Web/Transfer/Chart/PunchlistFromChartNew.aspx index d7f7e6e4..ff9312a6 100644 --- a/SGGL/FineUIPro.Web/Transfer/Chart/PunchlistFromChartNew.aspx +++ b/SGGL/FineUIPro.Web/Transfer/Chart/PunchlistFromChartNew.aspx @@ -225,7 +225,7 @@ EnableRowDoubleClickEvent="true" EnableTextSelection="true" EnableSummary="true"> - + diff --git a/SGGL/FineUIPro.Web/Transfer/Chart/Systemstatus.aspx.cs b/SGGL/FineUIPro.Web/Transfer/Chart/Systemstatus.aspx.cs index 2622e81a..1e0790ee 100644 --- a/SGGL/FineUIPro.Web/Transfer/Chart/Systemstatus.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/Chart/Systemstatus.aspx.cs @@ -496,7 +496,7 @@ where f.ProjectId = @ProjectId "; float allcount = (list1.Count + list1.Count + list2.Count + list3.Count + list4.Count + list5.Count + list6.Count + list8.Count);//list7.Count + - float allScount = (list1.Where(x => x.FINALStatus == "Completed").ToList().Count + float allScount = (list1.Where(x => x.PressureTestCompleted == "Completed").ToList().Count + list1.Where(x => x.Reduction == "Completed").ToList().Count + list2.Where(x => x.MechanicalFINALStatus == "Completed").ToList().Count + list3.Where(x => x.MechanicalFINALStatus == "Completed").ToList().Count diff --git a/SGGL/FineUIPro.Web/Transfer/CivilStructure.aspx b/SGGL/FineUIPro.Web/Transfer/CivilStructure.aspx index 94d7de8a..f536c2dc 100644 --- a/SGGL/FineUIPro.Web/Transfer/CivilStructure.aspx +++ b/SGGL/FineUIPro.Web/Transfer/CivilStructure.aspx @@ -15,7 +15,8 @@ diff --git a/SGGL/FineUIPro.Web/Transfer/CivilStructureDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/CivilStructureDataIn.aspx.cs index e34360f4..64602a02 100644 --- a/SGGL/FineUIPro.Web/Transfer/CivilStructureDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/CivilStructureDataIn.aspx.cs @@ -306,6 +306,17 @@ namespace FineUIPro.Web.Transfer } string result = string.Empty; ir = pds.Rows.Count; + int Sn = 0; + //根据项目id查询sn + var snModel = Funs.DB.Transfer_Civil_Structure.Where(x => x.ProjectId == CurrUser.LoginProjectId).OrderByDescending(x => x.SN).FirstOrDefault(); + if (snModel == null && Sn == 0) + { + Sn = 1000; + } + else + { + Sn = snModel.SN; + } if (pds != null && ir > 0) { List list = new List(); @@ -323,6 +334,10 @@ namespace FineUIPro.Web.Transfer model.Descriptions= pds.Rows[i][1].ToString().Trim(); model.Id = Guid.NewGuid().ToString(); model.ProjectId = CurrUser.LoginProjectId; + + Sn += 1; + model.SN = Sn; + model.Civil_Structure = pds.Rows[i][0].ToString().Trim(); model.SystemName = pds.Rows[i][2].ToString().Trim(); model.Subsystem = pds.Rows[i][3].ToString().Trim(); diff --git a/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx b/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx index 3c8b6f6f..4f5c2316 100644 --- a/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx +++ b/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx @@ -19,6 +19,8 @@ + + diff --git a/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx.cs b/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx.cs index c5fbc48c..6c2142d9 100644 --- a/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx.cs @@ -50,6 +50,7 @@ namespace FineUIPro.Web.Transfer var model = Funs.DB.Transfer_Civil_Structure.FirstOrDefault(x => x.Id == Id); if (model != null) { + txtSN.Text = model.SN.ToString(); txtCivil_Structure.Text = model.Civil_Structure; txtSystemName.Text = model.SystemName; txtSubsystem.Text = model.Subsystem; @@ -66,6 +67,14 @@ namespace FineUIPro.Web.Transfer txtDescriptions.Text = model.Descriptions; } } + else + { + var model = Funs.DB.Transfer_Civil_Structure.OrderByDescending(x => x.SN).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId); + if (model == null) + txtSN.Text = "1001"; + else + txtSN.Text = (model.SN + 1).ToString(); + } } } @@ -73,6 +82,7 @@ namespace FineUIPro.Web.Transfer { var model = new Model.Transfer_Civil_Structure { + SN = Convert.ToInt32(txtSN.Text), ProjectId = ProjectId, Civil_Structure = txtCivil_Structure.Text, SystemName = txtSystemName.Text, @@ -120,11 +130,13 @@ namespace FineUIPro.Web.Transfer } #endregion + if (!string.IsNullOrEmpty(Id)) { var newModel = Funs.DB.Transfer_Civil_Structure.FirstOrDefault(x => x.Id == Id); if (newModel != null) { + newModel.SN = model.SN; newModel.Civil_Structure = txtCivil_Structure.Text; newModel.SystemName = txtSystemName.Text; newModel.Subsystem = txtSubsystem.Text; diff --git a/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx.designer.cs index 0f983004..23ac7fc0 100644 --- a/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Transfer/CivilStructureEdit.aspx.designer.cs @@ -50,6 +50,15 @@ namespace FineUIPro.Web.Transfer /// protected global::FineUIPro.TextBox txtCivil_Structure; + /// + /// txtSN 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSN; + /// /// txtSystemName 控件。 /// diff --git a/SGGL/FineUIPro.Web/Transfer/Electrical.aspx b/SGGL/FineUIPro.Web/Transfer/Electrical.aspx index 58f90083..99f53b37 100644 --- a/SGGL/FineUIPro.Web/Transfer/Electrical.aspx +++ b/SGGL/FineUIPro.Web/Transfer/Electrical.aspx @@ -15,7 +15,8 @@ diff --git a/SGGL/FineUIPro.Web/Transfer/ElectricalDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/ElectricalDataIn.aspx.cs index e4bc345b..133c676c 100644 --- a/SGGL/FineUIPro.Web/Transfer/ElectricalDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/ElectricalDataIn.aspx.cs @@ -305,6 +305,17 @@ namespace FineUIPro.Web.Transfer } string result = string.Empty; ir = pds.Rows.Count; + int Sn = 0; + //根据项目id查询sn + var snModel = Funs.DB.Transfer_Electrical.Where(x => x.ProjectId == CurrUser.LoginProjectId).OrderByDescending(x => x.SN).FirstOrDefault(); + if (snModel == null && Sn == 0) + { + Sn = 1000; + } + else + { + Sn = snModel.SN; + } if (pds != null && ir > 0) { List list = new List(); @@ -321,6 +332,10 @@ namespace FineUIPro.Web.Transfer model.Descriptions= pds.Rows[i][1].ToString().Trim(); model.Id = Guid.NewGuid().ToString(); model.ProjectId = CurrUser.LoginProjectId; + + Sn += 1; + model.SN = Sn; + model.ELECTRICAL = pds.Rows[i][0].ToString().Trim(); model.SystemName = pds.Rows[i][1+1].ToString().Trim(); model.Subsystem = pds.Rows[i][2 + 1].ToString().Trim(); diff --git a/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx b/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx index 87cbba0e..19c6efa4 100644 --- a/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx +++ b/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx @@ -19,6 +19,8 @@ + + diff --git a/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx.cs b/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx.cs index 34bc6cd7..86662b60 100644 --- a/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx.cs @@ -51,6 +51,7 @@ namespace FineUIPro.Web.Transfer var model = Funs.DB.Transfer_Electrical.FirstOrDefault(x => x.Id == Id); if (model != null) { + txtSN.Text = model.SN.ToString(); txtELECTRICAL.Text = model.ELECTRICAL; txtSystemName.Text = model.SystemName; txtSubsystem.Text = model.Subsystem; @@ -62,6 +63,14 @@ namespace FineUIPro.Web.Transfer txtDescriptions.Text = model.Descriptions; } } + else + { + var model = Funs.DB.Transfer_Electrical.OrderByDescending(x => x.SN).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId); + if (model == null) + txtSN.Text = "1001"; + else + txtSN.Text = (model.SN + 1).ToString(); + } } } @@ -69,6 +78,7 @@ namespace FineUIPro.Web.Transfer { var model = new Model.Transfer_Electrical { + SN = Convert.ToInt32(txtSN.Text), ProjectId = ProjectId, ELECTRICAL = txtELECTRICAL.Text, SystemName = txtSystemName.Text, @@ -107,11 +117,13 @@ namespace FineUIPro.Web.Transfer } #endregion + if (!string.IsNullOrEmpty(Id)) { var newModel = Funs.DB.Transfer_Electrical.FirstOrDefault(x => x.Id == Id); if (newModel != null) { + newModel.SN = model.SN; newModel.ELECTRICAL = txtELECTRICAL.Text; newModel.SystemName = txtSystemName.Text; newModel.Subsystem = txtSubsystem.Text; diff --git a/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx.designer.cs index 48423c34..9893e575 100644 --- a/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Transfer/ElectricalEdit.aspx.designer.cs @@ -50,6 +50,15 @@ namespace FineUIPro.Web.Transfer /// protected global::FineUIPro.TextBox txtELECTRICAL; + /// + /// txtSN 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSN; + /// /// txtSystemName 控件。 /// diff --git a/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx b/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx index 4cdc7d6e..3602af81 100644 --- a/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx +++ b/SGGL/FineUIPro.Web/Transfer/RotatingEquipment.aspx @@ -15,7 +15,7 @@ diff --git a/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx.cs index 8c97a5f1..7b6c877f 100644 --- a/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentDataIn.aspx.cs @@ -302,6 +302,17 @@ namespace FineUIPro.Web.Transfer } string result = string.Empty; ir = pds.Rows.Count; + int Sn = 0; + //根据项目id查询sn + var snModel = Funs.DB.Transfer_RotatingEquipment.Where(x => x.ProjectId == CurrUser.LoginProjectId).OrderByDescending(x => x.SN).FirstOrDefault(); + if (snModel == null && Sn == 0) + { + Sn = 1000; + } + else + { + Sn = snModel.SN; + } if (pds != null && ir > 0) { List list = new List(); @@ -317,6 +328,10 @@ namespace FineUIPro.Web.Transfer model.Id = Guid.NewGuid().ToString(); model.ProjectId = CurrUser.LoginProjectId; + + Sn += 1; + model.SN = Sn; + model.RotatingEquipment = pds.Rows[i][0].ToString().Trim(); model.SYSTEM = pds.Rows[i][1+1].ToString().Trim(); model.Subsystem = pds.Rows[i][2 + 1].ToString().Trim(); diff --git a/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx index 2aa5c474..89be1eda 100644 --- a/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx +++ b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx @@ -19,6 +19,8 @@ + + diff --git a/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx.cs b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx.cs index 83f7a869..d0f73a2b 100644 --- a/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx.cs @@ -50,6 +50,7 @@ namespace FineUIPro.Web.Transfer var model = Funs.DB.Transfer_RotatingEquipment.FirstOrDefault(x => x.Id == Id); if (model != null) { + txtSN.Text = model.SN.ToString(); txtRotatingEquipment.Text = model.RotatingEquipment; txtSYSTEM.Text = model.SYSTEM; txtSubsystem.Text = model.Subsystem; @@ -61,6 +62,14 @@ namespace FineUIPro.Web.Transfer txtDescriptions.Text = model.Descriptions; } } + else + { + var model = Funs.DB.Transfer_RotatingEquipment.OrderByDescending(x => x.SN).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId); + if (model == null) + txtSN.Text = "1001"; + else + txtSN.Text = (model.SN + 1).ToString(); + } } } @@ -68,6 +77,7 @@ namespace FineUIPro.Web.Transfer { var model = new Model.Transfer_RotatingEquipment { + SN = Convert.ToInt32(txtSN.Text), ProjectId = ProjectId, RotatingEquipment = txtRotatingEquipment.Text, SYSTEM = txtSYSTEM.Text, @@ -104,11 +114,13 @@ namespace FineUIPro.Web.Transfer } #endregion + if (!string.IsNullOrEmpty(Id)) { var newModel = Funs.DB.Transfer_RotatingEquipment.FirstOrDefault(x => x.Id == Id); if (newModel != null) { + newModel.SN = model.SN; newModel.RotatingEquipment = txtRotatingEquipment.Text; newModel.SYSTEM = txtSYSTEM.Text; newModel.Subsystem = txtSubsystem.Text; diff --git a/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx.designer.cs index b49e65a9..aca9be22 100644 --- a/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Transfer/RotatingEquipmentEdit.aspx.designer.cs @@ -50,6 +50,15 @@ namespace FineUIPro.Web.Transfer /// protected global::FineUIPro.TextBox txtRotatingEquipment; + /// + /// txtSN 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSN; + /// /// txtSYSTEM 控件。 /// diff --git a/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx b/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx index ad5e4d9a..0ff017f4 100644 --- a/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx +++ b/SGGL/FineUIPro.Web/Transfer/StaticEquipment.aspx @@ -15,7 +15,7 @@ diff --git a/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx.cs index 82e5ff7e..b6d735f3 100644 --- a/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentDataIn.aspx.cs @@ -302,6 +302,17 @@ namespace FineUIPro.Web.Transfer } string result = string.Empty; ir = pds.Rows.Count; + int Sn = 0; + //根据项目id查询sn + var snModel = Funs.DB.Transfer_StaticEquipment.Where(x => x.ProjectId == CurrUser.LoginProjectId).OrderByDescending(x => x.SN).FirstOrDefault(); + if (snModel == null && Sn == 0) + { + Sn = 1000; + } + else + { + Sn = snModel.SN; + } if (pds != null && ir > 0) { List list = new List(); @@ -316,6 +327,10 @@ namespace FineUIPro.Web.Transfer model.Descriptions= pds.Rows[i][1].ToString().Trim(); model.Id = Guid.NewGuid().ToString(); model.ProjectId = CurrUser.LoginProjectId; + + Sn += 1; + model.SN = Sn; + model.StaticEquipment = pds.Rows[i][0].ToString().Trim(); model.SYSTEM = pds.Rows[i][1+1].ToString().Trim(); model.Subsystem = pds.Rows[i][2 + 1].ToString().Trim(); diff --git a/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx index 868e9377..55a8b5fa 100644 --- a/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx +++ b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx @@ -19,6 +19,8 @@ + + diff --git a/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx.cs b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx.cs index d6f8bf0a..4c9ed7ec 100644 --- a/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx.cs @@ -51,6 +51,7 @@ namespace FineUIPro.Web.Transfer var model = Funs.DB.Transfer_StaticEquipment.FirstOrDefault(x => x.Id == Id); if (model != null) { + txtSN.Text = model.SN.ToString(); txtStaticEquipment.Text = model.StaticEquipment; txtSYSTEM.Text = model.SYSTEM; txtSubsystem.Text = model.Subsystem; @@ -61,6 +62,14 @@ namespace FineUIPro.Web.Transfer txtDescriptions.Text = model.Descriptions; } } + else + { + var model = Funs.DB.Transfer_StaticEquipment.OrderByDescending(x => x.SN).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId); + if (model == null) + txtSN.Text = "1001"; + else + txtSN.Text = (model.SN + 1).ToString(); + } } } @@ -68,6 +77,7 @@ namespace FineUIPro.Web.Transfer { var model = new Model.Transfer_StaticEquipment { + SN = Convert.ToInt32(txtSN.Text), ProjectId = ProjectId, StaticEquipment = txtStaticEquipment.Text, SYSTEM = txtSYSTEM.Text, @@ -103,12 +113,14 @@ namespace FineUIPro.Web.Transfer } #endregion + if (!string.IsNullOrEmpty(Id)) { var newModel = Funs.DB.Transfer_StaticEquipment.FirstOrDefault(x => x.Id == Id); if (newModel != null) { newModel.StaticEquipment = txtStaticEquipment.Text; + newModel.SN = model.SN; newModel.SYSTEM = txtSYSTEM.Text; newModel.Subsystem = txtSubsystem.Text; newModel.TestPackage = txtTestPackage.Text; diff --git a/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx.designer.cs index f642a070..e3097cca 100644 --- a/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Transfer/StaticEquipmentEdit.aspx.designer.cs @@ -50,6 +50,15 @@ namespace FineUIPro.Web.Transfer /// protected global::FineUIPro.TextBox txtStaticEquipment; + /// + /// txtSN 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSN; + /// /// txtSYSTEM 控件。 /// diff --git a/SGGL/FineUIPro.Web/Transfer/Telecom.aspx b/SGGL/FineUIPro.Web/Transfer/Telecom.aspx index 341571ab..4929e139 100644 --- a/SGGL/FineUIPro.Web/Transfer/Telecom.aspx +++ b/SGGL/FineUIPro.Web/Transfer/Telecom.aspx @@ -15,7 +15,8 @@ diff --git a/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs b/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs index 627f081d..6d9b27dc 100644 --- a/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/TelecomDataIn.aspx.cs @@ -306,6 +306,17 @@ namespace FineUIPro.Web.Transfer } string result = string.Empty; ir = pds.Rows.Count; + int Sn = 0; + //根据项目id查询sn + var snModel = Funs.DB.Transfer_Telecom.Where(x => x.ProjectId == CurrUser.LoginProjectId).OrderByDescending(x => x.SN).FirstOrDefault(); + if (snModel == null && Sn == 0) + { + Sn = 1000; + } + else + { + Sn = snModel.SN; + } if (pds != null && ir > 0) { List list = new List(); @@ -322,6 +333,10 @@ namespace FineUIPro.Web.Transfer model.Descriptions = pds.Rows[i][1].ToString().Trim(); model.Id = Guid.NewGuid().ToString(); model.ProjectId = CurrUser.LoginProjectId; + + Sn += 1; + model.SN = Sn; + model.Telecom = pds.Rows[i][0].ToString().Trim(); model.SystemName = pds.Rows[i][1+1].ToString().Trim(); model.Subsystem = pds.Rows[i][2 + 1].ToString().Trim(); diff --git a/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx b/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx index 149dd1c0..48174a64 100644 --- a/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx +++ b/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx @@ -19,6 +19,8 @@ + + diff --git a/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx.cs b/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx.cs index a389378f..c5ffac8f 100644 --- a/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx.cs +++ b/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx.cs @@ -50,6 +50,7 @@ namespace FineUIPro.Web.Transfer var model = Funs.DB.Transfer_Telecom.FirstOrDefault(x => x.Id == Id); if (model != null) { + txtSN.Text = model.SN.ToString(); txtTelecom.Text = model.Telecom; txtSystemName.Text = model.SystemName; txtSubsystem.Text = model.Subsystem; @@ -61,6 +62,14 @@ namespace FineUIPro.Web.Transfer txtDescriptions.Text = model.Descriptions; } } + else + { + var model = Funs.DB.Transfer_Telecom.OrderByDescending(x => x.SN).FirstOrDefault(x => x.ProjectId == CurrUser.LoginProjectId); + if (model == null) + txtSN.Text = "1001"; + else + txtSN.Text = (model.SN + 1).ToString(); + } } } @@ -68,6 +77,7 @@ namespace FineUIPro.Web.Transfer { var model = new Model.Transfer_Telecom { + SN = Convert.ToInt32(txtSN.Text), ProjectId = ProjectId, Telecom = txtTelecom.Text, SystemName = txtSystemName.Text, @@ -78,7 +88,6 @@ namespace FineUIPro.Web.Transfer CableLaying = ddlCableLaying.SelectedValue, FunctionTest = ddlFunctionTest.SelectedValue, Descriptions= txtDescriptions.Text, - }; #region 判断状态 @@ -105,11 +114,13 @@ namespace FineUIPro.Web.Transfer } #endregion + if (!string.IsNullOrEmpty(Id)) { var newModel = Funs.DB.Transfer_Telecom.FirstOrDefault(x => x.Id == Id); if (newModel != null) { + newModel.SN = model.SN; newModel.Telecom = txtTelecom.Text; newModel.SystemName = txtSystemName.Text; newModel.Subsystem = txtSubsystem.Text; diff --git a/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx.designer.cs b/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx.designer.cs index 2f62c028..aed5af95 100644 --- a/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx.designer.cs +++ b/SGGL/FineUIPro.Web/Transfer/TelecomEdit.aspx.designer.cs @@ -50,6 +50,15 @@ namespace FineUIPro.Web.Transfer /// protected global::FineUIPro.TextBox txtTelecom; + /// + /// txtSN 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.NumberBox txtSN; + /// /// txtSystemName 控件。 /// diff --git a/SGGL/Model/Model.cs b/SGGL/Model/Model.cs index 15448282..2049c257 100644 --- a/SGGL/Model/Model.cs +++ b/SGGL/Model/Model.cs @@ -394514,6 +394514,8 @@ namespace Model private string _Descriptions; + private int _SN; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -394556,6 +394558,8 @@ namespace Model partial void OnHVACChanged(); partial void OnDescriptionsChanging(string value); partial void OnDescriptionsChanged(); + partial void OnSNChanging(int value); + partial void OnSNChanged(); #endregion public Transfer_Civil_Structure() @@ -394943,6 +394947,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SN", DbType="Int NOT NULL")] + public int SN + { + get + { + return this._SN; + } + set + { + if ((this._SN != value)) + { + this.OnSNChanging(value); + this.SendPropertyChanging(); + this._SN = value; + this.SendPropertyChanged("SN"); + this.OnSNChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -395000,6 +395024,8 @@ namespace Model private string _Descriptions; + private int _SN; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -395034,6 +395060,8 @@ namespace Model partial void OnLoopTestChanged(); partial void OnDescriptionsChanging(string value); partial void OnDescriptionsChanged(); + partial void OnSNChanging(int value); + partial void OnSNChanged(); #endregion public Transfer_Electrical() @@ -395341,6 +395369,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SN", DbType="Int NOT NULL")] + public int SN + { + get + { + return this._SN; + } + set + { + if ((this._SN != value)) + { + this.OnSNChanging(value); + this.SendPropertyChanging(); + this._SN = value; + this.SendPropertyChanged("SN"); + this.OnSNChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -399470,6 +399518,8 @@ namespace Model private string _Lubricatefilling; + private int _SN; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -399504,6 +399554,8 @@ namespace Model partial void OnDescriptionsChanged(); partial void OnLubricatefillingChanging(string value); partial void OnLubricatefillingChanged(); + partial void OnSNChanging(int value); + partial void OnSNChanged(); #endregion public Transfer_RotatingEquipment() @@ -399811,6 +399863,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SN", DbType="Int NOT NULL")] + public int SN + { + get + { + return this._SN; + } + set + { + if ((this._SN != value)) + { + this.OnSNChanging(value); + this.SendPropertyChanging(); + this._SN = value; + this.SendPropertyChanged("SN"); + this.OnSNChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -399866,6 +399938,8 @@ namespace Model private string _Descriptions; + private int _SN; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -399898,6 +399972,8 @@ namespace Model partial void OnBOXupRecordChanged(); partial void OnDescriptionsChanging(string value); partial void OnDescriptionsChanged(); + partial void OnSNChanging(int value); + partial void OnSNChanged(); #endregion public Transfer_StaticEquipment() @@ -400185,6 +400261,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SN", DbType="Int NOT NULL")] + public int SN + { + get + { + return this._SN; + } + set + { + if ((this._SN != value)) + { + this.OnSNChanging(value); + this.SendPropertyChanging(); + this._SN = value; + this.SendPropertyChanged("SN"); + this.OnSNChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -400846,6 +400942,8 @@ namespace Model private string _Descriptions; + private int _SN; + #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -400880,6 +400978,8 @@ namespace Model partial void OnFunctionTestChanged(); partial void OnDescriptionsChanging(string value); partial void OnDescriptionsChanged(); + partial void OnSNChanging(int value); + partial void OnSNChanged(); #endregion public Transfer_Telecom() @@ -401187,6 +401287,26 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_SN", DbType="Int NOT NULL")] + public int SN + { + get + { + return this._SN; + } + set + { + if ((this._SN != value)) + { + this.OnSNChanging(value); + this.SendPropertyChanging(); + this._SN = value; + this.SendPropertyChanged("SN"); + this.OnSNChanged(); + } + } + } + public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged;