lixiaojun
2024-12-05 77a4be9a061af13fcd7a0143cf6299172a6fa7f9
WinFrmUI/HStation.WinFrmUI.Assets.Core/10-exchanger/01-series/ExchangerTreeListCtrl.cs
@@ -1,5 +1,6 @@
using DevExpress.XtraEditors;
using Yw;
using Yw.Untity;
namespace HStation.WinFrmUI.Assets
{
@@ -50,8 +51,13 @@
        private void BtnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e)
        {
            var dlg = new AddAssetsExchangerSeriesDlg();
            dlg.ReloadDataEvent += async (rhs) =>
            dlg.ReloadDataEvent += async (rhs, currentId) =>
            {
                if (currentId != null)
                {
                    var select = await _bll.GetByID(Convert.ToInt64(currentId));
                    rhs.ParentIds = TreeParentIdsHelper.GetChildParentIds(select.ID, select.ParentIds);
                }
                var bll = new BLL.AssetsExchangerSeries();
                var id = await bll.Insert(rhs);
                if (id > 0)
@@ -72,7 +78,7 @@
            var vm = this.treeList1.GetCurrentViewModel(_allBindingList);
            if (vm == null)
            {
                MessageBoxHelper.ShowWarning("请选择数据行!");
                // MessageBoxHelper.ShowWarning("请选择数据行!");
                return;
            }
            ReloadEvent.Invoke(vm.ID);
@@ -92,8 +98,13 @@
            if (AssetsExchangerSeries == null)
                return;
            dlg.SetBindingData(AssetsExchangerSeries);
            dlg.ReloadDataEvent += async (rhs) =>
            dlg.ReloadDataEvent += async (rhs, currentId) =>
            {
                if (currentId != null)
                {
                    var select = await _bll.GetByID(Convert.ToInt64(currentId));
                    rhs.ParentIds = TreeParentIdsHelper.GetChildParentIds(select.ID, select.ParentIds);
                }
                if (await BLLFactory<BLL.AssetsExchangerSeries>.Instance.Update(rhs))
                {
                    vm.Reset(rhs);