From 244f6e866ed6ff7325145c96a1ac62122707f4af Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期三, 06 十一月 2024 16:56:50 +0800 Subject: [PATCH] 到货单删除 --- DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs | 169 ++++++++++++++++++++++++++++++++------------------------ 1 files changed, 97 insertions(+), 72 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs index 19ab028..672528b 100644 --- a/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs +++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/Frm_MesInvItemArn.cs @@ -4,7 +4,6 @@ using System.Drawing; using System.Text; using System.Windows.Forms; -using DevExpress.DataAccess.DataFederation; using DevExpress.XtraEditors; using DevExpress.XtraEditors.Controls; using DevExpress.XtraGrid.Views.Base.ViewInfo; @@ -54,19 +53,28 @@ e.Bounds.Top + 45, e.Bounds.Right - 5, e.Bounds.Height - 5); e.Graphics.DrawString(str, f, Brushes.Gray, r); }; - this.txt_depotsCode.KeyFile = "depotCode"; - this.txt_suppNo.KeyFile = "suppNo"; + //璁剧疆浠撳簱閫夋嫨 + 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(); + }; //閫夋嫨闇�瑕佸叆搴撶殑鏄庣粏 btnSelect.Click += (s, e) => { - if (string.IsNullOrEmpty(this.txt_suppNo.GetId())) + if (string.IsNullOrEmpty(this.txt_suppId.GetId())) { Gs.DevApp.ToolBox.MsgHelper.ShowError("璇峰厛閫夋嫨渚涘簲鍟嗭紝鎵嶈兘閫夋嫨鏉ユ枡鏄庣粏锛�"); return; } - System.Text.StringBuilder sbWhere = new StringBuilder(); - sbWhere.Append(" and A.SUPPLIER=" + this.txt_suppNo.GetId()); - var frm = new SelectCgMx(this.txt_suppNo.GetCode(), sbWhere.ToString()); + var frm = new SelectCgMx(this.txt_suppId.GetId()); + //璧嬪�肩粰鏄庣粏琛� frm.UpdateParent += (ss, ee) => { var lst = new List<string>(); @@ -91,44 +99,6 @@ }; } - private void ToolBarMenu1_btnLogClick(object sender, EventArgs e) - { - toolBarMenu1.guidKey = ""; - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_billNo, gridView1); - toolBarMenu1.guidKey = rowGuid; - } - - /// <summary> - /// 鍙嶆楠� - /// </summary> - /// <param name="sender"></param> - /// <param name="e"></param> - /// <exception cref="NotImplementedException"></exception> - private void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e) - { - toolBarMenu1.guidKey = ""; - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_billNo, gridView1); - 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) - { - toolBarMenu1.guidKey = ""; - string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, - lbGuid, txt_billNo, gridView1); - toolBarMenu1.guidKey = rowGuid; - } /// <summary> /// 鍙屽嚮浜嬩欢 @@ -175,7 +145,49 @@ _filterList = e.FilterList; getPageList(1, pageBar1.RowsCount); } + /// <summary> + /// 鏃ュ織 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + private void ToolBarMenu1_btnLogClick(object sender, EventArgs e) + { + toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, + lbGuid, txt_billNo, gridView1); + toolBarMenu1.guidKey = rowGuid; + } + /// <summary> + /// 鍙嶆楠� + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> + /// <exception cref="NotImplementedException"></exception> + private void ToolBarMenu1_btnFjianYanClick(object sender, EventArgs e) + { + toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, + lbGuid, txt_billNo, gridView1); + 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) + { + toolBarMenu1.guidKey = ""; + string rowGuid, rowName; + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, + lbGuid, txt_billNo, gridView1); + toolBarMenu1.guidKey = rowGuid; + } /// <summary> /// 鍙栨秷浜嬩欢 /// </summary> @@ -201,16 +213,17 @@ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - if (!MsgHelper.AskQuestion("浣犻�夋嫨浜嗐��" + rowName + "銆戯紝纭畾鍒犻櫎鍚楋紵")) return; - var lst = new List<dynamic>(); - lst.Add(rowGuid); - var _obj = lst; + var _obj = new + { + guid = rowGuid, + mxGuid = Guid.Empty.ToString(), + }; try { var strJson = UtilityHelper.HttpPost("", - _webServiceName + "DeleteModel", + _webServiceName + "DeleteModelOrMx", JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); if (_rtn.rtnCode > 0) @@ -280,30 +293,32 @@ private void ToolBarMenu1_btnSaveClick(object sender, EventArgs e) { toolBarMenu1.isSetBtn = false; - var _ckCode = txt_depotsCode.GetCode(); //浠撳簱缂栧彿 depots_code - var _gysCode = txt_suppNo.GetCode(); //渚涘簲鍟嗙紪鍙� - if (string.IsNullOrEmpty(_gysCode)) + var _ckId = txt_depotsId.GetId(); //浠撳簱缂栧彿 depots_code + var _gysId = txt_suppId.GetId(); //渚涘簲鍟嗙紪鍙� + if (string.IsNullOrEmpty(_gysId)) { MsgHelper.Warning("璇烽�夋嫨渚涘簲鍟嗭紒"); - txt_suppNo.Focus(); + txt_suppId.Focus(); return; } - if (string.IsNullOrEmpty(_ckCode)) + if (string.IsNullOrEmpty(_ckId)) { MsgHelper.Warning("璇烽�夋嫨浠撳簱锛�"); - txt_depotsCode.Focus(); + txt_depotsId.Focus(); return; } - var _obj = new MesInvItemArn(); - _obj.Guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()); //鍒拌揣鍗曚富閿� - _obj.PaperBillNo = txt_paperBillNo.Text.Trim(); //閫佽揣鍗曞彿; - _obj.Remark = txt_remark.Text.Trim(); //澶囨敞 - _obj.SuppNo = _gysCode; //渚涘簲鍟嗙紪鍙� - _obj.DepotsCode = _ckCode; //浠撳簱缂栧彿 depots_code - _obj.FType = txt_fType.Checked; //0=閲囪喘锛�1=濮斿 - _obj.UrgentFlag = txt_urgentFlag.Checked;//0=涓嶆�ワ紝1=鎬� - _obj.list = new List<MesInvItemArnDetail>(); + var _obj = new MesInvItemArn() + { + Guid = Gs.DevApp.ToolBox.UtilityHelper.ToGuid(lbGuid.Text.Trim()), //鍒拌揣鍗曚富閿� + PaperBillNo = txt_paperBillNo.Text.Trim(), //閫佽揣鍗曞彿; + Remark = txt_remark.Text.Trim(), //澶囨敞 + SuppId = _gysId, //渚涘簲鍟� + DepotsId = _ckId,//浠撳簱 + FType = txt_fType.Checked,//0=閲囪喘锛�1=濮斿 + UrgentFlag = txt_urgentFlag.Checked,//0=涓嶆�ワ紝1=鎬� + list = new List<MesInvItemArnDetail>(), + }; gvMx1.CloseEditor(); gvMx1.UpdateCurrentRow(); if (gvMx1.DataRowCount <= 0) @@ -444,6 +459,11 @@ } } + /// <summary> + /// 鏄庣粏鍒犻櫎 + /// </summary> + /// <param name="sender"></param> + /// <param name="e"></param> private void repositoryItemButtonEdit1_ButtonClick(object sender, ButtonPressedEventArgs e) { @@ -461,16 +481,21 @@ gvMx1.DeleteRow(rowhandle); return; } - var strJson = ""; - var lst = new List<string>(); - lst.Add(mxGuid); + var _obj = new + { + guid = lbGuid.Text.Trim(), + mxGuid = mxGuid, + }; try { - strJson = UtilityHelper.HttpPost("", - _webServiceName + "DeleteModelMx", - JsonConvert.SerializeObject(lst)); + var strJson = UtilityHelper.HttpPost("", + _webServiceName + "DeleteModelOrMx", + JsonConvert.SerializeObject(_obj)); var _rtn = UtilityHelper.ReturnToDynamic(strJson); - if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1); + if (_rtn.rtnCode > 0) + { + if (_rtn.rtnCode > 0) getModel(lbGuid.Text, true, 1); + } MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); } catch (Exception ex) -- Gitblit v1.9.3