Shuxia Ning
2025-01-16 90865b0dbca3f3a872065bb202e321ca4d021058
WinFrmUI/HStation.WinFrmUI.Basic.Core/04-SysPropManage/SelectCorprationListCtrl.cs
@@ -1,5 +1,7 @@
using System.ComponentModel;
using HStation.WinFrmUI;
using System.ComponentModel;
using Yw.Dto;
using MessageBoxHelper = Yw.WinFrmUI.MessageBoxHelper;
namespace MFire.WinFrmUI
{
@@ -15,16 +17,15 @@
        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;
@@ -59,8 +60,6 @@
            public string Description { get; set; }
        }
        private Yw.BLL.SysTypeStd _bll = null;
        /// <summary>
        /// 选择项变换
        /// </summary>
@@ -73,21 +72,16 @@
        /// </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;