duheng
2024-07-10 2a41fffc9f962999ba163c3b471873b6b96f05bc
WinFrmUI/HStation.WinFrmUI.Basic/01-SysCatalogManage/SysCatalogManageMainPanel.cs
文件名从 WinFrmUI/HStation.WinFrmUI.Xhs.Project/05-CatlogManage/CatlogManageMainPanel.cs 修改
@@ -1,18 +1,14 @@
锘縰sing HStation.WinFrmUI.Xhs.Project;
using ISupply.WinFrmUI;
using Yw.DAL.Basic;
namespace HStation.WinFrmUI.Xhs
锘縩amespace HStation.WinFrmUI.Basic
{
    public partial class CatalogManageCtrl : DocumentPage
    public partial class SysCatalogManageMainPanel : DocumentPage
    {
        public CatalogManageCtrl()
        public SysCatalogManageMainPanel()
        {
            InitializeComponent();
            this.typeTreeListCtrl2.FocusedChangedEvent += TypeTreeListCtrl2_FocusedChangedEvent;
        }
        private List<CatlogViewModel> _allBindingList = null;
        private List<SysCatalogViewModel> _allBindingList = null;
        private Yw.BLL.SysCatalog _bll = null;
@@ -24,13 +20,13 @@
        //鑱氱劍鍒囨崲
        private async void TypeTreeListCtrl2_FocusedChangedEvent(long typeID)
        {
            _allBindingList = new List<CatlogViewModel>();
            _allBindingList = new List<SysCatalogViewModel>();
            _bll = new Yw.BLL.SysCatalog();
            var alllist = await _bll.GetByTypeID(typeID);
            _allBindingList.Clear();
            foreach (var item in alllist)
            {
                _allBindingList.Add(new CatlogViewModel(item));
                _allBindingList.Add(new SysCatalogViewModel(item));
            }
            _allBindingList = _allBindingList.OrderBy(x => x.SortCode).ToList();
            this.catlogViewModelBindingSource.DataSource = _allBindingList;
@@ -40,7 +36,7 @@
        //娣诲姞
        private void BtnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var dlg = new AddCatlogDlg();
            var dlg = new AddSysCatalogDlg();
            var typeID = this.typeTreeListCtrl2.GetCurrentID();
            dlg.SetBindingData(typeID);
            dlg.ReloadDataEvent += async (rhs) =>
@@ -49,7 +45,7 @@
               if (id > 0)
               {
                   var model = await _bll.GetByID(id);
                   _allBindingList.Add(new CatlogViewModel(model));
                   _allBindingList.Add(new SysCatalogViewModel(model));
                   this.catlogViewModelBindingSource.ResetBindings(false);
                   return true;
               }
@@ -61,7 +57,7 @@
        //娣诲姞瀛愰」
        private void BtnAddChild_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var dlg = new AddCatlogDlg();
            var dlg = new AddSysCatalogDlg();
            var vm = this.treeList1.GetCurrentViewModel(_allBindingList);
            if (vm == null)
            {
@@ -76,7 +72,7 @@
                if (id > 0)
                {
                    var model = await _bll.GetByID(id);
                    _allBindingList.Add(new CatlogViewModel(model));
                    _allBindingList.Add(new SysCatalogViewModel(model));
                    this.catlogViewModelBindingSource.ResetBindings(false);
                    return true;
                }
@@ -88,7 +84,7 @@
        //缂栬緫
        private void barBtnEditPumpCurve_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var dlg = new EditCatlogDlg();
            var dlg = new EditSysCatlaogDlg();
            var vm = this.treeList1.GetCurrentViewModel(_allBindingList);
            if (vm == null)
            {
@@ -140,7 +136,7 @@
            var currentVm = this.treeList1.GetCurrentViewModel(_allBindingList);
            if (currentVm != null)
            {
                var dlg = new PropEdit();
                var dlg = new SysPropEditDlg();
                dlg.SetBindingData(currentVm.ID);
                dlg.ShowDialog();
            }