From abac1dadf2ba8674a24bb0b91c75de5c7881df72 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期二, 09 九月 2025 15:35:41 +0800
Subject: [PATCH] 同步为祈禧的代码
---
DevApp/Gs.DevApp/DevFrm/BasicData/Frm_Staff.cs | 93 +++++-----------------------------------------
1 files changed, 11 insertions(+), 82 deletions(-)
diff --git a/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_Staff.cs b/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_Staff.cs
index 5922664..3852e31 100644
--- a/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_Staff.cs
+++ b/DevApp/Gs.DevApp/DevFrm/BasicData/Frm_Staff.cs
@@ -1,10 +1,8 @@
-锘縰sing DevExpress.DataAccess.Native.Json;
-using DevExpress.XtraEditors;
+锘縰sing DevExpress.XtraEditors;
using Gs.DevApp.Entity;
using Gs.DevApp.ToolBox;
using Gs.DevApp.UserControl;
using Newtonsoft.Json;
-using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Data;
@@ -149,42 +147,6 @@
}
}
- //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);
- // }
- //}
private void getModel(string strGuid)
{
bool isEdit = false;
@@ -192,67 +154,34 @@
if (toolBarMenu1.currentAction == "edit") isEdit = true;
if (string.IsNullOrEmpty(strGuid))
{
- ToolBox.MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
+ MsgHelper.Warning("璇峰厛閫夋嫨浣犺鎿嶄綔鐨勮锛�");
return;
}
-
- // 鏋勯�犺姹傚弬鏁板璞�
var _obj = new
{
- guid = strGuid, // 涓婚敭
+ guid = strGuid //涓诲缓
};
-
try
{
- // 鍙戦�丠TTP璇锋眰鑾峰彇鏁版嵁
- string strJson = UtilityHelper.HttpPost("", _webServiceName + "GetModel", JsonConvert.SerializeObject(_obj));
- ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.ReturnToDynamic(strJson);
-
+ var strJson = UtilityHelper.HttpPost("",
+ _webServiceName + "GetModel",
+ JsonConvert.SerializeObject(_obj));
+ var _rtn = UtilityHelper.ReturnToDynamic(strJson);
if (_rtn.rtnCode > 0)
{
- dynamic dy = _rtn.rtnData;
+ var dy = _rtn.rtnData;
lbGuid.Text = strGuid;
-
- // 缁戝畾涓昏〃鏁版嵁鍒扮晫闈㈡帶浠�
- List<DevExpress.XtraGrid.Views.Grid.GridView> gvList = new List<DevExpress.XtraGrid.Views.Grid.GridView>();
-
- gvList.Add(gvMx1);
- UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit, gvList);
-
- // ================== 绗竴涓槑缁嗚〃锛坙ist锛夊鐞嗛�昏緫 ==================
- // 鏄惧紡鎸囧畾Newtonsoft.Json.Linq.JObject
- Newtonsoft.Json.Linq.JObject _job = Newtonsoft.Json.Linq.JObject.Parse(strJson);
- Newtonsoft.Json.Linq.JArray array = new Newtonsoft.Json.Linq.JArray();
- foreach (var a in _job["rtnData"]["list"])
- {
- array.Add(a);
- }
- DataTable dt = JsonConvert.DeserializeObject<DataTable>(array.ToString());
-
- if (dt.Rows.Count > 0)
- {
- gcMx1.BindingContext = new BindingContext();
- gcMx1.DataSource = dt;
- gcMx1.ForceInitialize();
- gvMx1.BestFitColumns();
- Gs.DevApp.ToolBox.UtilityHelper.SetGridLayout(gvMx1);
- }
- else
- {
- Gs.DevApp.ToolBox.UtilityHelper.SetDefaultTable(gcMx1, gvMx1);
- }
-
+ UtilityHelper.SetValueByObj(this.layoutMx1.Controls, dy, isEdit);
}
else
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
+ MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
}
}
catch (Exception ex)
{
- ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
+ MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
}
}
-
}
}
\ No newline at end of file
--
Gitblit v1.9.3