From 9478ddf3051e83eb9a5889ff90688b34dd0f96a5 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期一, 16 十二月 2024 14:42:55 +0800
Subject: [PATCH] 1

---
 DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesItemQtCk.cs |  106 +++++++++++++++++++++++------------------------------
 1 files changed, 46 insertions(+), 60 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesItemQt.cs b/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesItemQtCk.cs
similarity index 87%
copy from DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesItemQt.cs
copy to DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesItemQtCk.cs
index 3e2902e..b572533 100644
--- a/DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesItemQt.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesItemQtCk.cs
@@ -1,7 +1,5 @@
-using DevExpress.RichEdit.Export;
+锘縰sing DevExpress.RichEdit.Export;
 using DevExpress.XtraEditors;
-using DevExpress.XtraGrid.Views.Grid;
-using DevExpress.XtraGrid.Views.Grid.ViewInfo;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Gs.DevApp.UserControl;
@@ -9,18 +7,21 @@
 using Newtonsoft.Json.Linq;
 using System;
 using System.Collections.Generic;
+using System.ComponentModel;
 using System.Data;
 using System.Drawing;
+using System.Linq;
+using System.Text;
 using System.Threading.Tasks;
 using System.Windows.Forms;
 
-namespace Gs.DevApp.DevFrm
+namespace Gs.DevApp.DevFrm.Ck
 {
-    public partial class Frm_MesItemQt : DevExpress.XtraEditors.XtraForm
+    public partial class Frm_MesItemQtCk : DevExpress.XtraEditors.XtraForm
     {
         string _webServiceName = "MesItemQtManager/";
         List<FilterEntity> _filterList = new List<FilterEntity>();
-        public Frm_MesItemQt()
+        public Frm_MesItemQtCk()
         {
             InitializeComponent();
             this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick;
@@ -32,32 +33,24 @@
             this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
             toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
             toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
-            gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameterMx(gvMx1);
+            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "qt015", "", (value) =>
+            {
+                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
+            });
+            Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
+            {
+                getModel(value);
+            }, (value) =>
+            {
+                getPageList(this.pageBar1.CurrentPage);
+            });
             getPageList(1);
             pageBar1.PagerEvent += PageBar1_PagerEvent;
-            Gs.DevApp.ToolBox.UtilityHelper.SetGridSear(gridView1);
-            gridView1.CustomDrawRowIndicator += (s, e) =>
-            {
-                if (e.Info.IsRowIndicator && e.RowHandle >= 0)
-                {
-                    e.Info.DisplayText = (e.RowHandle + 1).ToString();
-                }
-            };
-            gridView1.FocusedRowChanged += (s, e) =>
-            {
-                UtilityHelper.SetCheckIco(s, picCheckBox, this, "qt015", "");
-            };
-            gridView1.CustomDrawEmptyForeground += (s, e) =>
-            {
-                string str = "鏆傛湭鏌ユ壘鍒板尮閰嶇殑鏁版嵁!";
-                Font f = new Font("寰蒋闆呴粦", 16);
-                Rectangle r = new Rectangle(gridView1.GridControl.Width / 2 - 100, e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5);
-                e.Graphics.DrawString(str, f, Brushes.Gray, r);
-            };
             //璁剧疆浠撳簱閫夋嫨
+            txt_qt008.getSuppler("");
             this.txt_qt008.EditChanged += (s, e) =>
             {
-
             };
             var _obj = new
             {
@@ -80,22 +73,11 @@
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
-        private   void GridView1_ColumnFilterChanged(object sender, EventArgs e)
+        private void GridView1_ColumnFilterChanged(object sender, EventArgs e)
         {
             _filterList = Gs.DevApp.ToolBox.UtilityHelper.GetDilter(gridView1.Columns);
-           Task.Delay(100);
+            Task.Delay(100);
             getPageList(1);
-        }
-        /// <summary>
-        /// 鍙屽嚮浜嬩欢
-        /// </summary>
-        /// <param name="sender"></param>
-        /// <param name="e"></param>
-        private void GcMain_MouseDoubleClick(object sender, MouseEventArgs e)
-        {
-            string rowGuid = Gs.DevApp.ToolBox.UtilityHelper.GetCurrentDoubleRow(gridView1, e, "guid");
-            if (!string.IsNullOrEmpty(rowGuid))
-                getModel(rowGuid, false, 999);
         }
         /// <summary>
         /// 鍒嗛〉浜嬩欢
@@ -138,7 +120,7 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnEscClick(object sender, EventArgs e)
         {
-            UtilityHelper.JumpToTab(xtraTabControl1, 0);
+            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1);
         }
 
         /// <summary>
@@ -166,10 +148,11 @@
                 ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                 if (_rtn.rtnCode > 0)
                 {
-                    UtilityHelper.JumpToTab(xtraTabControl1, 0);
-                    getPageList(1);
+                    if (xtraTabControl1.SelectedTabPageIndex == 0)
+                        getPageList(this.pageBar1.CurrentPage);
+                    else
+                        Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 2);
                 }
