| | |
| | | using System.ComponentModel; |
| | | using HStation.WinFrmUI; |
| | | using System.ComponentModel; |
| | | using Yw.Dto; |
| | | using MessageBoxHelper = Yw.WinFrmUI.MessageBoxHelper; |
| | | |
| | | namespace MFire.WinFrmUI |
| | | { |
| | |
| | | |
| | | public class CurrentViewModel |
| | | { |
| | | public CurrentViewModel(Yw.Vmo.SysTypeLogicalTreeVmo rhs) |
| | | public CurrentViewModel(Yw.Vmo.SysModuleVmo rhs) |
| | | { |
| | | var module = rhs.LogicalModel as Yw.Dto.SysModuleStdDto; |
| | | this.ID = module.ID; |
| | | this.Name = module.Name; |
| | | this.SortCode = module.SortCode; |
| | | this.Description = module.Description; |
| | | this.ID = rhs.ID; |
| | | this.Name = rhs.Name; |
| | | this.SortCode = rhs.SortCode; |
| | | this.Description = rhs.Description; |
| | | } |
| | | |
| | | public CurrentViewModel(SysTypeStdDto rhs) |
| | | public CurrentViewModel(Yw.Vmo.SysTypeVmo rhs) |
| | | { |
| | | this.ID = rhs.ID; |
| | | this.Name = rhs.Name; |
| | |
| | | public string Description { get; set; } |
| | | } |
| | | |
| | | private Yw.BLL.SysTypeStd _bll = null; |
| | | |
| | | /// <summary> |
| | | /// 选择项变换 |
| | | /// </summary> |
| | |
| | | /// </summary> |
| | | public async void SetBindingData() |
| | | { |
| | | _bll = new Yw.BLL.SysTypeStd(); |
| | | _allBindingList = new BindingList<CurrentViewModel>(); |
| | | var alllist = await _bll.GetExtendLogicalTreeList(); |
| | | var alllist = await SysTypeHelper.GetSysTypeTreeList(); |
| | | if (alllist == null) |
| | | return; |
| | | foreach (var item in alllist) |
| | | { |
| | | _allBindingList.Add(new CurrentViewModel(item)); |
| | | _allBindingList.Add(new CurrentViewModel(item.Module)); |
| | | foreach (var child in item.Children) |
| | | { |
| | | var type = child.LogicalModel as Yw.Dto.SysTypeStdDto; |
| | | if (type != null) |
| | | { |
| | | _allBindingList.Add(new CurrentViewModel(type)); |
| | | } |
| | | _allBindingList.Add(new CurrentViewModel(child)); |
| | | } |
| | | } |
| | | this.treeListLookUpEdit1TreeList.DataSource = _allBindingList; |