| | |
| | | { |
| | | InitializeComponent(); |
| | | this.treeList1.InitialMultiColSettings(30); |
| | | this.PageTitle.Caption = "菜单管理"; |
| | | this.PageTitle.SvgImageSize = new Size(24, 24); |
| | | } |
| | | |
| | | private List<MenuViewModel> _allBindingList = null;//绑定列表 |
| | |
| | | /// </summary> |
| | | public override async void InitialDataSource() |
| | | { |
| | | var allList = await new Yw.BLL.ProjectMenu().GetByProjectID(1); |
| | | var allList = await new Yw.BLL.ProjectMenu().GetByProjectID(GlobalParas._GlobalParas.ProjectID); |
| | | _allBindingList = new List<MenuViewModel>(); |
| | | if (allList != null) |
| | | { |
| | |
| | | this.menuViewModelBindingSource.DataSource = _allBindingList; |
| | | this.menuViewModelBindingSource.ResetBindings(false); |
| | | // this.treeList1.ForceInitialize(); |
| | | //this.treeList1.CollapseAll(); |
| | | this.treeList1.ExpandAll(); |
| | | } |
| | | |
| | | public override void VerifyAuth() |
| | | { |
| | | this.AuthTree.VerifyAuth(this.ribbonControl1); |
| | | } |
| | | |
| | | //添加 |
| | |
| | | { |
| | | if (_allBindingList == null) |
| | | return; |
| | | var row = this.treeList1.GetCurrentViewModel(_allBindingList); |
| | | var dlg = new AddMenuDlg(); |
| | | dlg.SetBindingData(); |
| | | dlg.SetBindingData(row != null ? row.ID : 0); |
| | | dlg.ReloadDataEvent += async (rhs) => |
| | | { |
| | | var id = await _bll.Insert(rhs); |
| | | var id = await _bll.Insert(rhs.ProjectMenu); |
| | | if (id > 0) |
| | | { |
| | | rhs.ID = id; |
| | | this._allBindingList.Add(new MenuViewModel(rhs)); |
| | | rhs.ProjectMenu.ID = id; |
| | | this._allBindingList.Add(new MenuViewModel(rhs.ProjectMenu)); |
| | | this.menuViewModelBindingSource.ResetBindings(false); |
| | | //this.treeList1.Refresh(); |
| | | return true; |