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 |   56 ++++++++++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 48 insertions(+), 8 deletions(-)

diff --git a/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs b/DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
index f01da9c..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
 {
@@ -49,6 +56,7 @@
             btnZhongTai.ItemClick += BtnbZhongTai_ItemClick;
             btnWg.ItemClick += BtnWg_ItemClick;
             btnHelp.ItemClick += BtnHelp_ItemClick;
+            btnLayout.ItemClick += BtnLayout_ItemClick;
             var lst = new List<string>();
             foreach (BarItem item in barManager1.Items)
                 if (item is BarLargeButtonItem largeButtonItem)
@@ -67,13 +75,18 @@
             if (Parent != null) getNamespace();
         }
 
-        private bool _isCk(int _type) {
+        private bool _isCk(int _type)
+        {
             Form parentForm = this.FindForm();
             if (parentForm != null)
             {
+                PictureBox specificControl = (PictureBox)parentForm.Controls.Find("picCheckBox", true).FirstOrDefault();
+                if (specificControl == null)
+                    return false;
+                if (specificControl.Tag == null)
+                    return false;
                 if (_type == 1)
                 {
-                    PictureBox specificControl = (PictureBox)parentForm.Controls.Find("picCheckBox", true).FirstOrDefault();
                     if (specificControl != null)
                     {
                         if (specificControl.Tag.ToString() == "宸插鏍�")
@@ -85,7 +98,6 @@
                 }
                 if (_type == 0)
                 {
-                    PictureBox specificControl = (PictureBox)parentForm.Controls.Find("picCheckBox", true).FirstOrDefault();
                     if (specificControl != null)
                     {
                         if (specificControl.Tag.ToString() == "鏈鏍�")
@@ -478,7 +490,12 @@
                 lst.Add(btnLog.Name);
                 lst.Add(btnPiZhun.Name);
                 lst.Add(btnHelp.Name);
+                lst.Add(btnLayout.Name);
                 lst.Add(btnBoHui.Name);
+                lst.Add(btnTzbl.Name);
+                lst.Add(btnKg.Name);
+                lst.Add(btnWg.Name);
+                lst.Add(btnZhongTai.Name);
                 _enabledBtn(lst);
                 this.currentAction = "esc";
                 if (btnEscClick != null) btnEscClick(this, e);
@@ -515,7 +532,9 @@
                     lst.Add(btnWg.Name);
                     lst.Add(btnZhongTai.Name);
                     lst.Add(btnHelp.Name);
+                    lst.Add(btnLayout.Name);
                     lst.Add(btnLoad.Name);
+                    lst.Add(btnTzbl.Name);
                     _enabledBtn(lst);
                 }
             }
@@ -538,10 +557,10 @@
             lst.Add(btnSave.Name);
             lst.Add(btnEsc.Name);
             lst.Add(btnHelp.Name);
+            lst.Add(btnLayout.Name);
             _enabledBtn(lst);
             this.currentAction = "edit";
             if (btnEdtClick != null) btnEdtClick(this, e);
-           
         }
 
         private void BtnDel_ItemClick(object sender, ItemClickEventArgs e)
@@ -550,7 +569,7 @@
             if (bl) return;
             if (btnDelClick != null) btnDelClick(this, e);
 
-           // btnEsc.Enabled = false;
+            // btnEsc.Enabled = false;
             this.currentAction = "";
         }
 
@@ -564,13 +583,14 @@
             lst.Add(btnSave.Name);
             lst.Add(btnEsc.Name);
             lst.Add(btnHelp.Name);
+            lst.Add(btnLayout.Name);
             _enabledBtn(lst);
             this.currentAction = "add";
             if (btnAddClick != null) btnAddClick(this, e);
             Form parentForm = this.FindForm();
             if (parentForm != null)
             {
-                PictureBox specificControl =(PictureBox) parentForm.Controls.Find("picCheckBox", true).FirstOrDefault();
+                PictureBox specificControl = (PictureBox)parentForm.Controls.Find("picCheckBox", true).FirstOrDefault();
                 if (specificControl != null)
                 {
                     specificControl.Image = global::Gs.DevApp.Properties.Resources.ico_noCheck;
@@ -636,10 +656,28 @@
                 return;
             }
             Gs.DevApp.ToolBox.MsgHelper.ShowInformation(_rtnJson.rtnMsg);
-
         }
 
-
+        private void BtnLayout_ItemClick(object sender, ItemClickEventArgs ee)
+        {
+            Form parentForm = this.Parent as Form;
+            string _formNamespace = parentForm.GetType().FullName;
+            if (parentForm != null)
+            {
+                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);
+                    }
+                }
+                Gs.DevApp.UserControl.showLayOut DevFrm = new showLayOut(_formNamespace, gvList);
+                DevFrm.ShowDialog();
+            }
+            if (btnLayoutClick != null) btnLayoutClick(this, ee);
+        }
         private void _enabledBtn(List<string> lstBtn)
         {
             foreach (BarItem item in barManager1.Items)
@@ -958,6 +996,8 @@
         public event EventHandler btnWgClick;
 
 
+        public event EventHandler btnLayoutClick;
+
         #endregion
 
         #region 鍏叡灞炴��

--
Gitblit v1.9.3