啊鑫
2024-11-22 a985c4d4b80fbf3eb4abbe385adcd0536fd29eda
DevApp/Gs.DevApp/DevFrm/QC/Frm_MesQaMj.cs
@@ -1,3 +1,4 @@
using DevExpress.RichEdit.Export;
using Gs.DevApp.DevFrm.QC.Models;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
@@ -24,11 +25,13 @@
            this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1;
            this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick;
            this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick;
            toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick;
            toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick;
            gcMain.MouseDoubleClick += GcMain_MouseDoubleClick;
            gridView1.FocusedRowChanged += (s, e) =>
            {
                UtilityHelper.SetCheckIco(s, picCheckBox, this, "status", "");
            };
            getPageList(1, UtilityHelper.GetPageSize());
            pageBar1.PagerEvent += PageBar1_PagerEvent;
            gridView1.CustomDrawRowIndicator += (s, e) =>
@@ -50,41 +53,14 @@
        private void _setIno()
        {
            this.txt_itemId.KeyFile = "id";
            this.txt_suppNo.KeyFile = "suppNo";
            this.txt_suppId.KeyFile = "id";
            txt_itemId.EditChanged += (s, e) =>
            {
                txt_itemNo.Text = this.txt_itemId.GetCode();
                var ItemId = this.txt_itemId.GetId();
                var ItemName = this.txt_itemId.GetName();
                GetCount(ItemId, ItemName);
                //var ItemId = this.txt_itemId.GetId();
                //var ItemName = this.txt_itemId.GetName();
                //GetCount(ItemId, ItemName);
            };
        }
        private void GetCount(string ItemId,string ItemName)
        {
            //string rowGuid = "", rowName = "";
            //(rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemNo, gridView1);
            //if (string.IsNullOrEmpty(rowGuid))
            //{
            //    ToolBox.MsgHelper.Warning("请先选择你要操作的行!");
            //    return;
            //}
            try
            {
                string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetCount", JsonConvert.SerializeObject(ItemId));
                ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    UtilityHelper.JumpToTab(xtraTabControl1, 0);
                    MsgHelper.Warning("提示:"+ ItemName+"这个物料已经维护了免检数据");
                }
            }
            catch (Exception ex)
            {
                ToolBox.MsgHelper.Warning("提示:" + ex.Message);
            }
        }
        /// <summary>
        /// 双击事件
@@ -181,8 +157,10 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
        {
            UtilityHelper.JumpToTab(xtraTabControl1, 0);
            getPageList(1, UtilityHelper.GetPageSize());
            if (xtraTabControl1.SelectedTabPageIndex == 1)
                getModel(lbGuid.Text.Trim(), false, 999);
            else
                getPageList(1, UtilityHelper.GetPageSize());
        }
        /// <summary>
        /// 修改事件
@@ -229,7 +207,7 @@
        {
            toolBarMenu1.isSetBtn = false;
            string _ItemId = txt_itemId.GetId();
            string _suppNo = txt_suppNo.GetCode();
            string _suppNo = txt_suppId.GetId();
            if (string.IsNullOrEmpty(_ItemId))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择物料!");
@@ -239,7 +217,7 @@
            if (string.IsNullOrEmpty(_suppNo))
            {
                Gs.DevApp.ToolBox.MsgHelper.Warning("请选择供应商!");
                txt_suppNo.Focus();
                txt_suppId.Focus();
                return;
            }
            var _obj = new MesQaMj
@@ -247,7 +225,7 @@
                Guid = UtilityHelper.ToGuid(lbGuid.Text.Trim()), //主建
                ItemId = Convert.ToInt32(_ItemId),
                ItemNo = txt_itemId.GetCode(),
                SuppNo= _suppNo,
                SuppId = _suppNo,
            };
            try
            {