diff --git a/DataBase/版本日志/HJGLDB_DS_2026-02-23_bwj.sql b/DataBase/版本日志/HJGLDB_DS_2026-02-23_bwj.sql new file mode 100644 index 0000000..f173a3d --- /dev/null +++ b/DataBase/版本日志/HJGLDB_DS_2026-02-23_bwj.sql @@ -0,0 +1,12 @@ +ALTER TABLE [dbo].[JGZL_BlowingCleaningItem] DROP CONSTRAINT [FK_JGZL_BlowingCleaningItem_HJGL_PW_IsoInfo] +GO +ALTER TABLE [dbo].[JGZL_BlowingCleaningItem] DROP CONSTRAINT [FK_JGZL_BlowingCleaningItem_HJGL_BS_Steel] +GO + +alter table JGZL_BlowingCleaning add CheckReulst1 nvarchar(10) +alter table JGZL_BlowingCleaning add CheckReulst2 nvarchar(10) +alter table JGZL_BlowingCleaning add CheckReulst3 nvarchar(10) +alter table JGZL_BlowingCleaning add CheckReulst4 nvarchar(10) +go + + diff --git a/HJGLPackFile.zip b/HJGLPackFile.zip deleted file mode 100644 index 469679e..0000000 Binary files a/HJGLPackFile.zip and /dev/null differ diff --git a/HJGLPackFile/PackFile/JGZL/TeamWeldingInspection.aspx b/HJGLPackFile/PackFile/JGZL/TeamWeldingInspection.aspx deleted file mode 100644 index dcdbd56..0000000 --- a/HJGLPackFile/PackFile/JGZL/TeamWeldingInspection.aspx +++ /dev/null @@ -1,233 +0,0 @@ -<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TeamWeldingInspection.aspx.cs" Inherits="FineUIPro.Web.JGZL.TeamWeldingInspection" %> - - - - - - - 支管连接焊接接头、角焊接头组对焊接检查记录 - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <%-- - - --%> - <%-- - - - - - - - - - - - --%> - - - - - - <%----%> - - <%-- - - - - - --%> - - <%----%> - - diff --git a/HJGL_DS/BLL/JGZL/BlowingCleaningItemService.cs b/HJGL_DS/BLL/JGZL/BlowingCleaningItemService.cs index 3cb1b20..e29c1a4 100644 --- a/HJGL_DS/BLL/JGZL/BlowingCleaningItemService.cs +++ b/HJGL_DS/BLL/JGZL/BlowingCleaningItemService.cs @@ -129,5 +129,13 @@ namespace BLL } return returnViewMatch; } + + public static Model.JGZL_BlowingCleaningItem GetItemByIsoNo(string projectId, string isoNo) + { + return (from x in Funs.DB.JGZL_BlowingCleaningItem + join y in Funs.DB.JGZL_BlowingCleaning on x.BlowingCleaningId equals y.BlowingCleaningId + where y.ProjectId == projectId && x.ISO_Id == isoNo + select x).FirstOrDefault(); + } } } diff --git a/HJGL_DS/BLL/JGZL/BlowingCleaningService.cs b/HJGL_DS/BLL/JGZL/BlowingCleaningService.cs index 0559e4e..87ccae5 100644 --- a/HJGL_DS/BLL/JGZL/BlowingCleaningService.cs +++ b/HJGL_DS/BLL/JGZL/BlowingCleaningService.cs @@ -19,6 +19,17 @@ namespace BLL return Funs.DB.JGZL_BlowingCleaning.FirstOrDefault(e => e.BlowingCleaningId == blowingCleaningId); } + /// + /// 根据项目Id获取吹扫/清洗检验记录 + /// + /// + /// + public static Model.JGZL_BlowingCleaning GetBlowingCleaningByProjectId(string projectId) + { + return Funs.DB.JGZL_BlowingCleaning.FirstOrDefault(e => e.ProjectId == projectId); + } + + /// /// 添加吹扫/清洗检验记录 /// @@ -35,6 +46,10 @@ namespace BLL newBlowingCleaning.Results = blowingCleaning.Results; newBlowingCleaning.CompileMan = blowingCleaning.CompileMan; newBlowingCleaning.CompileDate = blowingCleaning.CompileDate; + newBlowingCleaning.CheckReulst1 = blowingCleaning.CheckReulst1; + newBlowingCleaning.CheckReulst2 = blowingCleaning.CheckReulst2; + newBlowingCleaning.CheckReulst3 = blowingCleaning.CheckReulst3; + newBlowingCleaning.CheckReulst4 = blowingCleaning.CheckReulst4; db.JGZL_BlowingCleaning.InsertOnSubmit(newBlowingCleaning); db.SubmitChanges(); } @@ -53,6 +68,10 @@ namespace BLL newBlowingCleaning.SystemName = blowingCleaning.SystemName; newBlowingCleaning.SystemCode = blowingCleaning.SystemCode; newBlowingCleaning.Results = blowingCleaning.Results; + newBlowingCleaning.CheckReulst1 = blowingCleaning.CheckReulst1; + newBlowingCleaning.CheckReulst2 = blowingCleaning.CheckReulst2; + newBlowingCleaning.CheckReulst3 = blowingCleaning.CheckReulst3; + newBlowingCleaning.CheckReulst4 = blowingCleaning.CheckReulst4; db.SubmitChanges(); } } diff --git a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemConfirmationRecordService.cs b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemConfirmationRecordService.cs index 01e71e3..e2d9a39 100644 --- a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemConfirmationRecordService.cs +++ b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemConfirmationRecordService.cs @@ -16,6 +16,16 @@ namespace BLL return Funs.DB.JGZL_PressureTestOfPipelineSystemConfirmationRecord.FirstOrDefault(e => e.RecordId == recordId); } + /// + /// 根据项目Id获取管道系统压力试验条件确认记录 + /// + /// + /// + public static Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord GetPressureTestOfPipelineSystemConfirmationRecordByProjectId(string projectId) + { + return Funs.DB.JGZL_PressureTestOfPipelineSystemConfirmationRecord.FirstOrDefault(e => e.ProjectId == projectId); + } + /// /// 添加管道系统压力试验条件确认记录 /// @@ -90,5 +100,20 @@ namespace BLL db.SubmitChanges(); } } + + /// + /// 根据项目Id删除管道系统压力试验条件确认记录 + /// + /// + public static void DeletePressureTestOfPipelineSystemConfirmationRecordByProjectId(string projectId) + { + SGGLDB db = Funs.DB; + var q = (from x in db.JGZL_PressureTestOfPipelineSystemConfirmationRecord where x.ProjectId==projectId select x).ToList(); + if (q != null) + { + db.JGZL_PressureTestOfPipelineSystemConfirmationRecord.DeleteAllOnSubmit(q); + db.SubmitChanges(); + } + } } } \ No newline at end of file diff --git a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordItemService.cs b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordItemService.cs index 89ebc69..d34383e 100644 --- a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordItemService.cs +++ b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordItemService.cs @@ -17,6 +17,14 @@ namespace BLL return Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem.FirstOrDefault(e => e.Id == Id); } + public static Model.JGZL_PressureTestOfPipelineSystemRecordItem GetItemByIsoNo(string projectId,string isoNo) + { + return (from x in Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem + join y in Funs.DB.JGZL_PressureTestOfPipelineSystemRecord on x.RecordId equals y.RecordId + where y.ProjectId == projectId && x.PipelineNo == isoNo + select x).FirstOrDefault(); + } + /// /// 根据主键获取管道系统压力试验记录子表 diff --git a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs index 54fcbbc..be6df3f 100644 --- a/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs +++ b/HJGL_DS/BLL/JGZL/PressureTestOfPipelineSystemRecordService.cs @@ -16,6 +16,16 @@ namespace BLL return Funs.DB.JGZL_PressureTestOfPipelineSystemRecord.FirstOrDefault(e => e.RecordId == recordId); } + /// + /// 根据项目Id获取管道系统压力试验记录 + /// + /// + /// + public static Model.JGZL_PressureTestOfPipelineSystemRecord GetPressureTestOfPipelineSystemRecordByProjectId(string projectId) + { + return Funs.DB.JGZL_PressureTestOfPipelineSystemRecord.FirstOrDefault(e => e.ProjectId == projectId); + } + /// /// 添加管道系统压力试验记录 /// diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道吹扫、清洗检验记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道吹扫、清洗检验记录.frx index 58ae040..7ea17c4 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道吹扫、清洗检验记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道吹扫、清洗检验记录.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,13 +42,17 @@ namespace FastReport } - + + + + + @@ -59,17 +63,17 @@ namespace FastReport - - - - - - - - + + + + + + + + - + @@ -84,14 +88,14 @@ namespace FastReport - - - - - - - - + + + + + + + + @@ -116,8 +120,8 @@ namespace FastReport - - + + @@ -125,8 +129,8 @@ namespace FastReport - - + + @@ -134,8 +138,8 @@ namespace FastReport - - + + @@ -143,8 +147,8 @@ namespace FastReport - - + + @@ -157,15 +161,15 @@ namespace FastReport - - - - - - - - - + + + + + + + + + @@ -177,16 +181,16 @@ namespace FastReport - - - - - - - - - - + + + + + + + + + + @@ -199,11 +203,11 @@ namespace FastReport - - - - - + + + + + @@ -214,7 +218,7 @@ namespace FastReport - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道焊口射线检测报告.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道焊口射线检测报告.frx index 2c32a5c..2b404a0 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道焊口射线检测报告.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道焊口射线检测报告.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -63,7 +63,7 @@ namespace FastReport } - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验条件确认记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验条件确认记录.frx index 5800084..ee993ba 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验条件确认记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验条件确认记录.frx @@ -1,5 +1,5 @@  - + @@ -18,7 +18,7 @@ - + @@ -55,11 +55,11 @@ - - + + - - + + @@ -130,14 +130,14 @@ - + - + diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验记录.frx index 3732b49..db48ad6 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道系统压力试验记录.frx @@ -1,5 +1,5 @@  - + using System; using System.Collections; using System.Collections.Generic; @@ -42,7 +42,7 @@ namespace FastReport } - + @@ -60,20 +60,20 @@ namespace FastReport - - - - - - - - - + + + + + + + + + - - + + @@ -96,16 +96,16 @@ namespace FastReport - - - - - - - - - - + + + + + + + + + + @@ -129,16 +129,16 @@ namespace FastReport - - - - - - - - - - + + + + + + + + + + @@ -151,17 +151,17 @@ namespace FastReport - - - - - - - - - - - + + + + + + + + + + + @@ -175,17 +175,17 @@ namespace FastReport - - - - - + + + + + - + diff --git a/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx b/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx index 19ddd59..6f68b80 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx +++ b/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx @@ -37,37 +37,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EnableTextSelection="True" AutoScroll="true" OnPreDataBound="Grid1_PreDataBound"> - - + + + + - + + + + - + + + + + + + + + + + + + + + + + - - - @@ -86,30 +142,10 @@ - - - - - - - - diff --git a/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx.cs b/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx.cs index ee39e1d..0b594e8 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx.cs @@ -8,11 +8,65 @@ using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.IO; +using Newtonsoft.Json.Linq; +using Model; namespace FineUIPro.Web.JGZL { public partial class BlowingCleaning : PageBase { + #region 定义项 + /// + /// 主键 + /// + private string BlowingCleaningItemId + { + get + { + return (string)ViewState["BlowingCleaningItemId"]; + } + set + { + ViewState["BlowingCleaningItemId"] = value; + } + } + + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 外键—BlowingCleaningId + /// + public string BlowingCleaningId + { + get + { + return (string)ViewState["BlowingCleaningId"]; + } + set + { + ViewState["BlowingCleaningId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List itemLists = new List(); + #endregion + #region 加载页面 /// /// 加载页面 @@ -34,9 +88,90 @@ namespace FineUIPro.Web.JGZL this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; this.InitTreeMenu();//加载树 this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; - this.BindGrid(); + this.ProjectId = this.tvControlItem.SelectedNodeID; + + var record = BLL.BlowingCleaningService.GetBlowingCleaningByProjectId(this.tvControlItem.SelectedNodeID); + if (record != null) + { + this.BlowingCleaningId = record.BlowingCleaningId; + this.txtSystemName.Text = record.SystemName; + this.txtSystemCode.Text = record.SystemCode; + } + + //管线下拉选择 + var isoLists = (from x in Funs.DB.JGZL_BlowingCleaningItem + where x.BlowingCleaningId == this.BlowingCleaningId + select x.ISO_Id).Distinct().ToList(); + this.drpIsoNoS.Items.Clear(); + this.drpIsoNoS.DataTextField = "ISO_Id"; + this.drpIsoNoS.DataValueField = "ISO_Id"; + this.drpIsoNoS.DataSource = isoLists; + this.drpIsoNoS.DataBind(); + Funs.FineUIPleaseSelect(this.drpIsoNoS); + this.drpIsoNoS.SelectedIndex = 0; + + DataIsoInfo(); } } + + private void DataIsoInfo() + { + this.txtSystemCode.Text = string.Empty; + this.txtSystemName.Text = string.Empty; + this.txtCheckResult1.Text = string.Empty; + this.txtCheckResult2.Text = string.Empty; + this.txtCheckResult3.Text = string.Empty; + this.txtCheckResult4.Text = string.Empty; + itemLists.Clear(); + if (!string.IsNullOrEmpty(this.ProjectId)) + { + var record = BLL.BlowingCleaningService.GetBlowingCleaningByProjectId(this.ProjectId); + if (record != null) + { + this.BlowingCleaningId = record.BlowingCleaningId; + this.txtSystemCode.Text = record.SystemCode; + this.txtSystemName.Text = record.SystemName; + this.txtCheckResult1.Text = record.CheckReulst1; + this.txtCheckResult2.Text = record.CheckReulst2; + this.txtCheckResult3.Text = record.CheckReulst3; + this.txtCheckResult4.Text = record.CheckReulst4; + itemLists = BLL.BlowingCleaningItemService.GetBlowingCleaningItemList(this.BlowingCleaningId); + } + else + { + //var pro = BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId); + //if (pro != null) + //{ + // this.txtProjectCode.Text = pro.ProjectCode; + // this.txtProjectName.Text = pro.ProjectName; + //} + } + var isoInfos = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + foreach (var item in isoInfos) + { + var teamWeldingInspectionItem = BLL.BlowingCleaningItemService.GetItemByIsoNo(this.ProjectId, item.ISO_IsoNo); + if (teamWeldingInspectionItem != null) + { + //itemLists.Add(teamWeldingInspectionItem); + } + else + { + Model.JGZL_BlowingCleaningItem newItem = new JGZL_BlowingCleaningItem(); + newItem.BlowingCleaningItemId = SQLHelper.GetNewID(typeof(Model.JGZL_BlowingCleaningItem)); + newItem.ISO_Id = item.ISO_IsoNo; + newItem.STE_ID = BLL.HJGL_MaterialService.GetSteelBySteID(item.STE_ID).STE_Code; + //newItem.OperatingMedium = item.OperatingPressure; + itemLists.Add(newItem); + } + } + if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue) && this.drpIsoNoS.SelectedValue != BLL.Const._Null) + { + itemLists = itemLists.Where(e => e.ISO_Id.Contains(this.drpIsoNoS.SelectedValue)).ToList(); ; + } + } + this.Grid1.DataSource = itemLists; + this.Grid1.DataBind(); + } #endregion #region 加载树项目 @@ -94,11 +229,11 @@ namespace FineUIPro.Web.JGZL private void BindGrid() { //string projectIds = BLL.Base_ProjectService.GetStrOnProjectIds(this.CurrUser.UserId, "1"); - string strSql = @"SELECT * from JGZL_BlowingCleaning where 1=1"; + string strSql = @"SELECT * from JGZL_BlowingCleaningItem m left join JGZL_BlowingCleaning b on b.BlowingCleaningId = m.BlowingCleaningId where 1=1"; List listStr = new List(); if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) { - strSql += " AND ProjectId = @ProjectId"; + strSql += " AND b.ProjectId = @ProjectId"; listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID)); } //else @@ -165,8 +300,9 @@ namespace FineUIPro.Web.JGZL protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) { this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + this.ProjectId = this.tvControlItem.SelectedNodeID; this.InitTreeMenu(); - BindGrid(); + DataIsoInfo(); } /// @@ -192,70 +328,74 @@ namespace FineUIPro.Web.JGZL if (projectId != null) { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + var report = BLL.BlowingCleaningService.GetBlowingCleaningByProjectId(projectId); + if (report != null) { - string initTemplatePath = ""; - string rootPath = Server.MapPath("~/"); - BLL.Common.FastReportService.ResetData(); + DataTable dt = new DataTable(); + dt.TableName = "MainData"; + dt.Columns.Add("ProjectName"); + dt.Columns.Add("SystemName"); + dt.Columns.Add("SystemCode"); + dt.Columns.Add("CheckReulst1"); + dt.Columns.Add("CheckReulst2"); + dt.Columns.Add("CheckReulst3"); + dt.Columns.Add("CheckReulst4"); + dt.Columns.Add("Results"); + dt.Columns.Add("BlowingCleaningDate"); - var report = BLL.BlowingCleaningService.GetBlowingCleaningById(this.Grid1.SelectedRowID); - if (report != null) + var newRow = dt.NewRow(); + newRow["ProjectName"] = BLL.Base_ProjectService.GetProjectByProjectId(report.ProjectId).ProjectName; + newRow["SystemName"] = report.SystemName; + newRow["SystemCode"] = report.SystemCode; + newRow["Results"] = report.Results; + string blowingCleaningDate = string.Format("{0:yyyy年MM月dd日}", report.BlowingCleaningDate); + newRow["BlowingCleaningDate"] = blowingCleaningDate; + newRow["CheckReulst1"] = report.CheckReulst1; + newRow["CheckReulst2"] = report.CheckReulst2; + newRow["CheckReulst3"] = report.CheckReulst3; + newRow["CheckReulst4"] = report.CheckReulst4; + dt.Rows.Add(newRow); + BLL.Common.FastReportService.AddFastreportTable(dt); + + var itemList = BLL.BlowingCleaningItemService.GetBlowingCleaningItemList(report.BlowingCleaningId); + if (this.drpIsoNoS.SelectedValue!=BLL.Const._Null&&!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue)) { - DataTable dt = new DataTable(); - dt.TableName = "MainData"; - dt.Columns.Add("ProjectName"); - dt.Columns.Add("SystemName"); - dt.Columns.Add("SystemCode"); - dt.Columns.Add("Results"); - dt.Columns.Add("BlowingCleaningDate"); + itemList = itemList.Where(x => x.ISO_Id.Contains(this.drpIsoNoS.SelectedValue)).ToList(); + } + if (itemList.Count > 0) + { + DataTable itemdt = new DataTable(); + itemdt.TableName = "Data"; + itemdt.Columns.Add("ISO_IsoNo"); + itemdt.Columns.Add("STE_Code"); + itemdt.Columns.Add("OperatingMedium"); + itemdt.Columns.Add("ScrubbingMedium"); + itemdt.Columns.Add("CleaningMedium"); - var newRow = dt.NewRow(); - newRow["ProjectName"] = BLL.Base_ProjectService.GetProjectByProjectId(report.ProjectId).ProjectName; - newRow["SystemName"] = report.SystemName; - newRow["SystemCode"] = report.SystemCode; - newRow["Results"] = report.Results; - string blowingCleaningDate = string.Format("{0:yyyy年MM月dd日}", report.BlowingCleaningDate); - newRow["BlowingCleaningDate"] = blowingCleaningDate; - dt.Rows.Add(newRow); - BLL.Common.FastReportService.AddFastreportTable(dt); - - var itemList = BLL.BlowingCleaningItemService.GetBlowingCleaningItemList(this.Grid1.SelectedRowID); - if (itemList.Count > 0) + foreach (var item in itemList) { - DataTable itemdt = new DataTable(); - itemdt.TableName = "Data"; - itemdt.Columns.Add("ISO_IsoNo"); - itemdt.Columns.Add("STE_Code"); - itemdt.Columns.Add("OperatingMedium"); - itemdt.Columns.Add("ScrubbingMedium"); - itemdt.Columns.Add("CleaningMedium"); - - foreach (var item in itemList) - { - var newRow2 = itemdt.NewRow(); - newRow2["ISO_IsoNo"] = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByIsoInfoId(item.ISO_Id).ISO_IsoNo; - newRow2["STE_Code"] = BLL.HJGL_MaterialService.GetSteelBySteID(item.STE_ID).STE_Code; - newRow2["OperatingMedium"] = item.OperatingMedium; - newRow2["ScrubbingMedium"] = item.ScrubbingMedium; - newRow2["CleaningMedium"] = item.CleaningMedium; - itemdt.Rows.Add(newRow2); - } - BLL.Common.FastReportService.AddFastreportTable(itemdt); + var newRow2 = itemdt.NewRow(); + newRow2["ISO_IsoNo"] = item.ISO_Id; + newRow2["STE_Code"] = item.STE_ID; + newRow2["OperatingMedium"] = item.OperatingMedium; + newRow2["ScrubbingMedium"] = item.ScrubbingMedium; + newRow2["CleaningMedium"] = item.CleaningMedium; + itemdt.Rows.Add(newRow2); } - Dictionary keyValuePairs = new Dictionary(); - //keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); - BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); - } - initTemplatePath = "File\\Fastreport\\JGZL\\管道吹扫、清洗检验记录.frx"; - if (File.Exists(rootPath + initTemplatePath)) - { - PageContext.RegisterStartupScript(WindowPrint.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + BLL.Common.FastReportService.AddFastreportTable(itemdt); } + Dictionary keyValuePairs = new Dictionary(); + //keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); } - else + initTemplatePath = "File\\Fastreport\\JGZL\\管道吹扫、清洗检验记录.frx"; + if (File.Exists(rootPath + initTemplatePath)) { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; + PageContext.RegisterStartupScript(WindowPrint.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); } } else @@ -275,36 +415,36 @@ namespace FineUIPro.Web.JGZL protected void btnAdd_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("BlowingCleaningEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); - } - else - { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); - return; - } - } - - /// - /// 双击编辑 - /// - /// - /// - protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) - { - if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_BlowingCleaningMenuId, BLL.Const.BtnModify)) { if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) + JArray teamGroupData = Grid1.GetMergedData(); + List list = new List(); + foreach (JObject teamGroupRow in teamGroupData) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("BlowingCleaningEdit.aspx?blowingCleaningId={0}", this.Grid1.SelectedRowID, "编辑 - "))); - } - else - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; + JObject values = teamGroupRow.Value("values"); + list.Add(values); } + + JObject defaultObj = new JObject + { + { "BlowingCleaningItemId", Guid.NewGuid() }, + { "BlowingCleaningId", this.BlowingCleaningId }, + { "ISO_Id", "" }, + { "STE_ID", "" }, + { "OperatingMedium", "" }, + { "ScrubbingMedium", "" }, + { "CleaningMedium", "" }, + { + "Delete3", + String.Format("", + GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete)) + } + }; + list.Add(defaultObj); + Grid1.DataSource = list; + Grid1.DataBind(); + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemRecordEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); } else { @@ -314,112 +454,125 @@ namespace FineUIPro.Web.JGZL } else { - ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + return; } } - /// - /// 右键编辑 - /// - /// - /// - protected void btnMenuEdit_Click(object sender, EventArgs e) + protected void Grid1_PreDataBound(object sender, EventArgs e) { - if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_BlowingCleaningMenuId, BLL.Const.BtnModify)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("BlowingCleaningEdit.aspx?blowingCleaningId={0}", Grid1.SelectedRowID, "维护 - "))); - } - else - { - Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } + // 设置LinkButtonField的点击客户端事件 + LinkButtonField deleteField = Grid1.FindColumn("Delete3") as LinkButtonField; + deleteField.OnClientClick = GetDeleteScriptGrid1(); } /// - /// 右键删除 - /// - /// - /// - protected void btnMenuDelete_Click(object sender, EventArgs e) - { - if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_BlowingCleaningMenuId, Const.BtnDelete)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - - bool isShow = true; - if (Grid1.SelectedRowIndexArray.Length > 1) - { - isShow = false; - } - bool isDelete = false; - foreach (int rowIndex in Grid1.SelectedRowIndexArray) - { - string rowID = Grid1.DataKeys[rowIndex][0].ToString(); - if (judgementDelete(rowID, isShow)) - { - isDelete = true; - BLL.BlowingCleaningItemService.DeleteBlowingCleaningItemList(rowID); - BLL.BlowingCleaningService.DeleteBlowingCleaningById(rowID); - BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除管道吹扫/清洗检验记录"); - } - } - if (isDelete) - { - ShowNotify("删除成功!", MessageBoxIcon.Success); - } - this.BindGrid(); - } - else - { - Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } - - #region 判断是否可删除 - /// - /// 判断是否可以删除 + /// 删除提示 /// /// - private bool judgementDelete(string id, bool isShow) + private string GetDeleteScriptGrid1() { - string content = string.Empty; - - if (string.IsNullOrEmpty(content)) - { - return true; - } - else - { - if (isShow) - { - Alert.ShowInTop(content, MessageBoxIcon.Error); - } - return false; - } + return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, + Grid1.GetDeleteSelectedRowsReference(), String.Empty); } - #endregion + #endregion - #region 关闭弹出窗口及刷新页面 + #region 保存 /// - /// 关闭弹出窗口 + /// 保存按钮 /// /// /// - protected void Window1_Close(object sender, WindowCloseEventArgs e) + protected void btnSave_Click(object sender, EventArgs e) { - this.InitTreeMenu();//加载树 - this.BindGrid(); + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, + Const.JGZL_BlowingCleaningMenuId, Const.BtnSave)) + { + Model.JGZL_BlowingCleaning newRecord = new JGZL_BlowingCleaning(); + newRecord.SystemCode = this.txtSystemCode.Text; + newRecord.SystemName = this.txtSystemName.Text; + newRecord.CheckReulst1 = this.txtCheckResult1.Text; + newRecord.CheckReulst2 = this.txtCheckResult2.Text; + newRecord.CheckReulst3 = this.txtCheckResult3.Text; + newRecord.CheckReulst4 = this.txtCheckResult4.Text; + if (!string.IsNullOrEmpty(this.BlowingCleaningId)) + { + newRecord.BlowingCleaningId = this.BlowingCleaningId; + BLL.BlowingCleaningService.UpdateBlowingCleaning(newRecord); + } + else + { + newRecord.ProjectId = this.tvControlItem.SelectedNodeID; + newRecord.CompileMan = this.CurrUser.UserId; + newRecord.CompileDate = DateTime.Now; + newRecord.BlowingCleaningId = SQLHelper.GetNewID(typeof(Model.JGZL_BlowingCleaning)); + this.BlowingCleaningId = newRecord.BlowingCleaningId; + BLL.BlowingCleaningService.AddBlowingCleaning(newRecord); + } + saveItem(); + + //管线下拉选择 + var isoLists = (from x in Funs.DB.JGZL_BlowingCleaningItem + where x.BlowingCleaningId == this.BlowingCleaningId + select x.ISO_Id).Distinct().ToList(); + this.drpIsoNoS.Items.Clear(); + this.drpIsoNoS.DataTextField = "ISO_Id"; + this.drpIsoNoS.DataValueField = "ISO_Id"; + this.drpIsoNoS.DataSource = isoLists; + this.drpIsoNoS.DataBind(); + Funs.FineUIPleaseSelect(this.drpIsoNoS); + this.drpIsoNoS.SelectedIndex = 0; + + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + + void saveItem() + { + BLL.BlowingCleaningItemService.DeleteBlowingCleaningItemList(this.BlowingCleaningId); + itemLists.Clear(); + JArray teamGroupData = Grid1.GetMergedData(); + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + int rowIndex = teamGroupRow.Value("index"); + Model.JGZL_BlowingCleaningItem newDetail = new Model.JGZL_BlowingCleaningItem + { + BlowingCleaningItemId = values.Value("BlowingCleaningItemId"), + BlowingCleaningId = this.BlowingCleaningId, + ISO_Id = values.Value("ISO_Id"), + STE_ID = values.Value("STE_ID"), + OperatingMedium = values.Value("OperatingMedium"), + ScrubbingMedium = values.Value("ScrubbingMedium"), + CleaningMedium = values.Value("CleaningMedium"), + }; + itemLists.Add(newDetail); + } + try + { + if (itemLists.Count > 0) + { + Funs.DB.JGZL_BlowingCleaningItem.InsertAllOnSubmit(itemLists); + } + Funs.DB.SubmitChanges(); + } + catch (Exception) + { + return; + } } #endregion + + protected void drpIsoNoS_SelectedIndexChanged(object sender, EventArgs e) + { + DataIsoInfo(); + } } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx.designer.cs index 4e8b847..4647bba 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/BlowingCleaning.aspx.designer.cs @@ -95,6 +95,15 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Toolbar Toolbar2; + /// + /// drpIsoNoS 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpIsoNoS; + /// /// ToolbarFill1 控件。 /// @@ -113,6 +122,15 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Button btnAdd; + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + /// /// btnPrint 控件。 /// @@ -122,6 +140,69 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Button btnPrint; + /// + /// SimpleForm1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Form SimpleForm1; + + /// + /// txtSystemName 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSystemName; + + /// + /// txtSystemCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSystemCode; + + /// + /// txtCheckResult1 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCheckResult1; + + /// + /// txtCheckResult2 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCheckResult2; + + /// + /// txtCheckResult3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCheckResult3; + + /// + /// txtCheckResult4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCheckResult4; + /// /// Grid1 控件。 /// @@ -131,6 +212,51 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Grid Grid1; + /// + /// txtISO_Id 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtISO_Id; + + /// + /// txtSTE_ID 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtSTE_ID; + + /// + /// txtOperatingMedium 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtOperatingMedium; + + /// + /// txtScrubbingMedium 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtScrubbingMedium; + + /// + /// txtCleaningMedium 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCleaningMedium; + /// /// ToolbarSeparator1 控件。 /// @@ -158,15 +284,6 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.DropDownList ddlPageSize; - /// - /// Window1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Window Window1; - /// /// WindowPrint 控件。 /// @@ -175,32 +292,5 @@ namespace FineUIPro.Web.JGZL /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowPrint; - - /// - /// Menu1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Menu Menu1; - - /// - /// btnMenuEdit 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuEdit; - - /// - /// btnMenuDelete 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuDelete; } } diff --git a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx index f4cd8d9..7ae54c5 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx +++ b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx @@ -4,71 +4,94 @@ - + 管道系统压力试验条件确认记录 -
- - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - + + + + + + + + + + <%----%> + + + + + + + + + + + + + + + + - - - - - - - - - - + SortField="CheckItem1" SortDirection="ASC" + EnableTextSelection="True" AutoScroll="true"> + + + + + + + + + + + + + + + + + + + + + + <%-- - - + --%> + <%-- @@ -80,36 +103,36 @@ - - - - - - - + + + + <%-- - - + --%> + + <%-- - - - + --%> - \ No newline at end of file + diff --git a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx.cs b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx.cs index 5c5eefb..a5b7def 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx.cs @@ -5,11 +5,49 @@ using System.Data.SqlClient; using System.Data; using System.Linq; using System.IO; +using Newtonsoft.Json.Linq; namespace FineUIPro.Web.JGZL { public partial class PressureTestOfPipelineSystemConfirmationRecord : PageBase { + #region 定义项 + /// + /// 主键 + /// + private string RecordId + { + get + { + return (string)ViewState["RecordId"]; + } + set + { + ViewState["RecordId"] = value; + } + } + + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List itemLists = new List(); + #endregion + #region 加载页面 /// /// 加载页面 @@ -20,7 +58,7 @@ namespace FineUIPro.Web.JGZL { if (!IsPostBack) { - this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + //this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); this.drpProjectId.DataTextField = "ProjectCode"; this.drpProjectId.DataValueField = "ProjectId"; @@ -32,10 +70,117 @@ namespace FineUIPro.Web.JGZL { this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; } - this.InitTreeMenu();//加载树 + + var record = BLL.PressureTestOfPipelineSystemConfirmationRecordService.GetPressureTestOfPipelineSystemConfirmationRecordByProjectId(this.drpProjectId.SelectedValue); + if (record != null) + { + this.txtSystemCode.Text = record.SystemCode; + this.txtSystemName.Text = record.SystemName; + this.txtRemark.Text = record.Remark; + BindGrid(); + } + else + { + InitData(); + } } } + + private void InitData() + { + this.txtSystemCode.Text = string.Empty; + this.txtSystemName.Text = string.Empty; + this.txtRemark.Text = string.Empty; + itemLists.Clear(); + this.ProjectId = this.tvControlItem.SelectedNodeID; + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem.ProjectId = this.ProjectId; + newItem.CheckItem1 = "01"; + newItem.CheckItem2 = "管道安装符合设计文件和规范要求"; + itemLists.Add(newItem); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem2 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem2.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem2.ProjectId = this.ProjectId; + newItem2.CheckItem1 = "02"; + newItem2.CheckItem2 = "管道组成件复验合格"; + itemLists.Add(newItem2); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem3 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem3.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem3.ProjectId = this.ProjectId; + newItem3.CheckItem1 = "03"; + newItem3.CheckItem2 = "焊接工作记录齐全"; + itemLists.Add(newItem3); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem4 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem4.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem4.ProjectId = this.ProjectId; + newItem4.CheckItem1 = "04"; + newItem4.CheckItem2 = "无损检测结果符合设计文件和规范要求"; + itemLists.Add(newItem4); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem5 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem5.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem5.ProjectId = this.ProjectId; + newItem5.CheckItem1 = "05"; + newItem5.CheckItem2 = "热处理结果符合设计文件和规范要求"; + itemLists.Add(newItem5); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem6 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem6.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem6.ProjectId = this.ProjectId; + newItem6.CheckItem1 = "06"; + newItem6.CheckItem2 = "支、吊架安装正确"; + itemLists.Add(newItem6); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem7 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem7.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem7.ProjectId = this.ProjectId; + newItem7.CheckItem1 = "07"; + newItem7.CheckItem2 = "合金钢管道材质标记清楚"; + itemLists.Add(newItem7); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem8 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem8.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem8.ProjectId = this.ProjectId; + newItem8.CheckItem1 = "08"; + newItem8.CheckItem2 = "不参与管道系统试验的安全附件、仪表已按规定拆除或隔离,参与试压的系统内的阀门全部开启"; + itemLists.Add(newItem8); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem9 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem9.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem9.ProjectId = this.ProjectId; + newItem9.CheckItem1 = "09"; + newItem9.CheckItem2 = "临时加固措施、盲板位置与标识符合施工方案要求"; + itemLists.Add(newItem9); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem10 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem10.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem10.ProjectId = this.ProjectId; + newItem10.CheckItem1 = "10"; + newItem10.CheckItem2 = "焊接接头及需要检验的部位未被覆盖"; + itemLists.Add(newItem10); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem11 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem11.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem11.ProjectId = this.ProjectId; + newItem11.CheckItem1 = "11"; + newItem11.CheckItem2 = "试压用压力表量程、精度等级、检定状态符合规范要求"; + itemLists.Add(newItem11); + + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newItem12 = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord(); + newItem12.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord)); + newItem12.ProjectId = this.ProjectId; + newItem12.CheckItem1 = "12"; + newItem12.CheckItem2 = "不锈钢管道试验用水符合规范要求、附水质分析报告"; + itemLists.Add(newItem12); + + this.Grid1.DataSource = itemLists; + this.Grid1.DataBind(); + } #endregion #region 加载树项目 @@ -100,7 +245,15 @@ namespace FineUIPro.Web.JGZL { if (this.tvControlItem.SelectedNodeID != "0") { - this.BindGrid(); + var record = BLL.PressureTestOfPipelineSystemConfirmationRecordService.GetPressureTestOfPipelineSystemConfirmationRecordByProjectId(this.tvControlItem.SelectedNodeID); + if (record != null) + { + this.BindGrid(); + } + else + { + InitData(); + } } } #endregion @@ -135,10 +288,10 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) - { - BindGrid(); - } + //protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + //{ + // BindGrid(); + //} #endregion #region 排序 @@ -147,10 +300,10 @@ namespace FineUIPro.Web.JGZL ///
/// /// - protected void Grid1_Sort(object sender, GridSortEventArgs e) - { - BindGrid(); - } + //protected void Grid1_Sort(object sender, GridSortEventArgs e) + //{ + // BindGrid(); + //} #endregion #region 分页选择下拉改变事件 @@ -159,11 +312,11 @@ namespace FineUIPro.Web.JGZL ///
/// /// - protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) - { - Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); - BindGrid(); - } + //protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + //{ + // Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + // BindGrid(); + //} #endregion #endregion @@ -175,8 +328,17 @@ namespace FineUIPro.Web.JGZL /// protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) { + this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; this.InitTreeMenu(); - this.BindGrid(); + var record = BLL.PressureTestOfPipelineSystemConfirmationRecordService.GetPressureTestOfPipelineSystemConfirmationRecordByProjectId(this.tvControlItem.SelectedNodeID); + if (record != null) + { + this.BindGrid(); + } + else + { + InitData(); + } } /// @@ -184,10 +346,10 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void TextBox_TextChanged(object sender, EventArgs e) - { - this.BindGrid(); - } + //protected void TextBox_TextChanged(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} #endregion #region 打印 @@ -202,35 +364,35 @@ namespace FineUIPro.Web.JGZL if (projectId != null) { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) - { - string initTemplatePath = ""; - string rootPath = Server.MapPath("~/"); - BLL.Common.FastReportService.ResetData(); + //if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) + //{ + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + var report = (from x in Funs.DB.JGZL_PressureTestOfPipelineSystemConfirmationRecord where x.ProjectId == projectId select x); + if (report != null) + { + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); + keyValuePairs.Add("SystemName", report.FirstOrDefault().SystemName); + keyValuePairs.Add("SystemCode", report.FirstOrDefault().SystemCode); + keyValuePairs.Add("CheckItem1", report.Where(x => x.CheckItem1 == "01").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem2", report.Where(x => x.CheckItem1 == "02").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem3", report.Where(x => x.CheckItem1 == "03").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem4", report.Where(x => x.CheckItem1 == "04").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem5", report.Where(x => x.CheckItem1 == "05").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem6", report.Where(x => x.CheckItem1 == "06").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem7", report.Where(x => x.CheckItem1 == "07").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem8", report.Where(x => x.CheckItem1 == "08").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem9", report.Where(x => x.CheckItem1 == "09").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem10", report.Where(x => x.CheckItem1 == "10").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem11", report.Where(x => x.CheckItem1 == "11").FirstOrDefault().CheckItem3); + keyValuePairs.Add("CheckItem12", report.Where(x => x.CheckItem1 == "12").FirstOrDefault().CheckItem3); + //keyValuePairs.Add("TestConclusion", report.TestConclusion); + keyValuePairs.Add("Remark", report.FirstOrDefault().Remark); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); - var report = BLL.PressureTestOfPipelineSystemConfirmationRecordService.GetPressureTestOfPipelineSystemConfirmationRecordById(this.Grid1.SelectedRowID); - if (report != null) - { - Dictionary keyValuePairs = new Dictionary(); - keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); - keyValuePairs.Add("SystemName", report.SystemName); - keyValuePairs.Add("SystemCode", report.SystemCode); - keyValuePairs.Add("CheckItem1", report.CheckItem1); - keyValuePairs.Add("CheckItem2", report.CheckItem2); - keyValuePairs.Add("CheckItem3", report.CheckItem3); - keyValuePairs.Add("CheckItem4", report.CheckItem4); - keyValuePairs.Add("CheckItem5", report.CheckItem5); - keyValuePairs.Add("CheckItem6", report.CheckItem6); - keyValuePairs.Add("CheckItem7", report.CheckItem7); - keyValuePairs.Add("CheckItem8", report.CheckItem8); - keyValuePairs.Add("CheckItem9", report.CheckItem9); - keyValuePairs.Add("CheckItem10", report.CheckItem10); - keyValuePairs.Add("CheckItem11", report.CheckItem11); - keyValuePairs.Add("CheckItem12", report.CheckItem12); - //keyValuePairs.Add("TestConclusion", report.TestConclusion); - keyValuePairs.Add("Remark", report.Remark); - BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); - } initTemplatePath = "File\\Fastreport\\JGZL\\管道系统压力试验条件确认记录.frx"; if (File.Exists(rootPath + initTemplatePath)) { @@ -239,7 +401,7 @@ namespace FineUIPro.Web.JGZL } else { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + Alert.ShowInTop("请先保存数据!", MessageBoxIcon.Warning); return; } } @@ -257,139 +419,139 @@ namespace FineUIPro.Web.JGZL ///
/// /// - protected void btnAdd_Click(object sender, EventArgs e) - { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemConfirmationRecordEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); - } - else - { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); - return; - } - } + //protected void btnAdd_Click(object sender, EventArgs e) + //{ + // if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + // { + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemConfirmationRecordEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); + // } + // else + // { + // Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + // return; + // } + //} /// /// 双击编辑 /// /// /// - protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) - { - if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_PressureTestOfPipelineSystemConfirmationRecordMenuId, BLL.Const.BtnModify)) - { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemConfirmationRecordEdit.aspx?recordId={0}", this.Grid1.SelectedRowID, "编辑 - "))); - } - else - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - } - else - { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); - return; - } - } - else - { - ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } + //protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + //{ + // if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_PressureTestOfPipelineSystemConfirmationRecordMenuId, BLL.Const.BtnModify)) + // { + // if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + // { + // if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) + // { + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemConfirmationRecordEdit.aspx?recordId={0}", this.Grid1.SelectedRowID, "编辑 - "))); + // } + // else + // { + // Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + // return; + // } + // } + // else + // { + // Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + // return; + // } + // } + // else + // { + // ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + // } + //} /// /// 右键编辑 /// /// /// - protected void btnMenuEdit_Click(object sender, EventArgs e) - { - if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_PressureTestOfPipelineSystemConfirmationRecordMenuId, BLL.Const.BtnModify)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemConfirmationRecordEdit.aspx?recordId={0}", Grid1.SelectedRowID, "维护 - "))); - } - else - { - Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } + //protected void btnMenuEdit_Click(object sender, EventArgs e) + //{ + // if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_PressureTestOfPipelineSystemConfirmationRecordMenuId, BLL.Const.BtnModify)) + // { + // if (Grid1.SelectedRowIndexArray.Length == 0) + // { + // Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + // return; + // } + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemConfirmationRecordEdit.aspx?recordId={0}", Grid1.SelectedRowID, "维护 - "))); + // } + // else + // { + // Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + // } + //} /// /// 右键删除 /// /// /// - protected void btnMenuDelete_Click(object sender, EventArgs e) - { - if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_PressureTestOfPipelineSystemConfirmationRecordMenuId, Const.BtnDelete)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } + //protected void btnMenuDelete_Click(object sender, EventArgs e) + //{ + // if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_PressureTestOfPipelineSystemConfirmationRecordMenuId, Const.BtnDelete)) + // { + // if (Grid1.SelectedRowIndexArray.Length == 0) + // { + // Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + // return; + // } - bool isShow = true; - if (Grid1.SelectedRowIndexArray.Length > 1) - { - isShow = false; - } - bool isDelete = false; - foreach (int rowIndex in Grid1.SelectedRowIndexArray) - { - string rowID = Grid1.DataKeys[rowIndex][0].ToString(); - if (judgementDelete(rowID, isShow)) - { - isDelete = true; - BLL.PressureTestOfPipelineSystemConfirmationRecordService.DeletePressureTestOfPipelineSystemConfirmationRecordById(rowID); - BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除管道系统压力试验条件确认记录"); - } - } - if (isDelete) - { - ShowNotify("删除成功!", MessageBoxIcon.Success); - } - this.BindGrid(); - } - else - { - Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } + // bool isShow = true; + // if (Grid1.SelectedRowIndexArray.Length > 1) + // { + // isShow = false; + // } + // bool isDelete = false; + // foreach (int rowIndex in Grid1.SelectedRowIndexArray) + // { + // string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + // if (judgementDelete(rowID, isShow)) + // { + // isDelete = true; + // BLL.PressureTestOfPipelineSystemConfirmationRecordService.DeletePressureTestOfPipelineSystemConfirmationRecordById(rowID); + // BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除管道系统压力试验条件确认记录"); + // } + // } + // if (isDelete) + // { + // ShowNotify("删除成功!", MessageBoxIcon.Success); + // } + // this.BindGrid(); + // } + // else + // { + // Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + // } + //} #region 判断是否可删除 /// /// 判断是否可以删除 /// /// - private bool judgementDelete(string id, bool isShow) - { - string content = string.Empty; + //private bool judgementDelete(string id, bool isShow) + //{ + // string content = string.Empty; - if (string.IsNullOrEmpty(content)) - { - return true; - } - else - { - if (isShow) - { - Alert.ShowInTop(content, MessageBoxIcon.Error); - } - return false; - } - } + // if (string.IsNullOrEmpty(content)) + // { + // return true; + // } + // else + // { + // if (isShow) + // { + // Alert.ShowInTop(content, MessageBoxIcon.Error); + // } + // return false; + // } + //} #endregion #endregion @@ -399,10 +561,69 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void Window1_Close(object sender, WindowCloseEventArgs e) + //protected void Window1_Close(object sender, WindowCloseEventArgs e) + //{ + // this.InitTreeMenu();//加载树 + // this.BindGrid(); + //} + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) { - this.InitTreeMenu();//加载树 - this.BindGrid(); + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, + Const.JGZL_PressureTestOfPipelineSystemConfirmationRecordMenuId, Const.BtnSave)) + { + saveItem(); + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + + void saveItem() + { + itemLists.Clear(); + BLL.PressureTestOfPipelineSystemConfirmationRecordService.DeletePressureTestOfPipelineSystemConfirmationRecordByProjectId(this.tvControlItem.SelectedNodeID); + JArray teamGroupData = Grid1.GetMergedData(); + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + int rowIndex = teamGroupRow.Value("index"); + Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord newDetail = new Model.JGZL_PressureTestOfPipelineSystemConfirmationRecord + { + RecordId = values.Value("RecordId"), + ProjectId = this.tvControlItem.SelectedNodeID, + SystemName = this.txtSystemName.Text, + SystemCode = this.txtSystemCode.Text, + Remark = this.txtRemark.Text, + CheckItem1 = values.Value("CheckItem1"), + CheckItem2 = values.Value("CheckItem2"), + CheckItem3 = values.Value("CheckItem3"), + }; + itemLists.Add(newDetail); + } + try + { + if (itemLists.Count > 0) + { + Funs.DB.JGZL_PressureTestOfPipelineSystemConfirmationRecord.InsertAllOnSubmit(itemLists); + } + Funs.DB.SubmitChanges(); + } + catch (Exception) + { + return; + } } #endregion } diff --git a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx.designer.cs index 506a356..3debe0e 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemConfirmationRecord.aspx.designer.cs @@ -105,13 +105,13 @@ namespace FineUIPro.Web.JGZL protected global::FineUIPro.ToolbarFill ToolbarFill1; /// - /// btnAdd 控件。 + /// btnSave 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Button btnAdd; + protected global::FineUIPro.Button btnSave; /// /// btnPrint 控件。 @@ -122,6 +122,33 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Button btnPrint; + /// + /// Toolbar4 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Toolbar Toolbar4; + + /// + /// txtRemark 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextArea txtRemark; + + /// + /// ToolbarFill3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.ToolbarFill ToolbarFill3; + /// /// Grid1 控件。 /// @@ -132,40 +159,49 @@ namespace FineUIPro.Web.JGZL protected global::FineUIPro.Grid Grid1; /// - /// ToolbarSeparator1 控件。 + /// Toolbar3 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + protected global::FineUIPro.Toolbar Toolbar3; /// - /// ToolbarText1 控件。 + /// txtSystemName 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarText ToolbarText1; + protected global::FineUIPro.TextBox txtSystemName; /// - /// ddlPageSize 控件。 + /// txtSystemCode 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList ddlPageSize; + protected global::FineUIPro.TextBox txtSystemCode; /// - /// Window1 控件。 + /// ToolbarFill2 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Window Window1; + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// txtCheckItem3 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtCheckItem3; /// /// WindowPrint 控件。 @@ -175,32 +211,5 @@ namespace FineUIPro.Web.JGZL /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowPrint; - - /// - /// Menu1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Menu Menu1; - - /// - /// btnMenuEdit 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuEdit; - - /// - /// btnMenuDelete 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuDelete; } } diff --git a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx index d6368ab..66919b3 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx +++ b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx @@ -4,71 +4,123 @@ - + 管道系统压力试验记录 -
- - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <%-- @@ -80,36 +132,36 @@ - - - - - - - --%> + + <%-- - - - + --%> - \ No newline at end of file + diff --git a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.cs b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.cs index c32df50..9c663fb 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.cs @@ -5,11 +5,68 @@ using System.Data.SqlClient; using System.Data; using System.Linq; using System.IO; +using Model; +using Newtonsoft.Json.Linq; +using FineUIPro.Web.HJGL.DataIn; +using FastReport; +using FastReport.Export.Dbf; namespace FineUIPro.Web.JGZL { public partial class PressureTestOfPipelineSystemRecord : PageBase { + #region 定义项 + /// + /// 主键 + /// + private string Id + { + get + { + return (string)ViewState["Id"]; + } + set + { + ViewState["Id"] = value; + } + } + + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 外键—RecordId + /// + public string RecordId + { + get + { + return (string)ViewState["RecordId"]; + } + set + { + ViewState["RecordId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List itemLists = new List(); + #endregion + #region 加载页面 /// /// 加载页面 @@ -20,22 +77,93 @@ namespace FineUIPro.Web.JGZL { if (!IsPostBack) { - this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); + //this.ddlPageSize.SelectedValue = this.Grid1.PageSize.ToString(); this.drpProjectId.DataTextField = "ProjectCode"; this.drpProjectId.DataValueField = "ProjectId"; this.drpProjectId.DataSource = BLL.Base_ProjectService.GetOnProjectListByUserId(this.CurrUser.UserId, "1"); this.drpProjectId.DataBind(); Funs.FineUIPleaseSelect(this.drpProjectId); - // 默认显示选中的项目 - if (!string.IsNullOrEmpty(this.CurrUser.LoginProjectId)) + + this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; + this.InitTreeMenu();//加载树 + this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + this.ProjectId = this.tvControlItem.SelectedNodeID; + + var record = BLL.PressureTestOfPipelineSystemRecordService.GetPressureTestOfPipelineSystemRecordByProjectId(this.tvControlItem.SelectedNodeID); + if (record != null) { - this.drpProjectId.SelectedValue = this.CurrUser.LoginProjectId; + this.RecordId = record.RecordId; + this.txtSystemName.Text = record.SystemName; + this.txtSystemCode.Text = record.SystemCode; } - this.InitTreeMenu();//加载树 + //管线下拉选择 + var isoLists = (from x in Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem + where x.RecordId == this.RecordId + select x.PipelineNo).Distinct().ToList(); + this.drpIsoNoS.Items.Clear(); + this.drpIsoNoS.DataTextField = "PipelineNo"; + this.drpIsoNoS.DataValueField = "PipelineNo"; + this.drpIsoNoS.DataSource = isoLists; + this.drpIsoNoS.DataBind(); + Funs.FineUIPleaseSelect(this.drpIsoNoS); + this.drpIsoNoS.SelectedIndex = 0; + + DataIsoInfo(); } } + + private void DataIsoInfo() + { + this.txtSystemCode.Text = string.Empty; + this.txtSystemName.Text = string.Empty; + itemLists.Clear(); + if (!string.IsNullOrEmpty(this.ProjectId)) + { + var record = BLL.PressureTestOfPipelineSystemRecordService.GetPressureTestOfPipelineSystemRecordByProjectId(this.ProjectId); + if (record != null) + { + this.RecordId = record.RecordId; + this.txtSystemCode.Text = record.SystemCode; + this.txtSystemName.Text = record.SystemName; + itemLists = BLL.PressureTestOfPipelineSystemRecordItemService.GetItemByRecordId(this.RecordId); + } + else + { + //var pro = BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId); + //if (pro != null) + //{ + // this.txtProjectCode.Text = pro.ProjectCode; + // this.txtProjectName.Text = pro.ProjectName; + //} + } + var isoInfos = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + foreach (var item in isoInfos) + { + var teamWeldingInspectionItem = BLL.PressureTestOfPipelineSystemRecordItemService.GetItemByIsoNo(this.ProjectId,item.ISO_IsoNo); + if (teamWeldingInspectionItem != null) + { + //itemLists.Add(teamWeldingInspectionItem); + } + else + { + Model.JGZL_PressureTestOfPipelineSystemRecordItem newItem = new JGZL_PressureTestOfPipelineSystemRecordItem(); + newItem.Id = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecordItem)); + newItem.PipelineNo = item.ISO_IsoNo; + newItem.DesignPressure = item.ISO_DesignPress.ToString(); + newItem.DesignTemperature = item.ISO_DesignTemperature.ToString(); + itemLists.Add(newItem); + } + } + if (!string.IsNullOrEmpty(this.drpIsoNoS.SelectedValue) && this.drpIsoNoS.SelectedValue != BLL.Const._Null) + { + itemLists = itemLists.Where(e => e.PipelineNo.Contains(this.drpIsoNoS.SelectedValue)).ToList(); ; + } + } + this.Grid1.DataSource = itemLists; + this.Grid1.DataBind(); + } #endregion #region 加载树项目 @@ -100,7 +228,8 @@ namespace FineUIPro.Web.JGZL { if (this.tvControlItem.SelectedNodeID != "0") { - this.BindGrid(); + this.ProjectId = this.tvControlItem.SelectedNodeID; + DataIsoInfo(); } } #endregion @@ -111,14 +240,13 @@ namespace FineUIPro.Web.JGZL /// private void BindGrid() { - string strSql = @"SELECT * from JGZL_PressureTestOfPipelineSystemRecord where 1=1"; + string strSql = @"SELECT * from JGZL_PressureTestOfPipelineSystemRecordItem where 1=1"; List listStr = new List(); - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + if (!string.IsNullOrEmpty(this.RecordId)) { - strSql += " AND ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID)); + strSql += " AND RecordId = @RecordId"; + listStr.Add(new SqlParameter("@RecordId", this.RecordId)); } - SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); Grid1.RecordCount = tb.Rows.Count; @@ -135,10 +263,10 @@ namespace FineUIPro.Web.JGZL ///
/// /// - protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) - { - BindGrid(); - } + //protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) + //{ + // BindGrid(); + //} #endregion #region 排序 @@ -147,10 +275,10 @@ namespace FineUIPro.Web.JGZL ///
/// /// - protected void Grid1_Sort(object sender, GridSortEventArgs e) - { - BindGrid(); - } + //protected void Grid1_Sort(object sender, GridSortEventArgs e) + //{ + // BindGrid(); + //} #endregion #region 分页选择下拉改变事件 @@ -159,11 +287,11 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) - { - Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); - BindGrid(); - } + //protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) + //{ + //Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); + // BindGrid(); + //} #endregion #endregion @@ -175,8 +303,11 @@ namespace FineUIPro.Web.JGZL /// protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) { + this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + this.ProjectId = this.tvControlItem.SelectedNodeID; this.InitTreeMenu(); - this.BindGrid(); + //this.BindGrid(); + DataIsoInfo(); } /// @@ -184,10 +315,10 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void TextBox_TextChanged(object sender, EventArgs e) - { - this.BindGrid(); - } + //protected void TextBox_TextChanged(object sender, EventArgs e) + //{ + // this.BindGrid(); + //} #endregion #region 打印 @@ -199,70 +330,61 @@ namespace FineUIPro.Web.JGZL protected void btnPrint_Click(object sender, EventArgs e) { string projectId = this.tvControlItem.SelectedNodeID; - if (projectId != null) { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) + string initTemplatePath = ""; + string rootPath = Server.MapPath("~/"); + BLL.Common.FastReportService.ResetData(); + + var report = BLL.PressureTestOfPipelineSystemRecordService.GetPressureTestOfPipelineSystemRecordByProjectId(projectId); + if (report != null) { - string initTemplatePath = ""; - string rootPath = Server.MapPath("~/"); - BLL.Common.FastReportService.ResetData(); + string strSql = @"SELECT * from JGZL_PressureTestOfPipelineSystemRecordItem m left join JGZL_PressureTestOfPipelineSystemRecord d on d.RecordId = m.RecordId where d.ProjectId=@projectId "; + List listStr = new List(); + listStr.Add(new SqlParameter("@projectId", projectId)); + SqlParameter[] parameter = listStr.ToArray(); + DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - var report = BLL.PressureTestOfPipelineSystemRecordService.GetPressureTestOfPipelineSystemRecordById(this.Grid1.SelectedRowID); - if (report != null) + DataTable dt = new DataTable(); + dt.TableName = "Data"; + dt.Columns.Add("PipelineNo"); + dt.Columns.Add("DesignPressure"); + dt.Columns.Add("DesignTemperature"); + dt.Columns.Add("TestTemperature"); + dt.Columns.Add("TestMedium"); + dt.Columns.Add("TestMediumTemperature"); + dt.Columns.Add("TestPressure"); + dt.Columns.Add("VoltageStabilizationTime"); + + DataRow[] rows = tb.DefaultView.ToTable().Select(); + foreach (var row in rows) { - string strSql = @"SELECT * from JGZL_PressureTestOfPipelineSystemRecordItem where RecordId=@recordId "; - List listStr = new List(); - listStr.Add(new SqlParameter("@recordId", this.Grid1.SelectedRowID)); - SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - - DataTable dt = new DataTable(); - dt.TableName = "Data"; - dt.Columns.Add("PipelineNo"); - dt.Columns.Add("DesignPressure"); - dt.Columns.Add("DesignTemperature"); - dt.Columns.Add("TestTemperature"); - dt.Columns.Add("TestMedium"); - dt.Columns.Add("TestMediumTemperature"); - dt.Columns.Add("TestPressure"); - dt.Columns.Add("VoltageStabilizationTime"); - - DataRow[] rows = tb.DefaultView.ToTable().Select(); - foreach (var row in rows) - { - var newRow = dt.NewRow(); - newRow["PipelineNo"] = row["PipelineNo"].ToString(); - newRow["DesignPressure"] = row["DesignPressure"].ToString(); - newRow["DesignTemperature"] = row["DesignTemperature"].ToString(); - newRow["TestTemperature"] = row["TestTemperature"].ToString(); - newRow["TestMedium"] = row["TestMedium"].ToString(); - newRow["TestMediumTemperature"] = row["TestMediumTemperature"].ToString(); - newRow["TestPressure"] = row["TestPressure"].ToString(); - newRow["VoltageStabilizationTime"] = row["VoltageStabilizationTime"].ToString(); - dt.Rows.Add(newRow); - } - BLL.Common.FastReportService.AddFastreportTable(dt); - - - Dictionary keyValuePairs = new Dictionary(); - keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); - keyValuePairs.Add("SystemName", report.SystemName); - keyValuePairs.Add("SystemCode", report.SystemCode); - keyValuePairs.Add("TestConclusion", report.TestConclusion); - keyValuePairs.Add("Remark", report.Remark); - BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); - } - initTemplatePath = "File\\Fastreport\\JGZL\\管道系统压力试验记录.frx"; - if (File.Exists(rootPath + initTemplatePath)) - { - PageContext.RegisterStartupScript(WindowPrint.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); + var newRow = dt.NewRow(); + newRow["PipelineNo"] = row["PipelineNo"].ToString(); + newRow["DesignPressure"] = row["DesignPressure"].ToString(); + newRow["DesignTemperature"] = row["DesignTemperature"].ToString(); + newRow["TestTemperature"] = row["TestTemperature"].ToString(); + newRow["TestMedium"] = row["TestMedium"].ToString(); + newRow["TestMediumTemperature"] = row["TestMediumTemperature"].ToString(); + newRow["TestPressure"] = row["TestPressure"].ToString(); + newRow["VoltageStabilizationTime"] = row["VoltageStabilizationTime"].ToString(); + dt.Rows.Add(newRow); } + BLL.Common.FastReportService.AddFastreportTable(dt); + + + Dictionary keyValuePairs = new Dictionary(); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); + keyValuePairs.Add("SystemName", report.SystemName); + keyValuePairs.Add("SystemCode", report.SystemCode); + keyValuePairs.Add("TestConclusion", report.TestConclusion); + keyValuePairs.Add("Remark", report.Remark); + BLL.Common.FastReportService.AddFastreportParameter(keyValuePairs); } - else + initTemplatePath = "File\\Fastreport\\JGZL\\管道系统压力试验记录.frx"; + if (File.Exists(rootPath + initTemplatePath)) { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; + PageContext.RegisterStartupScript(WindowPrint.GetShowReference(String.Format("../common/ReportPrint/Fastreport.aspx?ReportPath={0}", rootPath + initTemplatePath))); } } else @@ -283,7 +405,36 @@ namespace FineUIPro.Web.JGZL { if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemRecordEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); + JArray teamGroupData = Grid1.GetMergedData(); + List list = new List(); + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + list.Add(values); + } + + JObject defaultObj = new JObject + { + { "Id", Guid.NewGuid() }, + { "RecordId", this.RecordId }, + { "PipelineNo", "" }, + { "DesignPressure", "" }, + { "DesignTemperature", "" }, + { "TestTemperature", "" }, + { "TestMedium", "" }, + { "TestMediumTemperature", "" }, + { "TestPressure", "" }, + { "VoltageStabilizationTime", "" }, + { + "Delete3", + String.Format("", + GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete)) + } + }; + list.Add(defaultObj); + Grid1.DataSource = list; + Grid1.DataBind(); + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemRecordEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); } else { @@ -292,127 +443,144 @@ namespace FineUIPro.Web.JGZL } } + protected void Grid1_PreDataBound(object sender, EventArgs e) + { + // 设置LinkButtonField的点击客户端事件 + LinkButtonField deleteField = Grid1.FindColumn("Delete3") as LinkButtonField; + deleteField.OnClientClick = GetDeleteScriptGrid1(); + } + + /// + /// 删除提示 + /// + /// + private string GetDeleteScriptGrid1() + { + return Confirm.GetShowReference("删除选中行?", String.Empty, MessageBoxIcon.Question, + Grid1.GetDeleteSelectedRowsReference(), String.Empty); + } + /// /// 双击编辑 /// /// /// - protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) - { - if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_PressureTestOfPipelineSystemRecordMenuId, BLL.Const.BtnModify)) - { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemRecordEdit.aspx?recordId={0}", this.Grid1.SelectedRowID, "编辑 - "))); - } - else - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - } - else - { - Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); - return; - } - } - else - { - ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } + //protected void Grid1_RowDoubleClick(object sender, GridRowClickEventArgs e) + //{ + // if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_PressureTestOfPipelineSystemRecordMenuId, BLL.Const.BtnModify)) + // { + // if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + // { + // if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) + // { + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemRecordEdit.aspx?recordId={0}", this.Grid1.SelectedRowID, "编辑 - "))); + // } + // else + // { + // Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + // return; + // } + // } + // else + // { + // Alert.ShowInTop("请选择项目!", MessageBoxIcon.Warning); + // return; + // } + // } + // else + // { + // ShowNotify("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + // } + //} /// /// 右键编辑 /// /// /// - protected void btnMenuEdit_Click(object sender, EventArgs e) - { - if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_PressureTestOfPipelineSystemRecordMenuId, BLL.Const.BtnModify)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemRecordEdit.aspx?recordId={0}", Grid1.SelectedRowID, "维护 - "))); - } - else - { - Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } + //protected void btnMenuEdit_Click(object sender, EventArgs e) + //{ + // if (BLL.CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, BLL.Const.JGZL_PressureTestOfPipelineSystemRecordMenuId, BLL.Const.BtnModify)) + // { + // if (Grid1.SelectedRowIndexArray.Length == 0) + // { + // Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + // return; + // } + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("PressureTestOfPipelineSystemRecordEdit.aspx?recordId={0}", Grid1.SelectedRowID, "维护 - "))); + // } + // else + // { + // Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + // } + //} /// /// 右键删除 /// /// /// - protected void btnMenuDelete_Click(object sender, EventArgs e) - { - if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_PressureTestOfPipelineSystemRecordMenuId, Const.BtnDelete)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } + //protected void btnMenuDelete_Click(object sender, EventArgs e) + //{ + // if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_PressureTestOfPipelineSystemRecordMenuId, Const.BtnDelete)) + // { + // if (Grid1.SelectedRowIndexArray.Length == 0) + // { + // Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + // return; + // } - bool isShow = true; - if (Grid1.SelectedRowIndexArray.Length > 1) - { - isShow = false; - } - bool isDelete = false; - foreach (int rowIndex in Grid1.SelectedRowIndexArray) - { - string rowID = Grid1.DataKeys[rowIndex][0].ToString(); - if (judgementDelete(rowID, isShow)) - { - isDelete = true; - BLL.PressureTestOfPipelineSystemRecordItemService.DeleteItemByRecordId(rowID); - BLL.PressureTestOfPipelineSystemRecordService.DeletePressureTestOfPipelineSystemRecordById(rowID); - BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除管道系统压力试验记录"); - } - } - if (isDelete) - { - ShowNotify("删除成功!", MessageBoxIcon.Success); - } - this.BindGrid(); - } - else - { - Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); - } - } + // bool isShow = true; + // if (Grid1.SelectedRowIndexArray.Length > 1) + // { + // isShow = false; + // } + // bool isDelete = false; + // foreach (int rowIndex in Grid1.SelectedRowIndexArray) + // { + // string rowID = Grid1.DataKeys[rowIndex][0].ToString(); + // if (judgementDelete(rowID, isShow)) + // { + // isDelete = true; + // BLL.PressureTestOfPipelineSystemRecordItemService.DeleteItemByRecordId(rowID); + // BLL.PressureTestOfPipelineSystemRecordService.DeletePressureTestOfPipelineSystemRecordById(rowID); + // BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除管道系统压力试验记录"); + // } + // } + // if (isDelete) + // { + // ShowNotify("删除成功!", MessageBoxIcon.Success); + // } + // this.BindGrid(); + // } + // else + // { + // Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + // } + //} #region 判断是否可删除 /// /// 判断是否可以删除 /// /// - private bool judgementDelete(string id, bool isShow) - { - string content = string.Empty; + //private bool judgementDelete(string id, bool isShow) + //{ + // string content = string.Empty; - if (string.IsNullOrEmpty(content)) - { - return true; - } - else - { - if (isShow) - { - Alert.ShowInTop(content, MessageBoxIcon.Error); - } - return false; - } - } + // if (string.IsNullOrEmpty(content)) + // { + // return true; + // } + // else + // { + // if (isShow) + // { + // Alert.ShowInTop(content, MessageBoxIcon.Error); + // } + // return false; + // } + //} #endregion #endregion @@ -422,11 +590,107 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void Window1_Close(object sender, WindowCloseEventArgs e) + //protected void Window1_Close(object sender, WindowCloseEventArgs e) + //{ + // this.InitTreeMenu();//加载树 + // this.BindGrid(); + //} + #endregion + + #region 保存 + /// + /// 保存按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) { - this.InitTreeMenu();//加载树 - this.BindGrid(); + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, + Const.JGZL_PressureTestOfPipelineSystemRecordMenuId, Const.BtnSave)) + { + Model.JGZL_PressureTestOfPipelineSystemRecord newRecord = new JGZL_PressureTestOfPipelineSystemRecord(); + newRecord.SystemCode = this.txtSystemCode.Text; + newRecord.SystemName = this.txtSystemName.Text; + if (!string.IsNullOrEmpty(this.RecordId)) + { + newRecord.RecordId = this.RecordId; + BLL.PressureTestOfPipelineSystemRecordService.UpdatePressureTestOfPipelineSystemRecord(newRecord); + } + else + { + newRecord.ProjectId = this.tvControlItem.SelectedNodeID; + newRecord.CompileMan = this.CurrUser.UserId; + newRecord.CompileDate = DateTime.Now; + newRecord.RecordId = SQLHelper.GetNewID(typeof(Model.JGZL_PressureTestOfPipelineSystemRecord)); + this.RecordId = newRecord.RecordId; + BLL.PressureTestOfPipelineSystemRecordService.AddPressureTestOfPipelineSystemRecord(newRecord); + } + saveItem(); + + //管线下拉选择 + var isoLists = (from x in Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem + where x.RecordId == this.RecordId + select x.PipelineNo).Distinct().ToList(); + this.drpIsoNoS.Items.Clear(); + this.drpIsoNoS.DataTextField = "PipelineNo"; + this.drpIsoNoS.DataValueField = "PipelineNo"; + this.drpIsoNoS.DataSource = isoLists; + this.drpIsoNoS.DataBind(); + Funs.FineUIPleaseSelect(this.drpIsoNoS); + this.drpIsoNoS.SelectedIndex = 0; + + ShowNotify("保存成功!", MessageBoxIcon.Success); + PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); + } + else + { + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; + } + } + + void saveItem() + { + BLL.PressureTestOfPipelineSystemRecordItemService.DeleteItemByRecordId(this.RecordId); + itemLists.Clear(); + JArray teamGroupData = Grid1.GetMergedData(); + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + int rowIndex = teamGroupRow.Value("index"); + Model.JGZL_PressureTestOfPipelineSystemRecordItem newDetail = new Model.JGZL_PressureTestOfPipelineSystemRecordItem + { + Id = values.Value("Id"), + RecordId = this.RecordId, + PipelineNo = values.Value("PipelineNo"), + DesignPressure = values.Value("DesignPressure"), + DesignTemperature = values.Value("DesignTemperature"), + TestTemperature = values.Value("TestTemperature"), + TestMedium = values.Value("TestMedium"), + TestMediumTemperature = values.Value("TestMediumTemperature"), + TestPressure = values.Value("TestPressure"), + VoltageStabilizationTime = values.Value("VoltageStabilizationTime"), + }; + itemLists.Add(newDetail); + } + try + { + if (itemLists.Count > 0) + { + Funs.DB.JGZL_PressureTestOfPipelineSystemRecordItem.InsertAllOnSubmit(itemLists); + } + Funs.DB.SubmitChanges(); + } + catch (Exception) + { + return; + } } #endregion + + protected void drpIsoNoS_SelectedIndexChanged(object sender, EventArgs e) + { + DataIsoInfo(); + } } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.designer.cs index 8ab222a..e5606aa 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/PressureTestOfPipelineSystemRecord.aspx.designer.cs @@ -95,6 +95,15 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Toolbar Toolbar2; + /// + /// drpIsoNoS 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.DropDownList drpIsoNoS; + /// /// ToolbarFill1 控件。 /// @@ -113,6 +122,15 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Button btnAdd; + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + /// /// btnPrint 控件。 /// @@ -132,40 +150,112 @@ namespace FineUIPro.Web.JGZL protected global::FineUIPro.Grid Grid1; /// - /// ToolbarSeparator1 控件。 + /// Toolbar3 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarSeparator ToolbarSeparator1; + protected global::FineUIPro.Toolbar Toolbar3; /// - /// ToolbarText1 控件。 + /// txtSystemName 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.ToolbarText ToolbarText1; + protected global::FineUIPro.TextBox txtSystemName; /// - /// ddlPageSize 控件。 + /// txtSystemCode 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DropDownList ddlPageSize; + protected global::FineUIPro.TextBox txtSystemCode; /// - /// Window1 控件。 + /// ToolbarFill2 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.Window Window1; + protected global::FineUIPro.ToolbarFill ToolbarFill2; + + /// + /// txtPipelineNo 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipelineNo; + + /// + /// txtDesignPressure 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDesignPressure; + + /// + /// txtDesignTemperature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtDesignTemperature; + + /// + /// txtTestTemperature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTestTemperature; + + /// + /// txtTestMedium 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTestMedium; + + /// + /// txtTestMediumTemperature 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTestMediumTemperature; + + /// + /// txtTestPressure 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtTestPressure; + + /// + /// txtVoltageStabilizationTime 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtVoltageStabilizationTime; /// /// WindowPrint 控件。 @@ -175,32 +265,5 @@ namespace FineUIPro.Web.JGZL /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// protected global::FineUIPro.Window WindowPrint; - - /// - /// Menu1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Menu Menu1; - - /// - /// btnMenuEdit 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuEdit; - - /// - /// btnMenuDelete 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.MenuButton btnMenuDelete; } } diff --git a/HJGL_DS/Model/Model.cs b/HJGL_DS/Model/Model.cs index 8fdc654..48d9594 100644 --- a/HJGL_DS/Model/Model.cs +++ b/HJGL_DS/Model/Model.cs @@ -24486,8 +24486,6 @@ namespace Model private EntitySet _HJGL_WeldingProcedure_WeldingProcedure_HJGL_BS_Steel1; - private EntitySet _JGZL_BlowingCleaningItem; - #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -24525,7 +24523,6 @@ namespace Model this._HJGL_WeldingProcedure_MatchedProcedureMaterial_HJGL_BS_Steel1 = new EntitySet(new Action(this.attach_HJGL_WeldingProcedure_MatchedProcedureMaterial_HJGL_BS_Steel1), new Action(this.detach_HJGL_WeldingProcedure_MatchedProcedureMaterial_HJGL_BS_Steel1)); this._HJGL_WeldingProcedure_WeldingProcedure = new EntitySet(new Action(this.attach_HJGL_WeldingProcedure_WeldingProcedure), new Action(this.detach_HJGL_WeldingProcedure_WeldingProcedure)); this._HJGL_WeldingProcedure_WeldingProcedure_HJGL_BS_Steel1 = new EntitySet(new Action(this.attach_HJGL_WeldingProcedure_WeldingProcedure_HJGL_BS_Steel1), new Action(this.detach_HJGL_WeldingProcedure_WeldingProcedure_HJGL_BS_Steel1)); - this._JGZL_BlowingCleaningItem = new EntitySet(new Action(this.attach_JGZL_BlowingCleaningItem), new Action(this.detach_JGZL_BlowingCleaningItem)); OnCreated(); } @@ -24852,19 +24849,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_BlowingCleaningItem_HJGL_BS_Steel", Storage="_JGZL_BlowingCleaningItem", ThisKey="STE_ID", OtherKey="STE_ID", DeleteRule="NO ACTION")] - public EntitySet JGZL_BlowingCleaningItem - { - get - { - return this._JGZL_BlowingCleaningItem; - } - set - { - this._JGZL_BlowingCleaningItem.Assign(value); - } - } - public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -25016,18 +25000,6 @@ namespace Model this.SendPropertyChanging(); entity.STE_ID2HJGL_BS_Steel = null; } - - private void attach_JGZL_BlowingCleaningItem(JGZL_BlowingCleaningItem entity) - { - this.SendPropertyChanging(); - entity.HJGL_BS_Steel = this; - } - - private void detach_JGZL_BlowingCleaningItem(JGZL_BlowingCleaningItem entity) - { - this.SendPropertyChanging(); - entity.HJGL_BS_Steel = null; - } } [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_BS_TestStandard")] @@ -46420,8 +46392,6 @@ namespace Model private EntitySet _HJGL_PW_JointInfo; - private EntitySet _JGZL_BlowingCleaningItem; - #region 可扩展性方法定义 partial void OnLoaded(); partial void OnValidate(System.Data.Linq.ChangeAction action); @@ -46528,7 +46498,6 @@ namespace Model this._HJGL_BS_Steel = default(EntityRef); this._Project_WorkArea = default(EntityRef); this._HJGL_PW_JointInfo = new EntitySet(new Action(this.attach_HJGL_PW_JointInfo), new Action(this.detach_HJGL_PW_JointInfo)); - this._JGZL_BlowingCleaningItem = new EntitySet(new Action(this.attach_JGZL_BlowingCleaningItem), new Action(this.detach_JGZL_BlowingCleaningItem)); OnCreated(); } @@ -47741,19 +47710,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_BlowingCleaningItem_HJGL_PW_IsoInfo", Storage="_JGZL_BlowingCleaningItem", ThisKey="ISO_ID", OtherKey="ISO_Id", DeleteRule="NO ACTION")] - public EntitySet JGZL_BlowingCleaningItem - { - get - { - return this._JGZL_BlowingCleaningItem; - } - set - { - this._JGZL_BlowingCleaningItem.Assign(value); - } - } - public event PropertyChangingEventHandler PropertyChanging; public event PropertyChangedEventHandler PropertyChanged; @@ -47905,18 +47861,6 @@ namespace Model this.SendPropertyChanging(); entity.HJGL_PW_IsoInfo = null; } - - private void attach_JGZL_BlowingCleaningItem(JGZL_BlowingCleaningItem entity) - { - this.SendPropertyChanging(); - entity.HJGL_PW_IsoInfo = this; - } - - private void detach_JGZL_BlowingCleaningItem(JGZL_BlowingCleaningItem entity) - { - this.SendPropertyChanging(); - entity.HJGL_PW_IsoInfo = null; - } } [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.HJGL_PW_JointChange")] @@ -81525,6 +81469,14 @@ namespace Model private System.Nullable _CompileDate; + private string _CheckReulst1; + + private string _CheckReulst2; + + private string _CheckReulst3; + + private string _CheckReulst4; + private EntityRef _Base_Project; private EntityRef _Sys_User; @@ -81551,6 +81503,14 @@ namespace Model partial void OnCompileManChanged(); partial void OnCompileDateChanging(System.Nullable value); partial void OnCompileDateChanged(); + partial void OnCheckReulst1Changing(string value); + partial void OnCheckReulst1Changed(); + partial void OnCheckReulst2Changing(string value); + partial void OnCheckReulst2Changed(); + partial void OnCheckReulst3Changing(string value); + partial void OnCheckReulst3Changed(); + partial void OnCheckReulst4Changing(string value); + partial void OnCheckReulst4Changed(); #endregion public JGZL_BlowingCleaning() @@ -81729,6 +81689,86 @@ namespace Model } } + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckReulst1", DbType="NVarChar(10)")] + public string CheckReulst1 + { + get + { + return this._CheckReulst1; + } + set + { + if ((this._CheckReulst1 != value)) + { + this.OnCheckReulst1Changing(value); + this.SendPropertyChanging(); + this._CheckReulst1 = value; + this.SendPropertyChanged("CheckReulst1"); + this.OnCheckReulst1Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckReulst2", DbType="NVarChar(10)")] + public string CheckReulst2 + { + get + { + return this._CheckReulst2; + } + set + { + if ((this._CheckReulst2 != value)) + { + this.OnCheckReulst2Changing(value); + this.SendPropertyChanging(); + this._CheckReulst2 = value; + this.SendPropertyChanged("CheckReulst2"); + this.OnCheckReulst2Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckReulst3", DbType="NVarChar(10)")] + public string CheckReulst3 + { + get + { + return this._CheckReulst3; + } + set + { + if ((this._CheckReulst3 != value)) + { + this.OnCheckReulst3Changing(value); + this.SendPropertyChanging(); + this._CheckReulst3 = value; + this.SendPropertyChanged("CheckReulst3"); + this.OnCheckReulst3Changed(); + } + } + } + + [global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_CheckReulst4", DbType="NVarChar(10)")] + public string CheckReulst4 + { + get + { + return this._CheckReulst4; + } + set + { + if ((this._CheckReulst4 != value)) + { + this.OnCheckReulst4Changing(value); + this.SendPropertyChanging(); + this._CheckReulst4 = value; + this.SendPropertyChanged("CheckReulst4"); + this.OnCheckReulst4Changed(); + } + } + } + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_BlowingCleaning_Base_Project", Storage="_Base_Project", ThisKey="ProjectId", OtherKey="ProjectId", IsForeignKey=true)] public Base_Project Base_Project { @@ -81863,10 +81903,6 @@ namespace Model private string _CleaningMedium; - private EntityRef _HJGL_BS_Steel; - - private EntityRef _HJGL_PW_IsoInfo; - private EntityRef _JGZL_BlowingCleaning; #region 可扩展性方法定义 @@ -81891,8 +81927,6 @@ namespace Model public JGZL_BlowingCleaningItem() { - this._HJGL_BS_Steel = default(EntityRef); - this._HJGL_PW_IsoInfo = default(EntityRef); this._JGZL_BlowingCleaning = default(EntityRef); OnCreated(); } @@ -81952,10 +81986,6 @@ namespace Model { if ((this._ISO_Id != value)) { - if (this._HJGL_PW_IsoInfo.HasLoadedOrAssignedValue) - { - throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); - } this.OnISO_IdChanging(value); this.SendPropertyChanging(); this._ISO_Id = value; @@ -81976,10 +82006,6 @@ namespace Model { if ((this._STE_ID != value)) { - if (this._HJGL_BS_Steel.HasLoadedOrAssignedValue) - { - throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); - } this.OnSTE_IDChanging(value); this.SendPropertyChanging(); this._STE_ID = value; @@ -82049,74 +82075,6 @@ namespace Model } } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_BlowingCleaningItem_HJGL_BS_Steel", Storage="_HJGL_BS_Steel", ThisKey="STE_ID", OtherKey="STE_ID", IsForeignKey=true)] - public HJGL_BS_Steel HJGL_BS_Steel - { - get - { - return this._HJGL_BS_Steel.Entity; - } - set - { - HJGL_BS_Steel previousValue = this._HJGL_BS_Steel.Entity; - if (((previousValue != value) - || (this._HJGL_BS_Steel.HasLoadedOrAssignedValue == false))) - { - this.SendPropertyChanging(); - if ((previousValue != null)) - { - this._HJGL_BS_Steel.Entity = null; - previousValue.JGZL_BlowingCleaningItem.Remove(this); - } - this._HJGL_BS_Steel.Entity = value; - if ((value != null)) - { - value.JGZL_BlowingCleaningItem.Add(this); - this._STE_ID = value.STE_ID; - } - else - { - this._STE_ID = default(string); - } - this.SendPropertyChanged("HJGL_BS_Steel"); - } - } - } - - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_BlowingCleaningItem_HJGL_PW_IsoInfo", Storage="_HJGL_PW_IsoInfo", ThisKey="ISO_Id", OtherKey="ISO_ID", IsForeignKey=true)] - public HJGL_PW_IsoInfo HJGL_PW_IsoInfo - { - get - { - return this._HJGL_PW_IsoInfo.Entity; - } - set - { - HJGL_PW_IsoInfo previousValue = this._HJGL_PW_IsoInfo.Entity; - if (((previousValue != value) - || (this._HJGL_PW_IsoInfo.HasLoadedOrAssignedValue == false))) - { - this.SendPropertyChanging(); - if ((previousValue != null)) - { - this._HJGL_PW_IsoInfo.Entity = null; - previousValue.JGZL_BlowingCleaningItem.Remove(this); - } - this._HJGL_PW_IsoInfo.Entity = value; - if ((value != null)) - { - value.JGZL_BlowingCleaningItem.Add(this); - this._ISO_Id = value.ISO_ID; - } - else - { - this._ISO_Id = default(string); - } - this.SendPropertyChanged("HJGL_PW_IsoInfo"); - } - } - } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_BlowingCleaningItem_JGZL_BlowingCleaning", Storage="_JGZL_BlowingCleaning", ThisKey="BlowingCleaningId", OtherKey="BlowingCleaningId", IsForeignKey=true)] public JGZL_BlowingCleaning JGZL_BlowingCleaning { @@ -87164,7 +87122,7 @@ namespace Model private EntityRef _Sys_User; - private EntityRef _JGZL_InsulationAcceptanceRecordItem; + private EntitySet _JGZL_InsulationAcceptanceRecordItem; #region 可扩展性方法定义 partial void OnLoaded(); @@ -87190,7 +87148,7 @@ namespace Model { this._Base_Project = default(EntityRef); this._Sys_User = default(EntityRef); - this._JGZL_InsulationAcceptanceRecordItem = default(EntityRef); + this._JGZL_InsulationAcceptanceRecordItem = new EntitySet(new Action(this.attach_JGZL_InsulationAcceptanceRecordItem), new Action(this.detach_JGZL_InsulationAcceptanceRecordItem)); OnCreated(); } @@ -87410,32 +87368,16 @@ namespace Model } } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_InsulationAcceptanceRecordItem_JGZL_InsulationAcceptanceRecord", Storage="_JGZL_InsulationAcceptanceRecordItem", ThisKey="InsulationAcceptanceRecordId", OtherKey="InsulationAcceptanceRecordItemId", IsUnique=true, IsForeignKey=false, DeleteRule="NO ACTION")] - public JGZL_InsulationAcceptanceRecordItem JGZL_InsulationAcceptanceRecordItem + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_InsulationAcceptanceRecordItem_JGZL_InsulationAcceptanceRecord", Storage="_JGZL_InsulationAcceptanceRecordItem", ThisKey="InsulationAcceptanceRecordId", OtherKey="InsulationAcceptanceRecordId", DeleteRule="NO ACTION")] + public EntitySet JGZL_InsulationAcceptanceRecordItem { get { - return this._JGZL_InsulationAcceptanceRecordItem.Entity; + return this._JGZL_InsulationAcceptanceRecordItem; } set { - JGZL_InsulationAcceptanceRecordItem previousValue = this._JGZL_InsulationAcceptanceRecordItem.Entity; - if (((previousValue != value) - || (this._JGZL_InsulationAcceptanceRecordItem.HasLoadedOrAssignedValue == false))) - { - this.SendPropertyChanging(); - if ((previousValue != null)) - { - this._JGZL_InsulationAcceptanceRecordItem.Entity = null; - previousValue.JGZL_InsulationAcceptanceRecord = null; - } - this._JGZL_InsulationAcceptanceRecordItem.Entity = value; - if ((value != null)) - { - value.JGZL_InsulationAcceptanceRecord = this; - } - this.SendPropertyChanged("JGZL_InsulationAcceptanceRecordItem"); - } + this._JGZL_InsulationAcceptanceRecordItem.Assign(value); } } @@ -87458,6 +87400,18 @@ namespace Model this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } + + private void attach_JGZL_InsulationAcceptanceRecordItem(JGZL_InsulationAcceptanceRecordItem entity) + { + this.SendPropertyChanging(); + entity.JGZL_InsulationAcceptanceRecord = this; + } + + private void detach_JGZL_InsulationAcceptanceRecordItem(JGZL_InsulationAcceptanceRecordItem entity) + { + this.SendPropertyChanging(); + entity.JGZL_InsulationAcceptanceRecord = null; + } } [global::System.Data.Linq.Mapping.TableAttribute(Name="dbo.JGZL_InsulationAcceptanceRecordItem")] @@ -87511,10 +87465,6 @@ namespace Model { if ((this._InsulationAcceptanceRecordItemId != value)) { - if (this._JGZL_InsulationAcceptanceRecord.HasLoadedOrAssignedValue) - { - throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); - } this.OnInsulationAcceptanceRecordItemIdChanging(value); this.SendPropertyChanging(); this._InsulationAcceptanceRecordItemId = value; @@ -87535,6 +87485,10 @@ namespace Model { if ((this._InsulationAcceptanceRecordId != value)) { + if (this._JGZL_InsulationAcceptanceRecord.HasLoadedOrAssignedValue) + { + throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException(); + } this.OnInsulationAcceptanceRecordIdChanging(value); this.SendPropertyChanging(); this._InsulationAcceptanceRecordId = value; @@ -87604,7 +87558,7 @@ namespace Model } } - [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_InsulationAcceptanceRecordItem_JGZL_InsulationAcceptanceRecord", Storage="_JGZL_InsulationAcceptanceRecord", ThisKey="InsulationAcceptanceRecordItemId", OtherKey="InsulationAcceptanceRecordId", IsForeignKey=true)] + [global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_JGZL_InsulationAcceptanceRecordItem_JGZL_InsulationAcceptanceRecord", Storage="_JGZL_InsulationAcceptanceRecord", ThisKey="InsulationAcceptanceRecordId", OtherKey="InsulationAcceptanceRecordId", IsForeignKey=true)] public JGZL_InsulationAcceptanceRecord JGZL_InsulationAcceptanceRecord { get @@ -87621,17 +87575,17 @@ namespace Model if ((previousValue != null)) { this._JGZL_InsulationAcceptanceRecord.Entity = null; - previousValue.JGZL_InsulationAcceptanceRecordItem = null; + previousValue.JGZL_InsulationAcceptanceRecordItem.Remove(this); } this._JGZL_InsulationAcceptanceRecord.Entity = value; if ((value != null)) { - value.JGZL_InsulationAcceptanceRecordItem = this; - this._InsulationAcceptanceRecordItemId = value.InsulationAcceptanceRecordId; + value.JGZL_InsulationAcceptanceRecordItem.Add(this); + this._InsulationAcceptanceRecordId = value.InsulationAcceptanceRecordId; } else { - this._InsulationAcceptanceRecordItemId = default(string); + this._InsulationAcceptanceRecordId = default(string); } this.SendPropertyChanged("JGZL_InsulationAcceptanceRecord"); }