-                ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
             }
             catch (Exception ex)
             {
@@ -185,7 +168,7 @@
         private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
         {
             if (xtraTabControl1.SelectedTabPageIndex == 1)
-                getModel(lbGuid.Text.Trim(), false, 999);
+                getModel(lbGuid.Text.Trim());
             else
             {
                 _filterList.Clear();
@@ -212,7 +195,8 @@
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
-            getModel(rowGuid, true, 1);
+            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 3);
+            UtilityHelper.ChangeEnableByControl(panel1.Controls, true);
         }
         /// <summary>
         /// 鏂板浜嬩欢
@@ -221,12 +205,13 @@
         /// <param name="e"></param>
         private void ToolBarMenu1_btnAddClick(object sender, EventArgs e)
         {
-            UtilityHelper.JumpToTab(xtraTabControl1, 1);
             lbGuid.Text = "";
+            Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 4);
             List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
             gridViews.Add(gvMx1);
             UtilityHelper.CleanValueByControl(this.panel1.Controls, true, gridViews);
             Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
+
         }
         /// <summary>
         /// 淇濆瓨浜嬩欢
@@ -326,9 +311,8 @@
         /// </summary>
         /// <param name="curPage">绗嚑椤�</param>
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
-        private   void getPageList(int curPage)
+        private void getPageList(int curPage)
         {
-            
             var _sbSqlWhere = UtilityHelper.GetSearchWhere(_filterList);
             PageQueryModel pgq = new PageQueryModel(curPage, this.pageBar1.RowsCount, "create_date", "asc", "", _sbSqlWhere.ToString());
             string json = JsonConvert.SerializeObject(pgq);
@@ -362,16 +346,18 @@
             {
                 ToolBox.MsgHelper.ShowError("鎻愮ず锛�" + ex.Message);
             }
-            
+
         }
-        private void getModel(string strGuid, bool isEdit, int tabIdx)
+        private void getModel(string strGuid)
         {
+            bool isEdit = false;
+            if (toolBarMenu1.currentAction == "add") return;
+            if (toolBarMenu1.currentAction == "edit") isEdit = true;
             if (string.IsNullOrEmpty(strGuid))
             {
                 ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
                 return;
             }
-            UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
             var _obj = new
             {
                 guid = strGuid,//涓诲缓
@@ -420,7 +406,7 @@
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        private   void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
+        private void ToolBarMenu1_btnChkClick(object sender, EventArgs e)
         {
             _toolCk(1);
         }
@@ -431,7 +417,7 @@
         /// <param name="sender"></param>
         /// <param name="e"></param>
         /// <exception cref="NotImplementedException"></exception>
-        private   void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
+        private void ToolBarMenu1_btnFChkClick(object sender, EventArgs e)
         {
             _toolCk(0);
         }
@@ -440,7 +426,7 @@
         /// 宸ュ叿鏉′簨浠�
         /// </summary>
         /// <param name="inFieldValue"></param>
-        private   void _toolCk(int _inFieldValue)
+        private void _toolCk(int _inFieldValue)
         {
             string strMsg = "";
             switch (_inFieldValue)
@@ -462,7 +448,7 @@
             }
             if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾" + strMsg + "鍚楋紵"))
                 return;
-            
+
             var _obj = new
             {
                 guid = rowGuid,
@@ -478,16 +464,16 @@
                 if (_rtn.rtnCode > 0)
                 {
                     if (xtraTabControl1.SelectedTabPageIndex == 1)
-                        getModel(lbGuid.Text.Trim(), false, 999);
+                        getModel(lbGuid.Text.Trim());
                     else
-                        getPageList(1);
+                        getPageList(this.pageBar1.CurrentPage);
                 }
             }
             catch (Exception ex)
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
-            
+
         }
         private void repositoryItemSearchLookUpEdit1_EditValueChanged(object sender, EventArgs e)
         {
@@ -537,7 +523,7 @@
                     var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                     if (_rtn.rtnCode > 0)
                     {
-                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1);
+                        if (_rtn.rtnCode > 0) getModel(lbGuid.Text);
                     }
                     MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
                 }

--
Gitblit v1.9.3