| | |
| | | using DevExpress.XtraEditors; |
| | | using Yw; |
| | | using Yw.Untity; |
| | | |
| | | namespace HStation.WinFrmUI.Assets |
| | | { |
| | |
| | | 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) |
| | |
| | | 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); |