From 23e55c258ae5ef93a8d684be60271d1af9e730c9 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期三, 20 十一月 2024 15:52:27 +0800
Subject: [PATCH] 工单

---
 DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs |   51 +++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 45 insertions(+), 6 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs
index 7678abf..5f416ae 100644
--- a/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs
+++ b/DevApp/Gs.DevApp/DevFrm/QC/Frm_MesSysLookups.cs
@@ -6,6 +6,7 @@
 using System.Windows.Forms;
 using DevExpress.XtraEditors;
 using DevExpress.XtraEditors.Controls;
+using DevExpress.XtraGrid.Views.Base.ViewInfo;
 using DevExpress.XtraGrid.Views.Grid;
 using Gs.DevApp.DevFrm.QC.Models;
 using Gs.DevApp.Entity;
@@ -27,6 +28,8 @@
             toolBarMenu1.btnSaveClick += ToolBarMenu1_btnSaveClick;
             toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick;
             toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
+            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
+            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
             gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
             getPageList(1, UtilityHelper.GetPageSize());
             pageBar1.PagerEvent += PageBar1_PagerEvent;
@@ -69,7 +72,34 @@
         {
             getPageList(curPage, pageSize);
         }
+        /// <summary>
+        ///     鍙嶅鏍�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        /// <exception cref="NotImplementedException"></exception>
+        private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+        {
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_lookupTypeCode, gridView1);
+            toolBarMenu1.guidKey = rowGuid;
+        }
 
+        /// <summary>
+        ///     瀹℃牳浜嬩欢
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="e"></param>
+        private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
+        {
+            toolBarMenu1.guidKey = "";
+            string rowGuid, rowName;
+            (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
+                lbGuid, txt_lookupTypeCode, gridView1);
+            toolBarMenu1.guidKey = rowGuid;
+        }
         /// <summary>
         ///     鍙栨秷浜嬩欢
         /// </summary>
@@ -87,8 +117,10 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
         {
-            UtilityHelper.JumpToTab(xtraTabControl1, 0);
-            getPageList(1, UtilityHelper.GetPageSize());
+            if (xtraTabControl1.SelectedTabPageIndex == 1)
+                getModel(lbGuid.Text.Trim(), false, 999);
+            else
+                getPageList(1, UtilityHelper.GetPageSize());
         }
 
         /// <summary>
@@ -106,7 +138,6 @@
                 MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
-
             getModel(rowGuid, true, 1);
         }
 
@@ -124,7 +155,6 @@
                 txt_lookupTypeCode.Focus();
                 return;
             }
-
             gvMx1.CloseEditor();
             gvMx1.UpdateCurrentRow();
             var lst = new List<MesSysLookups>();
@@ -159,8 +189,10 @@
                 {
                     lbGuid.Text = _rtn.rtnData;
                     toolBarMenu1.isSetBtn = true;
-                    UtilityHelper.ChangeEnableByControl(panel1.Controls,
-                        false);
+                    var gridViews = new List<GridView>();
+                    gridViews.Add(gvMx1);
+                    UtilityHelper.ChangeEnableByControl(panel1.Controls, false,
+                        gridViews);
                 }
             }
             catch (Exception ex)
@@ -270,6 +302,8 @@
         private void repositoryItemButtonEdit1_ButtonClick(object sender,
             ButtonPressedEventArgs e)
         {
+            gvMx1.CloseEditor();
+            gvMx1.UpdateCurrentRow();
             var rowhandle = gvMx1.FocusedRowHandle;
             if (rowhandle < 0)
                 return;
@@ -279,6 +313,11 @@
                 var mxGuid = dr["guid"].ToString();
                 if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵"))
                     return;
+                if (string.IsNullOrEmpty(mxGuid))
+                {
+                    gvMx1.DeleteRow(rowhandle);
+                    return;
+                }
                 var strJson = "";
                 var lst = new List<string>();
                 lst.Add(mxGuid);

--
Gitblit v1.9.3