From 41e293d58630d4f4ec22dff6b6e385e86242cd4c Mon Sep 17 00:00:00 2001 From: wendy <408182087@qq.com> Date: Wed, 11 Mar 2026 17:28:38 +0800 Subject: [PATCH] =?UTF-8?q?20260311=20=E7=AE=A1=E9=81=93=E9=9D=99=E7=94=B5?= =?UTF-8?q?=E6=8E=A5=E5=9C=B0=E6=B5=8B=E8=AF=95=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BLL/JGZL/ElectrostaticGroundingService.cs | 22 + .../Fastreport/JGZL/管道静电接地测试记录.frx | 47 +- .../JGZL/ElectrostaticGrounding.aspx | 97 +-- .../JGZL/ElectrostaticGrounding.aspx.cs | 556 ++++++++++++------ .../ElectrostaticGrounding.aspx.designer.cs | 139 +++-- .../JGZL/InsulationAcceptanceRecord.aspx | 9 +- .../JGZL/InsulationAcceptanceRecord.aspx.cs | 16 +- ...nsulationAcceptanceRecord.aspx.designer.cs | 9 - 8 files changed, 601 insertions(+), 294 deletions(-) diff --git a/HJGL_DS/BLL/JGZL/ElectrostaticGroundingService.cs b/HJGL_DS/BLL/JGZL/ElectrostaticGroundingService.cs index 1700140..b72933a 100644 --- a/HJGL_DS/BLL/JGZL/ElectrostaticGroundingService.cs +++ b/HJGL_DS/BLL/JGZL/ElectrostaticGroundingService.cs @@ -4,6 +4,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Web.UI.WebControls; namespace BLL { @@ -22,6 +23,16 @@ namespace BLL return Funs.DB.JGZL_ElectrostaticGrounding.FirstOrDefault(e => e.ElectrostaticGroundingId == electrostaticGroundingId); } + /// + /// 获取管道静电接地测试记录列表记录 + /// + /// + /// + public static List GetElectrostaticGroundingLists(string projectId) + { + return (from x in Funs.DB.JGZL_ElectrostaticGrounding where x.ProjectId == projectId select x).ToList(); + } + /// /// 添加 /// @@ -84,5 +95,16 @@ namespace BLL db.SubmitChanges(); } } + + public static void DeleteDeleteElectrostaticGroundingByProjectId(string projectId) + { + SGGLDB db = Funs.DB; + var report = (from x in db.JGZL_ElectrostaticGrounding where x.ProjectId == projectId select x).ToList(); + if (report.Count > 0) + { + db.JGZL_ElectrostaticGrounding.DeleteAllOnSubmit(report); + db.SubmitChanges(); + } + } } } diff --git a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道静电接地测试记录.frx b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道静电接地测试记录.frx index 8cfd38a..11d2d80 100644 --- a/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道静电接地测试记录.frx +++ b/HJGL_DS/FineUIPro.Web/File/Fastreport/JGZL/管道静电接地测试记录.frx @@ -1,7 +1,48 @@  - + + using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Drawing; +using System.Data; +using FastReport; +using FastReport.Data; +using FastReport.Dialog; +using FastReport.Barcode; +using FastReport.Table; +using FastReport.Utils; + +namespace FastReport +{ + public class ReportScript + { + + private void Table3_ManualBuild(object sender, EventArgs e) + { + DataSourceBase rowData = Report.GetDataSource("Data"); + // init the data source + rowData.Init(); + + // print the first table row - it is a header + + // now enumerate the data source and print the table body + while (rowData.HasMoreRows) + { + // print the table body + Table3.PrintRow(0); + Table3.PrintColumns(); + + // go next data source row + rowData.Next(); + } + } + } +} + - + @@ -84,7 +125,7 @@ - + diff --git a/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx b/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx index 0fbc327..4ce85a9 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx +++ b/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx @@ -37,12 +37,14 @@ - + <%-- - + --%> + + @@ -54,42 +56,75 @@ EnableColumnLines="true" ClicksToEdit="1" DataIDField="ElectrostaticGroundingId" AllowSorting="true" SortField="CompileDate" SortDirection="Desc" OnSort="Grid1_Sort" AllowPaging="true" IsDatabasePaging="true" PageSize="10" OnPageIndexChange="Grid1_PageIndexChange" - EnableTextSelection="True" AutoScroll="true" EnableRowDoubleClickEvent="true" OnRowDoubleClick="Grid1_RowDoubleClick"> + EnableTextSelection="True" AutoScroll="true" OnPreDataBound="Grid1_PreDataBound"> - + FieldType="String" HeaderTextAlign="Center" TextAlign="Left" Width="260px"> + + + - + + + + + - - + + + + + + + + + + + - + + + + + - - - + + + + + + + + + + + + + + + - - - + + - - - @@ -108,30 +143,14 @@ - + --%> - - - - - - - diff --git a/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx.cs b/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx.cs index a53b9f3..ce64d78 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx.cs @@ -1,18 +1,56 @@ using BLL; +using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; -using System.Data.SqlClient; using System.Data; +using System.Data.SqlClient; +using System.IO; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; -using System.IO; namespace FineUIPro.Web.JGZL { public partial class ElectrostaticGrounding : PageBase { + #region 定义项 + /// + /// 主键 + /// + private string ElectrostaticGroundingId + { + get + { + return (string)ViewState["ElectrostaticGroundingId"]; + } + set + { + ViewState["ElectrostaticGroundingId"] = value; + } + } + + /// + /// 项目Id + /// + private string ProjectId + { + get + { + return (string)ViewState["ProjectId"]; + } + set + { + ViewState["ProjectId"] = value; + } + } + + /// + /// 定义集合 + /// + private static List items = new List(); + #endregion + #region 加载页面 /// /// 加载页面 @@ -34,7 +72,65 @@ 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; + + //管线 + this.drpIsoId.DataTextField = "ISO_IsoNo"; + this.drpIsoId.DataValueField = "ISO_IsoNo"; + this.drpIsoId.DataSource = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + this.drpIsoId.DataBind(); + + PageInfo(); + } + } + + private void PageInfo() + { + items.Clear(); + if (!string.IsNullOrEmpty(this.ProjectId)) + { + var reportLists = BLL.ElectrostaticGroundingService.GetElectrostaticGroundingLists(this.ProjectId); + if (reportLists.Count > 0) + { + var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + foreach (var item in isoLists) + { + var iso = (from x in Funs.DB.JGZL_ElectrostaticGrounding where x.ProjectId == this.ProjectId && x.PipelineCode == item.ISO_IsoNo select x).FirstOrDefault(); + if (iso == null) + { + Model.JGZL_ElectrostaticGrounding newReport = new Model.JGZL_ElectrostaticGrounding(); + newReport.ElectrostaticGroundingId = SQLHelper.GetNewID(); + newReport.ProjectId = this.ProjectId; + newReport.PipelineCode = item.ISO_IsoNo; + reportLists.Add(newReport); + } + } + if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) + { + reportLists = reportLists.Where(x => x.PipelineCode.Contains(this.drpIsoId.SelectedValue)).ToList(); + } + this.Grid1.DataSource = reportLists; + this.Grid1.DataBind(); + } + else + { + var isoLists = BLL.HJGL_PW_IsoInfoService.GetIsoInfoByProjectId(this.ProjectId); + foreach (var iso in isoLists) + { + Model.JGZL_ElectrostaticGrounding newReport = new Model.JGZL_ElectrostaticGrounding(); + newReport.ElectrostaticGroundingId = SQLHelper.GetNewID(); + newReport.ProjectId = this.ProjectId; + newReport.PipelineCode = iso.ISO_IsoNo; + items.Add(newReport); + } + + if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue) && this.drpIsoId.SelectedValue != BLL.Const._Null) + { + items = items.Where(x => x.PipelineCode.Contains(this.drpIsoId.SelectedValue)).ToList(); + } + this.Grid1.DataSource = items; + this.Grid1.DataBind(); + } } } #endregion @@ -82,7 +178,9 @@ namespace FineUIPro.Web.JGZL { if (this.tvControlItem.SelectedNodeID != "0") { - this.BindGrid(); + this.ProjectId = this.tvControlItem.SelectedNodeID; + PageInfo(); + //this.BindGrid(); } } #endregion @@ -91,54 +189,54 @@ namespace FineUIPro.Web.JGZL /// /// 数据绑定 /// - private void BindGrid() - { - //string projectIds = BLL.Base_ProjectService.GetStrOnProjectIds(this.CurrUser.UserId, "1"); - string strSql = @"select g.ElectrostaticGroundingId, - g.ProjectId, - g.PipelineCode, - g.ConnectionType, - g.BWSpecification, - g.BWMaterial, - g.BWResistance, - g.GWSpecification, - g.GWMaterial, - g.GWResistance, - g.CompileMan, - g.CompileDate, - u.UserName as CompileManName - from JGZL_ElectrostaticGrounding g - left join Sys_User u on u.UserId=g.CompileMan where 1=1"; - List listStr = new List(); - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - strSql += " AND g.ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID)); - } - if (!string.IsNullOrEmpty(this.txtStartDate.Text)) - { - strSql += " AND g.CompileDate >=@satartDate"; - listStr.Add(new SqlParameter("@satartDate", Funs.GetNewDateTime(this.txtStartDate.Text))); - } - if (!string.IsNullOrEmpty(this.txtEndDate.Text)) - { - strSql += " AND g.CompileDate <=@endDate"; - listStr.Add(new SqlParameter("@endDate", Funs.GetNewDateTime(this.txtEndDate.Text))); - } - //else - //{ - // strSql += " AND CHARINDEX(ProjectId,@ProjectId)>0 "; - // listStr.Add(new SqlParameter("@ProjectId", projectIds)); - //} - SqlParameter[] parameter = listStr.ToArray(); - DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); - // 2.获取当前分页数据 - Grid1.RecordCount = tb.Rows.Count; - //tb = GetFilteredTable(Grid1.FilteredData, tb); - var table = this.GetPagedDataTable(Grid1, tb); - Grid1.DataSource = table; - Grid1.DataBind(); - } + //private void BindGrid() + //{ + // //string projectIds = BLL.Base_ProjectService.GetStrOnProjectIds(this.CurrUser.UserId, "1"); + // string strSql = @"select g.ElectrostaticGroundingId, + // g.ProjectId, + // g.PipelineCode, + // g.ConnectionType, + // g.BWSpecification, + // g.BWMaterial, + // g.BWResistance, + // g.GWSpecification, + // g.GWMaterial, + // g.GWResistance, + // g.CompileMan, + // g.CompileDate, + // u.UserName as CompileManName + // from JGZL_ElectrostaticGrounding g + // left join Sys_User u on u.UserId=g.CompileMan where 1=1"; + // List listStr = new List(); + // if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + // { + // strSql += " AND g.ProjectId = @ProjectId"; + // listStr.Add(new SqlParameter("@ProjectId", this.tvControlItem.SelectedNodeID)); + // } + // //if (!string.IsNullOrEmpty(this.txtStartDate.Text)) + // //{ + // // strSql += " AND g.CompileDate >=@satartDate"; + // // listStr.Add(new SqlParameter("@satartDate", Funs.GetNewDateTime(this.txtStartDate.Text))); + // //} + // //if (!string.IsNullOrEmpty(this.txtEndDate.Text)) + // //{ + // // strSql += " AND g.CompileDate <=@endDate"; + // // listStr.Add(new SqlParameter("@endDate", Funs.GetNewDateTime(this.txtEndDate.Text))); + // //} + // //else + // //{ + // // strSql += " AND CHARINDEX(ProjectId,@ProjectId)>0 "; + // // listStr.Add(new SqlParameter("@ProjectId", projectIds)); + // //} + // SqlParameter[] parameter = listStr.ToArray(); + // DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); + // // 2.获取当前分页数据 + // Grid1.RecordCount = tb.Rows.Count; + // //tb = GetFilteredTable(Grid1.FilteredData, tb); + // var table = this.GetPagedDataTable(Grid1, tb); + // Grid1.DataSource = table; + // Grid1.DataBind(); + //} #endregion #region 分页排序 @@ -150,7 +248,8 @@ namespace FineUIPro.Web.JGZL /// protected void Grid1_PageIndexChange(object sender, GridPageEventArgs e) { - BindGrid(); + //BindGrid(); + PageInfo(); } #endregion @@ -162,7 +261,8 @@ namespace FineUIPro.Web.JGZL /// protected void Grid1_Sort(object sender, GridSortEventArgs e) { - BindGrid(); + //BindGrid(); + PageInfo(); } #endregion @@ -175,7 +275,8 @@ namespace FineUIPro.Web.JGZL protected void ddlPageSize_SelectedIndexChanged(object sender, EventArgs e) { Grid1.PageSize = Convert.ToInt32(ddlPageSize.SelectedValue); - BindGrid(); + //BindGrid(); + PageInfo(); } #endregion #endregion @@ -188,9 +289,11 @@ namespace FineUIPro.Web.JGZL /// protected void drpProjectId_SelectedIndexChanged(object sender, EventArgs e) { - this.tvControlItem.SelectedNodeID = this.drpProjectId.SelectedValue; + this.ProjectId= this.drpProjectId.SelectedValue; this.InitTreeMenu(); - BindGrid(); + this.tvControlItem.SelectedNodeID = this.ProjectId; + PageInfo(); + //BindGrid(); } /// @@ -200,7 +303,7 @@ namespace FineUIPro.Web.JGZL /// protected void TextBox_TextChanged(object sender, EventArgs e) { - this.BindGrid(); + //this.BindGrid(); } #endregion @@ -212,9 +315,9 @@ namespace FineUIPro.Web.JGZL /// protected void btnPrint_Click(object sender, EventArgs e) { - string projectId = this.tvControlItem.SelectedNodeID; + //string projectId = this.tvControlItem.SelectedNodeID; - if (projectId != null) + if (!string.IsNullOrEmpty(this.ProjectId)) { string initTemplatePath = ""; string rootPath = Server.MapPath("~/"); @@ -234,12 +337,13 @@ namespace FineUIPro.Web.JGZL g.CompileDate, u.UserName as CompileManName from JGZL_ElectrostaticGrounding g - left join Sys_User u on u.UserId=g.CompileMan where 1=1"; + left join Sys_User u on u.UserId=g.CompileMan where g.ProjectId = @ProjectId"; List listStr = new List(); - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + listStr.Add(new SqlParameter("@ProjectId", this.ProjectId)); + if (!string.IsNullOrEmpty(this.drpIsoId.SelectedValue)) { - strSql += " AND g.ProjectId = @ProjectId"; - listStr.Add(new SqlParameter("@ProjectId", projectId)); + strSql += " and g.PipelineCode like @isoNo"; + listStr.Add(new SqlParameter("@isoNo", "%" + this.drpIsoId.SelectedValue + "%")); } SqlParameter[] parameter = listStr.ToArray(); DataTable tb = SQLHelper.GetDataTableRunText(strSql, parameter); @@ -275,7 +379,7 @@ namespace FineUIPro.Web.JGZL BLL.Common.FastReportService.AddFastreportTable(dt); Dictionary keyValuePairs = new Dictionary(); - keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(projectId).ProjectName); + keyValuePairs.Add("ProjectName", BLL.Base_ProjectService.GetProjectByProjectId(this.ProjectId).ProjectName); keyValuePairs.Add("CompileMan", tb.Rows[0]["CompileManName"].ToString()); if (!string.IsNullOrEmpty(tb.Rows[0]["CompileDate"].ToString())) { @@ -314,7 +418,36 @@ namespace FineUIPro.Web.JGZL { if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ElectrostaticGroundingEdit.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 + { + { "ElectrostaticGroundingId", Guid.NewGuid() }, + { "PipelineCode", "" }, + { "ConnectionType", "" }, + { "BWSpecification", "" }, + { "BWMaterial", "" }, + { "BWResistance", "" }, + { "GWSpecification", "" }, + { "GWMaterial", "" }, + { "GWResistance", "" }, + { + "Delete3", + String.Format("", + GetDeleteScriptGrid1(), IconHelper.GetResolvedIconUrl(Icon.Delete)) + } + }; + list.Add(defaultObj); + Grid1.DataSource = list; + Grid1.DataBind(); + + //PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("TeamWeldingInspectionEdit.aspx?projectId={0}", this.tvControlItem.SelectedNodeID, "新增 - "))); } else { @@ -323,126 +456,143 @@ 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_ElectrostaticGroundingMenuId, BLL.Const.BtnModify)) - { - if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) - { - if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) - { - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ElectrostaticGroundingEdit.aspx?electrostaticGroundingId={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_ElectrostaticGroundingMenuId, BLL.Const.BtnModify)) + // { + // if (!string.IsNullOrEmpty(this.tvControlItem.SelectedNodeID)) + // { + // if (!string.IsNullOrEmpty(this.Grid1.SelectedRowID)) + // { + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ElectrostaticGroundingEdit.aspx?electrostaticGroundingId={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_ElectrostaticGroundingMenuId, BLL.Const.BtnModify)) - { - if (Grid1.SelectedRowIndexArray.Length == 0) - { - Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); - return; - } - PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ElectrostaticGroundingEdit.aspx?electrostaticGroundingId={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_ElectrostaticGroundingMenuId, BLL.Const.BtnModify)) + // { + // if (Grid1.SelectedRowIndexArray.Length == 0) + // { + // Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning); + // return; + // } + // PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("ElectrostaticGroundingEdit.aspx?electrostaticGroundingId={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_ElectrostaticGroundingMenuId, 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_ElectrostaticGroundingMenuId, 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.ElectrostaticGroundingService.DeleteElectrostaticGroundingById(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.ElectrostaticGroundingService.DeleteElectrostaticGroundingById(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 @@ -452,11 +602,11 @@ namespace FineUIPro.Web.JGZL /// /// /// - protected void Window1_Close(object sender, WindowCloseEventArgs e) - { - this.InitTreeMenu();//加载树 - this.BindGrid(); - } + //protected void Window1_Close(object sender, WindowCloseEventArgs e) + //{ + // this.InitTreeMenu();//加载树 + // this.BindGrid(); + //} #endregion #region 查询 @@ -467,18 +617,80 @@ namespace FineUIPro.Web.JGZL /// protected void Text_TextChanged(object sender, EventArgs e) { - DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text); - DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text); - if (startDate != null && endDate != null && startDate > endDate) + //DateTime startDate = Convert.ToDateTime(this.txtStartDate.Text); + //DateTime endDate = Convert.ToDateTime(this.txtEndDate.Text); + //if (startDate != null && endDate != null && startDate > endDate) + //{ + // Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning); + // return; + //} + //else + //{ + // BindGrid(); + //} + } + #endregion + + #region 提交按钮 + /// + /// 提交按钮 + /// + /// + /// + protected void btnSave_Click(object sender, EventArgs e) + { + if (CommonService.GetAllButtonPowerList(this.CurrUser.LoginProjectId, this.CurrUser.UserId, Const.JGZL_ElectrostaticGroundingMenuId, Const.BtnSave)) { - Alert.ShowInTop("开始时间不能大于结束时间!", MessageBoxIcon.Warning); - return; + items.Clear(); + BLL.ElectrostaticGroundingService.DeleteDeleteElectrostaticGroundingByProjectId(this.ProjectId); + JArray teamGroupData = Grid1.GetMergedData(); + foreach (JObject teamGroupRow in teamGroupData) + { + JObject values = teamGroupRow.Value("values"); + int rowIndex = teamGroupRow.Value("index"); + Model.JGZL_ElectrostaticGrounding newDetail = new Model.JGZL_ElectrostaticGrounding + { + ElectrostaticGroundingId = values.Value("ElectrostaticGroundingId"), + ProjectId = this.ProjectId, + PipelineCode = values.Value("PipelineCode"), + ConnectionType = values.Value("ConnectionType"), + BWSpecification = values.Value("BWSpecification"), + BWMaterial = values.Value("BWMaterial"), + BWResistance = Funs.GetNewDecimal(values.Value("BWResistance")), + GWSpecification = values.Value("GWSpecification"), + GWMaterial = values.Value("GWMaterial"), + GWResistance = Funs.GetNewDecimal(values.Value("GWResistance")), + CompileMan = this.CurrUser.UserId, + CompileDate = DateTime.Now + }; + items.Add(newDetail); + } + try + { + if (items.Count > 0) + { + Funs.DB.JGZL_ElectrostaticGrounding.InsertAllOnSubmit(items); + } + Funs.DB.SubmitChanges(); + } + catch (Exception) + { + return; + } + ShowNotify("保存成功!", MessageBoxIcon.Success); + //PageContext.RegisterStartupScript(ActiveWindow.GetHidePostBackReference()); } else { - BindGrid(); + Alert.ShowInTop("您没有这个权限,请与管理员联系!", MessageBoxIcon.Warning); + return; } } #endregion + + protected void drpIsoId_SelectedIndexChanged(object sender, EventArgs e) + { + PageInfo(); + } } } \ No newline at end of file diff --git a/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx.designer.cs index 4342194..b666437 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/ElectrostaticGrounding.aspx.designer.cs @@ -96,31 +96,13 @@ namespace FineUIPro.Web.JGZL protected global::FineUIPro.Toolbar Toolbar2; /// - /// txtStartDate 控件。 + /// drpIsoId 控件。 /// /// /// 自动生成的字段。 /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 /// - protected global::FineUIPro.DatePicker txtStartDate; - - /// - /// lblTo 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Label lblTo; - - /// - /// txtEndDate 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.DatePicker txtEndDate; + protected global::FineUIPro.DropDownList drpIsoId; /// /// ToolbarFill1 控件。 @@ -140,6 +122,15 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Button btnAdd; + /// + /// btnSave 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.Button btnSave; + /// /// btnPrint 控件。 /// @@ -158,6 +149,78 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.Grid Grid1; + /// + /// txtPipelineCode 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtPipelineCode; + + /// + /// txtConnectionType 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtConnectionType; + + /// + /// txtBWSpecification 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBWSpecification; + + /// + /// txtBWMaterial 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBWMaterial; + + /// + /// txtBWResistance 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtBWResistance; + + /// + /// txtGWSpecification 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtGWSpecification; + + /// + /// txtGWMaterial 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtGWMaterial; + + /// + /// txtGWResistance 控件。 + /// + /// + /// 自动生成的字段。 + /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 + /// + protected global::FineUIPro.TextBox txtGWResistance; + /// /// ToolbarSeparator1 控件。 /// @@ -185,15 +248,6 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.DropDownList ddlPageSize; - /// - /// Window1 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.Window Window1; - /// /// WindowPrint 控件。 /// @@ -202,32 +256,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/InsulationAcceptanceRecord.aspx b/HJGL_DS/FineUIPro.Web/JGZL/InsulationAcceptanceRecord.aspx index 1c3a81f..6b8cf9b 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/InsulationAcceptanceRecord.aspx +++ b/HJGL_DS/FineUIPro.Web/JGZL/InsulationAcceptanceRecord.aspx @@ -57,17 +57,12 @@ - + - - - - - - + diff --git a/HJGL_DS/FineUIPro.Web/JGZL/InsulationAcceptanceRecord.aspx.cs b/HJGL_DS/FineUIPro.Web/JGZL/InsulationAcceptanceRecord.aspx.cs index a5ca522..8fc929c 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/InsulationAcceptanceRecord.aspx.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/InsulationAcceptanceRecord.aspx.cs @@ -89,7 +89,7 @@ namespace FineUIPro.Web.JGZL this.InsulationAcceptanceRecordId = string.Empty; this.txtHeatInsulationArea.Text = string.Empty; this.txtInsulationStructure.Text = string.Empty; - this.txtAcceptanceConclusion.Text = string.Empty; + //this.txtAcceptanceConclusion.Text = string.Empty; if (!string.IsNullOrEmpty(this.ProjectId)) { var report = BLL.InsulationAcceptanceRecordService.GetInsulationAcceptanceRecordByProjectId(this.ProjectId); @@ -98,7 +98,7 @@ namespace FineUIPro.Web.JGZL this.InsulationAcceptanceRecordId = report.InsulationAcceptanceRecordId; this.txtHeatInsulationArea.Text = report.HeatInsulationArea; this.txtInsulationStructure.Text = report.InsulationStructure; - this.txtAcceptanceConclusion.Text = report.AcceptanceConclusion; + //this.txtAcceptanceConclusion.Text = report.AcceptanceConclusion; items = BLL.InsulationAcceptanceRecordItemService.GetItemsByInsulationAcceptanceRecordId(this.InsulationAcceptanceRecordId); this.Grid1.DataSource = items; @@ -600,7 +600,7 @@ namespace FineUIPro.Web.JGZL Model.JGZL_InsulationAcceptanceRecord newReport = new Model.JGZL_InsulationAcceptanceRecord(); newReport.HeatInsulationArea = this.txtHeatInsulationArea.Text.Trim(); newReport.InsulationStructure = this.txtInsulationStructure.Text.Trim(); - newReport.AcceptanceConclusion = this.txtAcceptanceConclusion.Text.Trim(); + //newReport.AcceptanceConclusion = this.txtAcceptanceConclusion.Text.Trim(); if (!string.IsNullOrEmpty(this.InsulationAcceptanceRecordId)) { newReport.InsulationAcceptanceRecordId = this.InsulationAcceptanceRecordId; @@ -693,11 +693,11 @@ namespace FineUIPro.Web.JGZL { insulationStructure.Text = this.txtInsulationStructure.Text; } - Bookmark acceptanceConclusion = doc.Range.Bookmarks["AcceptanceConclusion"]; - if (acceptanceConclusion != null) - { - acceptanceConclusion.Text = this.txtAcceptanceConclusion.Text; - } + //Bookmark acceptanceConclusion = doc.Range.Bookmarks["AcceptanceConclusion"]; + //if (acceptanceConclusion != null) + //{ + // acceptanceConclusion.Text = this.txtAcceptanceConclusion.Text; + //} var itemList = BLL.InsulationAcceptanceRecordItemService.GetItemsByInsulationAcceptanceRecordId(this.InsulationAcceptanceRecordId); diff --git a/HJGL_DS/FineUIPro.Web/JGZL/InsulationAcceptanceRecord.aspx.designer.cs b/HJGL_DS/FineUIPro.Web/JGZL/InsulationAcceptanceRecord.aspx.designer.cs index 5c25297..07e09f6 100644 --- a/HJGL_DS/FineUIPro.Web/JGZL/InsulationAcceptanceRecord.aspx.designer.cs +++ b/HJGL_DS/FineUIPro.Web/JGZL/InsulationAcceptanceRecord.aspx.designer.cs @@ -158,15 +158,6 @@ namespace FineUIPro.Web.JGZL /// protected global::FineUIPro.TextArea txtInsulationStructure; - /// - /// txtAcceptanceConclusion 控件。 - /// - /// - /// 自动生成的字段。 - /// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。 - /// - protected global::FineUIPro.TextArea txtAcceptanceConclusion; - /// /// Grid1 控件。 ///