From b94097020bf79e3d5f046ac4fbd3c05efcda30b3 Mon Sep 17 00:00:00 2001
From: lu <99954486@qq.com>
Date: 星期二, 03 十二月 2024 15:16:27 +0800
Subject: [PATCH] 删除了用户空间的id

---
 DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs |  187 +++++++++++++++++++++++++++++++++++++---------
 1 files changed, 149 insertions(+), 38 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
index 672528b..1088f1c 100644
--- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
+++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs
@@ -6,7 +6,6 @@
 using System.Windows.Forms;
 using DevExpress.XtraEditors;
 using DevExpress.XtraEditors.Controls;
-using DevExpress.XtraGrid.Views.Base.ViewInfo;
 using DevExpress.XtraGrid.Views.Grid;
 using Gs.DevApp.Entity;
 using Gs.DevApp.ToolBox;
@@ -54,13 +53,11 @@
                 e.Graphics.DrawString(str, f, Brushes.Gray, r);
             };
             //璁剧疆浠撳簱閫夋嫨
-            this.txt_depotsId.KeyFile = "depotId";
             this.txt_depotsId.EditChanged += (s, e) =>
             {
                 txtDepotsId.Text = this.txt_depotsId.GetId();
             };
             //璁剧疆渚涘簲鍟嗛�夋嫨
-            this.txt_suppId.KeyFile = "id";
             this.txt_suppId.EditChanged += (s, e) =>
             {
                 txtSupplierId.Text = this.txt_suppId.GetId();
@@ -77,29 +74,76 @@
                 //璧嬪�肩粰鏄庣粏琛�
                 frm.UpdateParent += (ss, ee) =>
                 {
-                    var lst = new List<string>();
-                    lst = ee.StringList;
-                    var _obj = lst;
-                    var strReturn = UtilityHelper.HttpPost("",
-                        "MesInvItemArnDetailManager/GetListPageByCgmxGuid",
-                        JsonConvert.SerializeObject(_obj));
-                    var dt = UtilityHelper.ReturnToList(strReturn);
-                    DataTable _newTable = dt.rtnData;
-                    DataTable _oldTable = (DataTable)gcMx1.DataSource;
-                    DataRow[] sourceRows = _newTable.Select();
-                    for (int i = 0; i < sourceRows.Length; i++)
+                    try
                     {
-                        _oldTable.ImportRow(sourceRows[i]);
+                        var lst = new List<string>();
+                        lst = ee.StringList;
+                        var _obj = lst;
+                        var strReturn = UtilityHelper.HttpPost("",
+                            "MesInvItemArnDetailManager/GetListPageByCgmxGuid",
+                            JsonConvert.SerializeObject(_obj));
+                        var dt = UtilityHelper.ReturnToList(strReturn);
+                        DataTable _newTable = dt.rtnData;
+                        DataTable _oldTable = (DataTable)gcMx1.DataSource;
+                        DataRow[] sourceRows = _newTable.Select();
+                        for (int i = 0; i < sourceRows.Length; i++)
+                        {
+                            _oldTable.ImportRow(sourceRows[i]);
+                        }
+                        gcMx1.BindingContext = new BindingContext();
+                        gcMx1.DataSource = _oldTable;
+                        gcMx1.ForceInitialize();
                     }
-                    gcMx1.BindingContext = new BindingContext();
-                    gcMx1.DataSource = _oldTable;
-                    gcMx1.ForceInitialize();
+                    catch (Exception ex)
+                    {
+
+                        MessageBox.Show(ex.Message);
+                    }
+
                 };
                 frm.ShowDialog();
             };
+            //楠岄��
+            btnTui.Click += async (s, e) =>
+            {
+                if (string.IsNullOrEmpty(lbGuid.Text.Trim()))
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("鏆傛湭淇濆瓨锛屼笉鑳介��璐э紒");
+                    return;
+                }
+                var lst = new List<string>();
+                for (var i = 0; i < gvMx1.DataRowCount; i++)
+                {
+                    var row = gvMx1.GetDataRow(i);
+                    if (row != null && row["gvChk"].ToString().ToUpper() == "true".ToUpper())
+                        lst.Add(row["guid"].ToString());
+                }
+                if (lst.Count <= 0)
+                {
+                    Gs.DevApp.ToolBox.MsgHelper.ShowError("璇烽�夋嫨浣犻渶瑕侀��鐨勭墿鏂欙紒");
+                    return;
+                }
+                UcLoading _loading = new UcLoading();
+                var _obj = lst;
+                try
+                {
+                    var strJson = await UtilityHelper.HttpPostAsync("",
+                        _webServiceName + "TuiMx",
+                        JsonConvert.SerializeObject(_obj));
+                    var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                    if (_rtn.rtnCode > 0)
+                    {
+
+                    }
+                    MsgHelper.ShowError("鎻愮ず锛�" + _rtn.rtnMsg);
+                }
+                catch (Exception ex)
+                {
+                    MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+                }
+                _loading.Stop();
+            };
         }
-
-
         /// <summary>
         ///     鍙屽嚮浜嬩欢
         /// </summary>
@@ -160,33 +204,95 @@
         }
 
         /// <summary>
