1
lu
2024-12-16 9478ddf3051e83eb9a5889ff90688b34dd0f96a5
DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesItemQtCk.cs
copy from DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesItemQt.cs copy to DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesItemQtCk.cs
Îļþ´Ó DevApp/Gs.DevApp/DevFrm/QiTa/Frm_MesItemQt.cs ¸´ÖÆ
@@ -1,7 +1,5 @@
using DevExpress.RichEdit.Export;
using 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);
                }