duheng
2024-11-12 0bc0468692ad7b16cd2d49d20c4689ddcd6fb212
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)
@@ -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);