| | |
| | | using DevExpress.XtraEditors; |
| | | using DevExpress.XtraGrid.Views.Base; |
| | | using DevExpress.XtraGrid.Views.Grid; |
| | | using DevExpress.XtraGrid.Views.Grid.ViewInfo; |
| | | using 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 |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | 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("请先选择你要操作的行!"); |
| | |
| | | { |
| | | 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> |
| | | /// 保存事件 |
| | |
| | | { |
| | | 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) |
| | |
| | | { |
| | | 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); |
| | |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |