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 | 38 ++++++++++++++++++++++++++++++-------- 1 files changed, 30 insertions(+), 8 deletions(-) diff --git a/DevApp/Gs.DevApp/DevFrm/User/SysMenuAdd.cs b/DevApp/Gs.DevApp/DevFrm/User/SysMenuAdd.cs index 21495ff..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(); @@ -42,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(); @@ -83,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) { @@ -143,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