From ab354260b4b9ca8cf1aa12573310ec2a9598e084 Mon Sep 17 00:00:00 2001 From: lg <999544862qq.com> Date: 星期五, 20 九月 2024 22:04:35 +0800 Subject: [PATCH] 库位设置 --- DevApp/Gs.DevApp/DevFrm/Warehouse/FrmDepot.cs | 46 ++++++++++++++++++++++++++++++++++++++-------- 1 files changed, 38 insertions(+), 8 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/Warehouse/FrmDepot.cs b/DevApp/Gs.DevApp/DevFrm/Warehouse/FrmDepot.cs index 847fc8a..2056e48 100644 --- a/DevApp/Gs.DevApp/DevFrm/Warehouse/FrmDepot.cs +++ b/DevApp/Gs.DevApp/DevFrm/Warehouse/FrmDepot.cs @@ -1,15 +1,13 @@ -锘縰sing DevExpress.XtraEditors; -using DevExpress.XtraGrid.Views.Base; -using DevExpress.XtraGrid.Views.Grid; -using DevExpress.XtraGrid.Views.Grid.ViewInfo; +锘縰sing DevExpress.XtraGrid.Columns; using DevExpress.XtraTreeList; using DevExpress.XtraTreeList.Nodes; using Gs.DevApp.Entity; using Gs.DevApp.ToolBox; using Newtonsoft.Json; +using Newtonsoft.Json.Linq; using System; +using System.Collections.Generic; using System.Data; -using System.Drawing; using System.Windows.Forms; namespace Gs.DevApp.DevFrm.Warehouse @@ -64,6 +62,9 @@ if (clickedNode.FirstNode == null) { string rowGuid = clickedNode.GetValue("guid").ToString(); + string depotGuid = clickedNode.GetValue("upGuid").ToString(); + if (!string.IsNullOrEmpty(depotGuid)) + rowGuid = depotGuid; getModel(rowGuid, false, 999); } } @@ -164,6 +165,9 @@ private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e) { String rowGuid = Convert.ToString(tlMenu.FocusedNode.GetValue("guid")); + string depotGuid = Convert.ToString(tlMenu.FocusedNode.GetValue("upGuid")); + if (!string.IsNullOrEmpty(depotGuid)) + rowGuid = depotGuid; if (string.IsNullOrEmpty(rowGuid)) { ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�"); @@ -180,7 +184,17 @@ { UtilityHelper.ChangeTab(xtraTabControl1, 1); lbGuid.Text = ""; - UtilityHelper.CleanValue(this.panel1.Controls, true); + List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); + gridViews.Add(gvMx1); + UtilityHelper.CleanValue(this.panel1.Controls, true, gridViews); + DataTable dt = new DataTable(); + foreach (GridColumn col in gvMx1.Columns) + { + dt.Columns.Add(col.FieldName, typeof(string)); + } + gridControl1.BindingContext = new BindingContext(); + gridControl1.DataSource = dt; + gridControl1.ForceInitialize(); } /// <summary> /// 淇濆瓨浜嬩欢 @@ -239,7 +253,9 @@ { lbGuid.Text = _rtn.rtnData; toolBarMenu1.isSetBtn = true; - UtilityHelper.ChangeEnable(this.panel1.Controls, false); + List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); + gridViews.Add(gvMx1); + UtilityHelper.ChangeEnable(this.panel1.Controls, false, gridViews); } } catch (Exception ex) @@ -300,7 +316,20 @@ { dynamic dy = _rtn.rtnData; lbGuid.Text = strGuid; - UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit); + List<DevExpress.XtraGrid.Views.Grid.GridView> gridViews = new List<DevExpress.XtraGrid.Views.Grid.GridView>(); + gridViews.Add(gvMx1); + UtilityHelper.SetValueByObj(this.panel1.Controls, dy, isEdit, gridViews); + JObject _job = JObject.Parse(strJson); + JArray array = new JArray(); + var d = _job["rtnData"]["list"]; + foreach (var a in d) + { + array.Add(a); + } + DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString()); + gridControl1.BindingContext = new BindingContext(); + gridControl1.DataSource = dt; + gridControl1.ForceInitialize(); } else ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg); @@ -310,6 +339,7 @@ ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message); } } + } } -- Gitblit v1.9.3