| | |
| | | using DevExpress.XtraEditors; |
| | | using Gs.DevApp.Models; |
| | | using Gs.DevApp.Models; |
| | | using Gs.DevApp.ToolBox; |
| | | using Newtonsoft.Json; |
| | | using System; |
| | | using System.Collections.Generic; |
| | | using System.ComponentModel; |
| | | using System.Data; |
| | | using System.Drawing; |
| | | using System.Linq; |
| | | using System.Text; |
| | | using System.Threading.Tasks; |
| | | using System.Windows.Forms; |
| | | |
| | | |
| | | namespace Gs.DevApp.DevFrm.User |
| | | { |
| | |
| | | this.toolBarMenu1.btnAddClick += ToolBarMenu1_btnAddClick; |
| | | this.toolBarMenu1.btnDelClick += ToolBarMenu1_btnDelClick; |
| | | this.toolBarMenu1.btnEdtClick += ToolBarMenu1_btnEdtClick; |
| | | this.toolBarMenu1.btnLoadClick += ToolBarMenu1_btnLoadClick; |
| | | } |
| | | |
| | | private void ToolBarMenu1_btnLoadClick(object sender, EventArgs e) |
| | | { |
| | | getTree(); |
| | | } |
| | | |
| | | private void ToolBarMenu1_btnEdtClick(object sender, EventArgs e) |
| | |
| | | ToolBox.MsgHelper.Warning("请先选择你要删除的行!"); |
| | | return; |
| | | } |
| | | if (!MsgHelper.AskQuestion("你选择了【" + tlMenu.FocusedNode.GetValue("name") + "】,确定删除吗?")) |
| | | { |
| | | return; |
| | | } |
| | | var _obj = new |
| | | { |
| | | guid = rowGuid,//主建 |
| | | }; |
| | | string json = JsonConvert.SerializeObject(_obj); |
| | | string strReturn = ""; |
| | | string strJson = ""; |
| | | try |
| | | { |
| | | strReturn= UtilityHelper.HttpPost("", "MenuAction/DeleteModel", json); |
| | | |
| | | strJson = UtilityHelper.HttpPost("", "MenuAction/DeleteModel", JsonConvert.SerializeObject(_obj)); |
| | | ReturnModel<dynamic> _rtn = ToolBox.UtilityHelper.GetDataByJson(strJson); |
| | | if (_rtn.rtnCode > 0) { getTree(); } |
| | | ToolBox.MsgHelper.Warning("提示:" + _rtn.rtnMsg); |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | } |
| | | |
| | |
| | | this.tlMenu.Tag = "name"; |
| | | this.tlMenu.EndUpdate(); |
| | | this.tlMenu.ExpandAll(); |
| | | tlMenu.OptionsView.CheckBoxStyle = DevExpress.XtraTreeList.DefaultNodeCheckBoxStyle.Radio; |
| | | tlMenu.OptionsView.CheckBoxStyle = DevExpress.XtraTreeList.DefaultNodeCheckBoxStyle.Default; |
| | | // 设置不关联选择 |
| | | //tlMenu.OptionsSelection.MultiSelect = true; |
| | | //// tlMenu.OptionsSelection.MaintainState = false; // 关键设置 |
| | | //tlMenu.OptionsSelection.MaintainState = false; // 关键设置 |
| | | //this.tlMenu.OptionsBehavior.AllowIndeterminateCheckState = true; |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | throw ex; |
| | | ToolBox.MsgHelper.Warning("提示:" + ex.Message); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |