From d1ab92287cb24751cb462d90496bf08f60959bbe Mon Sep 17 00:00:00 2001
From: lg <999544862qq.com>
Date: 星期日, 01 九月 2024 14:46:58 +0800
Subject: [PATCH] 更新父窗体回调事件

---
 DevApp/Gs.DevApp/DevFrm/User/SysMenuAdd.cs |   47 ++++++++++++++++++++++++++++++++++-------------
 1 files changed, 34 insertions(+), 13 deletions(-)

diff --git a/DevApp/Gs.DevApp/DevFrm/User/SysMenuAdd.cs b/DevApp/Gs.DevApp/DevFrm/User/SysMenuAdd.cs
index 89e128c..e9effcb 100644
--- a/DevApp/Gs.DevApp/DevFrm/User/SysMenuAdd.cs
+++ b/DevApp/Gs.DevApp/DevFrm/User/SysMenuAdd.cs
@@ -9,6 +9,8 @@
 {
     public partial class SysMenuAdd : DevExpress.XtraEditors.XtraForm
     {
+        public event EventHandler<UpdateParentEventArgs> UpdateParent;
+
         public SysMenuAdd(string guid)
         {
             InitializeComponent();
@@ -19,7 +21,6 @@
             lbGuid.Text = guid;
             getModel();
         }
-
         private void TxtMenuType_TextChanged(object sender, EventArgs e)
         {
             if (txtMenuType.SelectedIndex == 1)
@@ -43,19 +44,19 @@
 
         private void BtnSave_Click(object sender, EventArgs e)
         {
+            if (string.IsNullOrEmpty(txtMenuType.Text.Trim()) || txtMenuType.SelectedIndex == 0)
+            {
+                Gs.DevApp.ToolBox.MsgHelper.Warning("鑿滃崟绫诲瀷涓嶈兘涓虹┖锛�");
+                txtMenuType.Focus();
+                return;
+            }
             if (string.IsNullOrEmpty(txtMenuName.Text.Trim()))
             {
                 Gs.DevApp.ToolBox.MsgHelper.Warning("鑿滃崟鍚嶇О涓嶈兘涓虹┖锛�");
                 txtMenuName.Focus();
                 return;
             }
-            if (string.IsNullOrEmpty(txtMenuType.Text.Trim()))
-            {
-                Gs.DevApp.ToolBox.MsgHelper.Warning("鑿滃崟绫诲瀷涓嶈兘涓虹┖锛�");
-                txtMenuType.Focus();
-                return;
-            }
-            if (string.IsNullOrEmpty(txtStatus.Text.Trim()))
+            if (string.IsNullOrEmpty(txtStatus.Text.Trim()) || txtStatus.SelectedIndex == 0)
             {
                 Gs.DevApp.ToolBox.MsgHelper.Warning("鑿滃崟鐘舵�佷笉鑳戒负绌猴紒");
                 txtStatus.Focus();
@@ -84,7 +85,10 @@
                 strJson = UtilityHelper.HttpPost("", "MenuAction/EditModel", JsonConvert.SerializeObject(_obj));
                 ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.GetDataByJson(strJson);
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + _rtn.rtnMsg);
-                if (_rtn.rtnCode > 0) { getTree(); }
+                if (_rtn.rtnCode > 0)
+                {
+                    UpdateParent?.Invoke(this, new UpdateParentEventArgs { Data = "" });
+                }
             }
             catch (Exception ex)
             {
@@ -94,7 +98,7 @@
 
         private void getTree()
         {
-            Models.PageQueryModel pgq = new Models.PageQueryModel(1, 999999, "idx", "desc", "", "");
+            Models.PageQueryModel pgq = new Models.PageQueryModel(1, 999999, "idx", "asc", "", " and category=1");
             string json = JsonConvert.SerializeObject(pgq);
             string strReturn = "";
             try
@@ -102,11 +106,11 @@
                 strReturn = UtilityHelper.HttpPost("", "MenuAction/GetListPage", json);
                 ReturnModel<PageListModel> dd = UtilityHelper.GetTableByJson(strReturn);
                 DataTable dt = dd.rtnData.list;
-                txtParentMenuName.Properties.DataSource = dt;
-                txtParentMenuName.Properties.DisplayMember = "name";
-                txtParentMenuName.Properties.DisplayMember = "name";
                 txtParentMenuName.Properties.TreeList.KeyFieldName = "guid";
                 txtParentMenuName.Properties.TreeList.ParentFieldName = "upGuid";
+                //txtParentMenuName.Properties.ValueMember = "guid";
+                txtParentMenuName.Properties.DisplayMember = "name";
+                txtParentMenuName.Properties.DataSource = dt;
             }
             catch (Exception ex)
             {
@@ -144,5 +148,22 @@
                 ToolBox.MsgHelper.Warning("鎻愮ず锛�" + ex.Message);
             }
         }
+
+        private void cleanTxt()
+        {
+            //guid = lbGuid.Text.Trim(),//涓诲缓
+            //    upGuid = _upGuid,//涓婄骇鐨勪富寤�
+            //    name = txtMenuName.Text.Trim(),//鍚嶇О
+            //    icon = txtMenuIco.Text,//鑿滃崟鍥炬爣
+            //    status = txtStatus.SelectedIndex,//鐘舵��
+            //    formPath = txtFormNamespace.Text.Trim(),//绐椾綋璺緞
+            //    idx = int.Parse(txtIdx.Value.ToString()),//鎺掑簭
+            //    category = txtMenuType.SelectedIndex,//绫诲瀷
+
+            //if(lbGuid.Text)
+        }
+
+       
+        
     }
 }
\ No newline at end of file

--
Gitblit v1.9.3