From fe09fca3e77be09fed738a975ff9c5a508c2dd0d Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期五, 25 十月 2024 08:31:56 +0800 Subject: [PATCH] 检验 --- DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs | 110 +++++++++++++++++++++++++++++++++++++++++++++++++------ 1 files changed, 98 insertions(+), 12 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs index 530db9e..858d5fd 100644 --- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs +++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs @@ -1,7 +1,9 @@ +using DevExpress.XtraGrid.Views.Base.ViewInfo; using DevExpress.XtraGrid.Views.Grid; using DevExpress.XtraGrid.Views.Grid.ViewInfo; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; +using MES.Service.Modes; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; @@ -26,6 +28,8 @@ this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick1; this.toolBarMenu1.btnEscClick += ToolBarMenu1_btnEscClick; this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; + this.toolBarMenu1.btnJianYanClick += ToolBarMenu1_btnJianYanClick; + this.toolBarMenu1.btnFjianYanClick += ToolBarMenu1_btnFjianYanClick; gcMain.MouseDoubleClick += GcMain_MouseDoubleClick; getPageList(1, UtilityHelper.GetPageSize()); pageBar1.PagerEvent += PageBar1_PagerEvent; @@ -53,12 +57,55 @@ Gs.DevApp.UserControl.SelectCgMx frm = new UserControl.SelectCgMx(); frm.UpdateParent += (ss, ee) => { - List<string> _StringList = new List<string>(); - _StringList = ee.StringList; - MessageBox.Show(_StringList.Count.ToString()); + List<string> lst = new List<string>(); + lst = ee.StringList; + var _obj = lst; + string strReturn = UtilityHelper.HttpPost("", "MesInvItemArnDetailManager/GetListPageByCgmxGuid", JsonConvert.SerializeObject(_obj)); + ReturnModel<DataTable> dt = UtilityHelper.ReturnToList(strReturn); + gcMx1.BindingContext = new BindingContext(); + gcMx1.DataSource = dt.rtnData; + gcMx1.ForceInitialize(); }; frm.ShowDialog(); }; + ucLookCk1.EditChanged += (s, e) => + { + var ddd = this.ucLookCk1.GetValue(); + lbCkName.Text = ddd[1]; + }; + + } + + private void ToolBarMenu1_btnFjianYanClick1(object sender, EventArgs e) + { + throw new NotImplementedException(); + } + + /// <summary> + /// 鍙嶆楠� + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + /// <exception cref="NotImplementedException"></exception> + private void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e) + { + this.toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1); + this.toolBarMenu1.guidKey = rowGuid; + } + /// <summary> + /// 妫�楠� + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + /// <exception cref="NotImplementedException"></exception> + private void ToolBarMenu1_btnJianYanClick(object sender, EventArgs e) + { + this.toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1); + this.toolBarMenu1.guidKey = rowGuid; } /// <summary> @@ -121,7 +168,7 @@ private void ToolBarMenu1_btnDelClick1(object sender, EventArgs e) { string rowGuid = "", rowName = ""; - // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1); + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1); if (string.IsNullOrEmpty(rowGuid)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); @@ -167,7 +214,7 @@ private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e) { string rowGuid = "", rowName = ""; - // (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1); + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_billNo, gridView1); if (string.IsNullOrEmpty(rowGuid)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); @@ -197,17 +244,56 @@ private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) { toolBarMenu1.isSetBtn = false; - //if (string.IsNullOrEmpty(txt_account.Text.Trim())) + string _ckCode = ucLookCk1.GetValue()[2];//浠撳簱缂栧彿 depots_code + string _gysCode = ucLookSupplier1.GetValue()[2];//渚涘簲鍟嗙紪鍙� + if (string.IsNullOrEmpty(_ckCode)) { - Gs.DevApp.ToolBox.MsgHelper.Warning("鐧诲綍璐﹀彿涓嶈兘涓虹┖锛�"); - // txt_account.Focus(); + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�"); + ucLookCk1.Focus(); return; } - var _obj = new + if (string.IsNullOrEmpty(_gysCode)) { - guid = lbGuid.Text.Trim(),//涓诲缓 - - }; + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨渚涘簲鍟嗭紒"); + ucLookSupplier1.Focus(); + return; + } + if (string.IsNullOrEmpty(txt_paperBillNo.Text.Trim())) + { + Gs.DevApp.ToolBox.MsgHelper.Warning("璇烽�夋嫨閫佽揣鍗曞彿锛�"); + txt_paperBillNo.Focus(); + return; + } + MesInvItemArn _obj = new MesInvItemArn(); + _obj.Guid = null;//鍒拌揣鍗曚富閿� + _obj.PaperBillNo = txt_paperBillNo.Text.Trim();//閫佽揣鍗曞彿; + _obj.Remark = "";//澶囨敞 + _obj.SuppNo = _gysCode;//渚涘簲鍟嗙紪鍙� + _obj.DepotsCode = _ckCode;//浠撳簱缂栧彿 depots_code + _obj.FType = 1; //0=閲囪喘锛�1=濮斿 + _obj.list = new List<MesInvItemArnDetail>(); + gvMx1.CloseEditor(); + gvMx1.UpdateCurrentRow(); + for (int i = 0; i < gvMx1.DataRowCount; i++) + { + DataRow row = gvMx1.GetDataRow(i); + if (row != null) + { + Guid? _guid = null; + if (string.IsNullOrEmpty(row["guid"].ToString())) + _guid = null; + else + _guid = Guid.Parse(row["guid"].ToString()); + _obj.list.Add(new MesInvItemArnDetail + { + Guid = _guid, + AboutGuid = Guid.Parse(row["aboutGuid"].ToString()), + ItemNo = row["itemNo"].ToString(), + //ItemId= int.Parse( row["itemId"].ToString()), + Quantity = decimal.Parse(row["quantity"].ToString()), + }); + } + } try { string strJson = UtilityHelper.HttpPost("", _webServiceName + "EditModel", JsonConvert.SerializeObject(_obj)); -- Gitblit v1.9.3