From d35bb711f8d3d267b44b4a80c20e31dabf309ae7 Mon Sep 17 00:00:00 2001 From: lu <99954486@qq.com> Date: 星期二, 14 一月 2025 08:17:18 +0800 Subject: [PATCH] 其它入库 --- DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSqDj.cs | 85 ++++++++++++++---------------------------- 1 files changed, 29 insertions(+), 56 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSqDj.cs b/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSqDj.cs index cf9dfaa..bdb7660 100644 --- a/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSqDj.cs +++ b/DevApp/Gs.DevApp/DevFrm/Ck/Frm_MesCgthSqDj.cs @@ -1,15 +1,11 @@ -锘縰sing DevExpress.XtraGrid.Views.Grid; -using DevExpress.XtraGrid.Views.Grid.ViewInfo; -using Gs.DevApp.Entity; +锘縰sing Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Gs.DevApp.UserControl; -using MES.Service.Modes; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using System; using System.Collections.Generic; using System.Data; -using System.Drawing; using System.Threading.Tasks; using System.Windows.Forms; @@ -27,6 +23,7 @@ this.toolBarMenu1.btnQueryClick += ToolBarMenu1_btnQueryClick; toolBarMenu1.btnChkClick += ToolBarMenu1_btnChkClick; toolBarMenu1.btnFChkClick += ToolBarMenu1_btnFChkClick; + toolBarMenu1.btnLogClick += ToolBarMenu1_btnLogClick; Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "statusChk", "", (value) => { Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); @@ -110,7 +107,19 @@ Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 1); } - + /// <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_itemOutNo, gridView1); + toolBarMenu1.guidKey = rowGuid; + } /// <summary> /// 鍒锋柊浜嬩欢 /// </summary> @@ -186,7 +195,6 @@ ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); return; } - var _obj = new { guid = strGuid,//涓诲缓 @@ -200,8 +208,8 @@ dynamic dy = _rtn.rtnData; lbGuid.Text = strGuid; List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); - gvList.Add(gvMx1); gvList.Add(gvMx2); + gvList.Add(gvMx1); UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gvList); JObject _job = JObject.Parse(strJson); JArray array = new JArray(); @@ -209,18 +217,19 @@ { array.Add(a); } + //杩欐槸閫�璐ф槑缁� 琛� DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString()); if (dt.Rows.Count > 0) { - gcMx1.BindingContext = new BindingContext(); - gcMx1.DataSource = dt; - gcMx1.ForceInitialize(); + gcMx2.BindingContext = new BindingContext(); + gcMx2.DataSource = dt; + gcMx2.ForceInitialize(); } else { - Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); + Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2); } - + //杩欐槸鎵爜琛� JArray array1 = new JArray(); foreach (var a in _job["rtnData"]["list2"]) { @@ -229,13 +238,13 @@ DataTable dt1 = JsonConvert.DeserializeObject<DataTable>(array1.ToString()); if (dt1.Rows.Count > 0) { - gcMx2.BindingContext = new BindingContext(); - gcMx2.DataSource = dt1; - gcMx2.ForceInitialize(); + gcMx1.BindingContext = new BindingContext(); + gcMx1.DataSource = dt1; + gcMx1.ForceInitialize(); } else { - Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx2, gvMx2); + Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1); } } else @@ -246,44 +255,7 @@ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } - - private void repositoryItemButtonEdit1_ButtonClick(object sender, DevExpress.XtraEditors.Controls.ButtonPressedEventArgs e) - { - gvMx2.CloseEditor(); - gvMx2.UpdateCurrentRow(); - var rowhandle = gvMx2.FocusedRowHandle; - if (rowhandle < 0) - return; - if (e.Button.Index == 0) - { - var dr = gvMx2.GetDataRow(rowhandle); - var mxGuid = dr["guid"].ToString(); - if (!MsgHelper.AskQuestion("浣犻�夋嫨浜�1鏉℃暟鎹紝纭畾鍒犻櫎鍚楋紵")) - return; - if (string.IsNullOrEmpty(mxGuid)) - { - gvMx2.DeleteRow(rowhandle); - return; - } - var strJson = ""; - var lst = new List<string>(); - lst.Add(mxGuid); - try - { - strJson = UtilityHelper.HttpPost("", - _webServiceName + "DeleteModelMx2", - JsonConvert.SerializeObject(lst)); - var _rtn = UtilityHelper.ReturnToDynamic(strJson); - if (_rtn.rtnCode > 0) getModel(lbGuid.Text); - MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); - } - catch (Exception ex) - { - MsgHelper.Warning("鎻愮ず锛�" + ex.Message); - } - } - } - + /// <summary> /// 宸ュ叿鏉′簨浠� /// </summary> @@ -302,7 +274,7 @@ }; toolBarMenu1.guidKey = ""; string rowGuid, rowName; - (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemOutNo, gridView1, "billNo"); + (rowGuid, rowName) = UtilityHelper.GetCurrentRow(xtraTabControl1, lbGuid, txt_itemOutNo, gridView1, "itemOutNo"); if (string.IsNullOrEmpty(rowGuid)) { MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); @@ -337,5 +309,6 @@ } } + } } \ No newline at end of file -- Gitblit v1.9.3