From ad6116708bf8dfa0d044dbda82bd64619382307d Mon Sep 17 00:00:00 2001 From: gaofei1985 <181547018@qq.com> Date: Sat, 31 Jan 2026 15:09:14 +0800 Subject: [PATCH] 1 --- .../HJGL/WeldingManage/JointInfo.aspx | 6 +- .../HJGL/WeldingManage/JointInfo.aspx.cs | 83 ++++++++++++++----- 2 files changed, 67 insertions(+), 22 deletions(-) diff --git a/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx b/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx index 45f5f84..e3c37e1 100644 --- a/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx +++ b/HJGL_DS/FineUIPro.Web/HJGL/WeldingManage/JointInfo.aspx @@ -156,12 +156,14 @@ runat="server" BoxFlex="1" DataKeyNames="JOT_ID" AllowCellEditing="true" AllowColumnLocking="true" EnableColumnLines="true" ClicksToEdit="2" DataIDField="JOT_ID" AllowSorting="true" SortField="JOTY_Group,Sort1,Sort2,Sort3,Sort4,Sort5" SortDirection="ASC" OnSort="Grid1_Sort" AllowPaging="true" - IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" - EnableTextSelection="True" AutoScroll="true" EnableRowDoubleClickEvent="true" + IsDatabasePaging="true" PageSize="15" OnPageIndexChange="Grid1_PageIndexChange" OnRowCommand="Grid1_RowCommand" + EnableTextSelection="True" AutoScroll="true" EnableRowDoubleClickEvent="true" EnableCheckBoxSelect="true" KeepCurrentSelection="true" OnRowDoubleClick="Grid1_RowDoubleClick" OnRowDataBound="Grid1_RowDataBound"> <%----%> + <%----%> + /// 定义集合 + /// + private static List list = new List(); + #region 加载 /// /// 加载页面 @@ -492,13 +497,13 @@ namespace FineUIPro.Web.HJGL.WeldingManage { isShow = false; } - bool isDelete = false; + string err = string.Empty; foreach (int rowIndex in Grid1.SelectedRowIndexArray) { string rowID = Grid1.DataKeys[rowIndex][0].ToString(); - if (judgementDelete(rowID, isShow)) + string content = judgementDelete(rowID, isShow); + if (string.IsNullOrEmpty(content)) { - isDelete = true; Model.SGGLDB db = Funs.DB; var hotProessTrustItem = db.HJGL_CH_HotProessTrustItem.FirstOrDefault(x => x.JOT_ID == rowID); if (hotProessTrustItem != null) @@ -520,11 +525,19 @@ namespace FineUIPro.Web.HJGL.WeldingManage BLL.HJGL_PW_JointInfoService.DeleteJointInfo(rowID); BLL.Sys_LogService.AddLog(BLL.Const.System_3, this.CurrUser.LoginProjectId, this.CurrUser.UserId, "删除焊口信息"); } + else + { + err += content; + } } - if (isDelete) + if (string.IsNullOrEmpty(err)) { Alert.ShowInTop("删除成功!", MessageBoxIcon.Success); } + else + { + Alert.ShowInTop(err, MessageBoxIcon.Warning); + } this.BindGrid(); } else @@ -1065,7 +1078,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage /// 判断是否可以删除 /// /// - private bool judgementDelete(string id, bool isShow) + private string judgementDelete(string id, bool isShow) { string content = string.Empty; //if (BLL.Funs.DB.HJGL_CH_HotProessTrustItem.FirstOrDefault(x => x.JOT_ID == id) != null @@ -1076,7 +1089,7 @@ namespace FineUIPro.Web.HJGL.WeldingManage var joint = BLL.HJGL_PW_JointInfoService.GetJointInfoByJotID(id); if (!string.IsNullOrEmpty(joint.DReportID)) { - content = "该焊口已提交焊接记录,不能删除!"; + content = "焊口"+joint.JOT_JointNo+"已提交焊接记录,不能删除!"; } var batchDetail = BLL.HJGL_BO_BatchDetailService.GetBatchDetailByJotId(id); if (batchDetail != null) @@ -1084,22 +1097,22 @@ namespace FineUIPro.Web.HJGL.WeldingManage var batch = BLL.HJGL_BO_BatchService.GetBatchById(batchDetail.BatchId); if (batch.BatchIsClosed == true) { - content = "该焊口所在批已关闭,不能删除!"; + content = "焊口"+ joint.JOT_JointNo + "所在批已关闭,不能删除!"; } } - - if (string.IsNullOrEmpty(content)) - { - return true; - } - else - { - if (isShow) - { - Alert.ShowInTop(content, MessageBoxIcon.Error); - } - return false; - } + return content; + //if (string.IsNullOrEmpty(content)) + //{ + // return true; + //} + //else + //{ + // if (isShow) + // { + // Alert.ShowInTop(content, MessageBoxIcon.Error); + // } + // return false; + //} } #endregion @@ -1274,5 +1287,35 @@ namespace FineUIPro.Web.HJGL.WeldingManage return; } } + + #region Grid行点击事件 + /// + /// Grid1行点击事件 + /// + /// + /// + protected void Grid1_RowCommand(object sender, GridCommandEventArgs e) + { + string rowID = Grid1.DataKeys[e.RowIndex][0].ToString(); + if (e.CommandName == "IsSelected") + { + CheckBoxField checkField = (CheckBoxField)Grid1.FindColumn("ckbIsSelected"); + if (checkField.GetCheckedState(e.RowIndex)) + { + if (!list.Contains(rowID)) + { + list.Add(rowID); + } + } + else + { + if (list.Contains(rowID)) + { + list.Remove(rowID); + } + } + } + } + #endregion } } \ No newline at end of file