-        ///     鍙嶆楠�
+        ///  鍙嶆楠�
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        /// <exception cref="NotImplementedException"></exception>
-        private void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e)
+        private async void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e)
         {
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_billNo, gridView1);
+                lbGuid, txt_billNo, gridView1, "billNo");
             toolBarMenu1.guidKey = rowGuid;
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎾ゅ洖宸叉彁浜ょ殑妫�楠屽悧锛�"))
+                return;
+            UcLoading _loading = new UcLoading();
+            var _obj = new
+            {
+                guid = rowGuid,
+            };
+            try
+            {
+                var strJson = await UtilityHelper.HttpPostAsync("",
+                    _webServiceName + "EditModelSubmitF",
+                    JsonConvert.SerializeObject(_obj));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
+                if (_rtn.rtnCode > 0)
+                {
+                    if (xtraTabControl1.SelectedTabPageIndex == 1)
+                        getModel(lbGuid.Text.Trim(), false, 999);
+                    else
+                        getPageList(1, UtilityHelper.GetPageSize());
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+            _loading.Stop();
         }
 
         /// <summary>
-        ///     妫�楠�
+        /// 妫�楠�
         /// </summary>
         /// <param name="sender"></param>
         /// <param name="e"></param>
-        /// <exception cref="NotImplementedException"></exception>
-        private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e)
+        private async void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e)
         {
             toolBarMenu1.guidKey = "";
             string rowGuid, rowName;
             (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1,
-                lbGuid, txt_billNo, gridView1);
+                lbGuid, txt_billNo, gridView1, "billNo");
             toolBarMenu1.guidKey = rowGuid;
+            if (string.IsNullOrEmpty(rowGuid))
+            {
+                MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+                return;
+            }
+            if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鎻愪氦妫�楠屽悧锛�"))
+                return;
+            UcLoading _loading = new UcLoading();
+            var _obj = new
+            {
+                guid = rowGuid,
+            };
+            try
+            {
+                var strJson = await UtilityHelper.HttpPostAsync("",
+                    _webServiceName + "EditModelSubmit",
+                    JsonConvert.SerializeObject(_obj));
+                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
+                MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnData.outMsg);
+                if (_rtn.rtnCode > 0)
+                {
+                    if (xtraTabControl1.SelectedTabPageIndex == 1)
+                        getModel(lbGuid.Text.Trim(), false, 999);
+                    else
+                        getPageList(1, UtilityHelper.GetPageSize());
+                }
+            }
+            catch (Exception ex)
+            {
+                MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+            }
+            _loading.Stop();
         }
         /// <summary>
         ///     鍙栨秷浜嬩欢
@@ -247,8 +353,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>
@@ -341,9 +449,8 @@
                     _obj.list.Add(new MesInvItemArnDetail
                     {
                         Guid = _guid,
-                        AboutGuid = Guid.Parse(row["aboutGuid"].ToString()),
-                        ItemNo = row["itemNo"].ToString(),
-                        //ItemId= int.Parse( row["itemId"].ToString()),
+                        AboutGuid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(row["aboutGuid"].ToString()),
+                        ItemId = int.Parse(row["itemId"].ToString()),
                         Quantity = decimal.Parse(row["quantity"].ToString())
                     });
                 }
@@ -373,8 +480,9 @@
         /// </summary>
         /// <param name="curPage">绗嚑椤�</param>
         /// <param name="pageSize">姣忛〉鍑犳潯</param>
-        private void getPageList(int curPage, int pageSize)
+        private async void getPageList(int curPage, int pageSize)
         {
+            UcLoading _loading = new UcLoading();
             var _sbSqlWhere = new StringBuilder();
             foreach (var itm in _filterList)
                 _sbSqlWhere.Append(" and " + itm.fileId + itm.fileOper + "'" +
@@ -384,7 +492,7 @@
             var json = JsonConvert.SerializeObject(pgq);
             try
             {
-                var strReturn = UtilityHelper.HttpPost("",
+                var strReturn = await UtilityHelper.HttpPostAsync("",
                     _webServiceName + "GetListPage", json);
                 var dd = UtilityHelper.ReturnToTablePage(strReturn);
                 var dt = dd.rtnData.list;
@@ -402,9 +510,10 @@
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
+            _loading.Stop();
         }
 
-        private void getModel(string strGuid, bool isEdit, int tabIdx)
+        private async void getModel(string strGuid, bool isEdit, int tabIdx)
         {
             if (string.IsNullOrEmpty(strGuid))
             {
@@ -413,13 +522,14 @@
             }
 
             UtilityHelper.JumpToTab(xtraTabControl1, tabIdx);
+            UcLoading _loading = new UcLoading();
             var _obj = new
             {
                 guid = strGuid //涓诲缓
             };
             try
             {
-                var strJson = UtilityHelper.HttpPost("",
+                var strJson = await UtilityHelper.HttpPostAsync("",
                     _webServiceName + "GetModel",
                     JsonConvert.SerializeObject(_obj));
                 var _rtn = UtilityHelper.ReturnToDynamic(strJson);
@@ -433,7 +543,7 @@
                         gvList);
                     var _job = JObject.Parse(strJson);
                     var array = new JArray();
-                    foreach (var a in _job["rtnData"]["list"]) array.Add(a);
+                    foreach (var a in _job["rtnData"]["listDya"]) array.Add(a);
                     var dt =
                         JsonConvert.DeserializeObject<DataTable>(
                             array.ToString());
@@ -457,6 +567,7 @@
             {
                 MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
+            _loading.Stop();
         }
 
         /// <summary>

--
Gitblit v1.9.3