lu
7 天以前 ce701f953bd952bf8303ccb93520a8a3af33860e
DevApp/Gs.DevApp/UserControl/UcToolBarMenu.cs
@@ -3,6 +3,7 @@
using DevExpress.XtraGrid;
using DevExpress.XtraGrid.Views.Grid;
using DevExpress.XtraLayout;
using Gs.DevApp.DevFrm.QC;
using Gs.DevApp.DevFrm.Rpt;
using Gs.DevApp.DevFrm.Sys;
using Gs.DevApp.DevFrm.Work;
@@ -62,6 +63,7 @@
            btnLianBan.ItemClick += BtnLianBan_ItemClick;
            btnGx.ItemClick += BtnGx_ItemClick;
            btnWeight.ItemClick += BtnWeight_ItemClick;
            btnBaoGao.ItemClick += BtnBaoGao_ItemClick;
            var lst = new List<string>();
            foreach (BarItem item in barManager1.Items)
                if (item is BarLargeButtonItem largeButtonItem)
@@ -69,6 +71,9 @@
                        lst.Add(item.Caption);
            actions = lst;
        }
        /// <summary>
        /// 启动称重
        /// </summary>
@@ -77,8 +82,24 @@
        /// <exception cref="NotImplementedException"></exception>
        private void BtnWeight_ItemClick(object sender, ItemClickEventArgs e)
        {
            var frm = new Frm_Work09();
            frm.Show();
            bool isOpen = false;
            foreach (Form form in Application.OpenForms)
            {
                if (form is WeightIqc)
                {
                    isOpen = true;
                    //form.Activate(); // 激活已存在的窗体
                    //form.MaximizeBox = true;
                    //form.TopMost = true;
                    MsgHelper.ShowInformation("已经打开了,请勿重复打开!");
                    break;
                }
            }
            if (!isOpen)
            {
                var form = new WeightIqc();
                form.Show();
            }
        }
        /// <summary>
@@ -399,7 +420,11 @@
            if (btnGxClick != null)
                btnGxClick(this, e);
        }
        private void BtnBaoGao_ItemClick(object sender, ItemClickEventArgs e)
        {
            if (btnBaoGaoClick != null)
                btnBaoGaoClick(this, e);
        }
        /// <summary>
        /// 取消时,还原按钮可用性
        /// </summary>
@@ -439,8 +464,9 @@
                lst.Add(btnShouHouFchk.Name);
                lst.Add(btnGongZi.Name);
                lst.Add(btnLianBan.Name);
                lst.Add(btnEsc.Name);
                // lst.Add(btnEsc.Name);
                lst.Add(btnGx.Name);
                lst.Add(btnWeight.Name);
                _enabledBtn(lst);
                this.currentAction = "esc";
                if (btnEscClick != null) btnEscClick(this, e);
@@ -491,8 +517,9 @@
                    lst.Add(btnOut.Name);
                    lst.Add(btnGongZi.Name);
                    lst.Add(btnLianBan.Name);
                    lst.Add(btnEsc.Name);
                    // lst.Add(btnEsc.Name);
                    lst.Add(btnGx.Name);
                    lst.Add(btnWeight.Name);
                    _enabledBtn(lst);
                }
            }
@@ -517,8 +544,8 @@
            lst.Add(btnHelp.Name);
            lst.Add(btnLayout.Name);
            lst.Add(btnFont.Name);
            lst.Add(btnFont.Name);
            lst.Add(btnLog.Name);
            lst.Add(btnWeight.Name);
            _enabledBtn(lst);
            this.currentAction = "edit";
            if (btnEdtClick != null) btnEdtClick(this, e);
@@ -546,6 +573,7 @@
            lst.Add(btnHelp.Name);
            lst.Add(btnLayout.Name);
            lst.Add(btnFont.Name);
            lst.Add(btnWeight.Name);
            _enabledBtn(lst);
            this.currentAction = "add";
            if (btnAddClick != null) btnAddClick(this, e);
@@ -1023,6 +1051,10 @@
        /// </summary>
        public event EventHandler btnGxClick;
        /// <summary>
        /// 生成报告
        /// </summary>
        public event EventHandler btnBaoGaoClick;
        #endregion
        #region 公共属性