From be53dc839f3698dd196ecbb002ea190d5bb7dabb Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期四, 27 二月 2025 10:50:10 +0800
Subject: [PATCH] 销售

---
 DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs |   39 +++++++++++++++++++++++++--------------
 1 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
index d6c3dcf..00a0424 100644
--- a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
+++ b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
@@ -4,14 +4,21 @@
 using System.Data;
 using System.Linq;
 using System.Net;
+using System.Windows.Controls.Primitives;
 using System.Windows.Forms;
 using DevExpress.XtraBars;
+using DevExpress.XtraBars.Commands;
 using DevExpress.XtraEditors;
+using DevExpress.XtraGrid;
+using DevExpress.XtraGrid.Columns;
+using DevExpress.XtraGrid.Menu;
+using DevExpress.XtraGrid.Views.Grid;
 using Gs.DevApp.DevFrm.Rpt;
 using Gs.DevApp.DevFrm.Sys;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
 using Newtonsoft.Json;
+using Newtonsoft.Json.Linq;
 
 namespace Gs.DevApp.UserControl
 {
@@ -74,7 +81,7 @@
             if (parentForm != null)
             {
                 PictureBox specificControl = (PictureBox)parentForm.Controls.Find("picCheckBox", true).FirstOrDefault();
-                if (specificControl== null)
+                if (specificControl == null)
                     return false;
                 if (specificControl.Tag == null)
                     return false;
@@ -651,22 +658,25 @@
             Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtnJson.rtnMsg);
         }
 
-        private void BtnLayout_ItemClick(object sender, ItemClickEventArgs e)
+        private void BtnLayout_ItemClick(object sender, ItemClickEventArgs ee)
         {
-            var _formNamespace = "";
-            Control parentControl = this;
-            while (parentControl.Parent != null)
+            Form parentForm = this.Parent as Form;
+            string _formNamespace = parentForm.GetType().FullName;
+            if (parentForm != null)
             {
-                if (parentControl.Parent is Form parentForm)
-                {
-                    var formType = parentForm.GetType();
-                    _formNamespace = formType.FullName;
-                    break;
+                List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
+                GridControl gcMain = parentForm.Controls.Find("gcMain", true).OfType<GridControl>().FirstOrDefault();
+                if (gcMain != null) {
+                    GridView gv1 = gcMain.MainView as GridView;
+                    if (gv1 != null)
+                    {
+                        gvList.Add(gv1);
+                    }
                 }
-                parentControl = parentControl.Parent;
+                Gs.DevApp.UserControl.showLayOut DevFrm = new showLayOut(_formNamespace, gvList);
+                DevFrm.ShowDialog();
             }
-            Gs.DevApp.UserControl.showLayOut DevFrm = new showLayOut(_formNamespace);
-            DevFrm.ShowDialog();
+            if (btnLayoutClick != null) btnLayoutClick(this, ee);
         }
         private void _enabledBtn(List<string> lstBtn)
         {
@@ -793,7 +803,6 @@
                 //榛樿鍚敤鐨勬寜閽�
                 _enabledList.Add(btnLoad.Name);
                 _enabledList.Add(btnHelp.Name);
-                _enabledList.Add(btnLayout.Name);
                 _enabledBtn(_enabledList);
             }
             catch (Exception ex)
@@ -987,6 +996,8 @@
         public event EventHandler btnWgClick;
 
 
+        public event EventHandler btnLayoutClick;
+
         #endregion
 
         #region 鍏叡灞炴��

--
Gitblit v1.9.3