cdk
2025-09-03 5f012649a67fc5ec11567b6e1543a86ecfe53535
DevApp/Gs.DevApp/DevFrm/Rpt/BTDetails.cs
@@ -1,3 +1,4 @@
using DevExpress.Utils.DirectXPaint;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
@@ -23,14 +24,15 @@
            this.toolBarMenu1.getXmlConfig();
            Gs.DevApp.ToolBox.UtilityHelper.SetGridViewParameter(gridView1, null, this, "", "", (value) =>
            {
                Gs.DevApp.ToolBox.UtilityHelper.JumpTab(xtraTabControl1, 0);
            });
            Gs.DevApp.ToolBox.UtilityHelper.SetTabParameter(gridView1, xtraTabControl1, pageBar1, (value) =>
            {
                getModel(value);
            }, (value) =>
            {
                getPageList(this.pageBar1.CurrentPage);
            });
            }, lbGuid);
            getPageList(1);
            pageBar1.PagerEvent += PageBar1_PagerEvent;
        }
@@ -82,7 +84,12 @@
        /// <param name="e"></param>
        private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e)
        {
            getPageList(this.pageBar1.CurrentPage);
            if (xtraTabControl1.SelectedTabPageIndex == 1)
                getModel(lbGuid.Text.Trim());
            else
            {
                getPageList(this.pageBar1.CurrentPage);
            }
        }
        /// <summary>
@@ -128,5 +135,42 @@
                ToolBox.MsgHelper.ShowError("提示:" + ex.Message);
            }
        }
        private void getModel(string strGuid)
        {
            bool isEdit = false;
            if (toolBarMenu1.currentAction == "add") return;
            if (toolBarMenu1.currentAction == "edit") isEdit = true;
            if (string.IsNullOrEmpty(strGuid))
            {
                MsgHelper.Warning("请先选择你要操作的行!");
                return;
            }
            var _obj = new
            {
                guid = strGuid //主建
            };
            try
            {
                var strJson = UtilityHelper.HttpPost("",
                    _webServiceName + "GetModel",
                    JsonConvert.SerializeObject(_obj));
                var _rtn = UtilityHelper.ReturnToDynamic(strJson);
                if (_rtn.rtnCode > 0)
                {
                    var dy = _rtn.rtnData;
                    lbGuid.Text = strGuid;
                    UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit);
                }
                else
                {
                    MsgHelper.Warning("提示:" + _rtn.rtnMsg);
                }
            }
            catch (Exception ex)
            {
                MsgHelper.Warning("提示:" + ex.Message);
            }
        }
    }
}