| | |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.Data; |
| | | using System.Data.SqlTypes; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, picCheckBox, this, "tbl013", "", (value) => |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0); |
| | | }, tips); |
| | | }, tips, true, (strGuid) => { |
| | | getModelList(strGuid); |
| | | }); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) => |
| | | { |
| | | getModel(value); |
| | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 新增方法:列表显示 |
| | | /// </summary> |
| | | /// <param name="strGuid">主表id</param> |
| | | |
| | | private void getModelList(string strGuid) |
| | | { |
| | | gcMxL1.DataSource = null; |
| | | gcMxL2.DataSource = null; |
| | | |
| | | var _obj = new |
| | | { |
| | | guid = strGuid,//主建 |
| | | }; |
| | | try |
| | | { |
| | | string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson); |
| | | if (_rtn.rtnCode > 0) |
| | | { |
| | | dynamic dy = _rtn.rtnData; |
| | | |
| | | JArray array1 = new JArray(); |
| | | foreach (var a in dy["list"]) |
| | | { |
| | | array1.Add(a); |
| | | } |
| | | DataTable dt1 = JsonConvert.DeserializeObject<DataTable>(array1.ToString()); |
| | | if (dt1.Rows.Count > 0) |
| | | { |
| | | gcMxL1.BindingContext = new BindingContext(); |
| | | gcMxL1.DataSource = dt1; |
| | | gcMxL1.ForceInitialize(); |
| | | gvMxL1.BestFitColumns(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMxL1); |
| | | } |
| | | else |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL1, gvMxL1); |
| | | } |
| | | JArray array2 = new JArray(); |
| | | foreach (var a in dy["list2"]) |
| | | { |
| | | array2.Add(a); |
| | | } |
| | | |
| | | DataTable dt2 = JsonConvert.DeserializeObject<DataTable>(array2.ToString()); |
| | | if (dt2.Rows.Count > 0) |
| | | { |
| | | gcMxL2.BindingContext = new BindingContext(); |
| | | gcMxL2.DataSource = dt2; |
| | | gcMxL2.ForceInitialize(); |
| | | gvMxL2.BestFitColumns(); |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMxL2); |
| | | } |
| | | else |
| | | { |
| | | Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMxL2, gvMxL2); |
| | | } |
| | | |
| | | } |
| | | else |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 日志 |
| | | /// </summary> |
| | | /// <param name="sender"></param> |