| | |
| | | private void BtnAdd_ItemClick(object sender, DevExpress.XtraBars.ItemClickEventArgs e) |
| | | { |
| | | var dlg = new AddAssetsPackageSeriesDlg(); |
| | | dlg.ReloadDataEvent += async (rhs, currentId) => |
| | | dlg.ReloadDataEvent += async (rhs, currentId, manufacturerId) => |
| | | { |
| | | if (currentId != null) |
| | | { |
| | |
| | | { |
| | | rhs.ID = id; |
| | | _allBindingList.Add(new AssetsPackageSeriesViewModel(rhs)); |
| | | if (manufacturerId != null) |
| | | { |
| | | var mappingVmo = new Vmo.AssetsPackageMfrMappingVmo |
| | | { |
| | | ManufacturerID = Convert.ToInt64(manufacturerId), |
| | | SeriesID = id |
| | | }; |
| | | await new BLL.AssetsPackageSeriesManufacturerMapping().Insert(mappingVmo); |
| | | } |
| | | this.treeList1.RefreshDataSource(); |
| | | return true; |
| | | } |
| | |
| | | var vm = this.treeList1.GetCurrentViewModel(_allBindingList); |
| | | if (vm == null) |
| | | { |
| | | //MessageBoxHelper.ShowWarning("请选择数据行!"); |
| | | return; |
| | | } |
| | | ReloadEvent.Invoke(vm.ID); |
| | |
| | | if (AssetsEquipmentSeries == null) |
| | | return; |
| | | dlg.SetBindingData(AssetsEquipmentSeries); |
| | | dlg.ReloadDataEvent += async (rhs, currentId) => |
| | | dlg.ReloadDataEvent += async (rhs, currentId, mapping) => |
| | | { |
| | | if (currentId != null) |
| | | { |
| | |
| | | if (await BLLFactory<BLL.AssetsPackageSeries>.Instance.Update(rhs)) |
| | | { |
| | | vm.Reset(rhs); |
| | | if (mapping != null) |
| | | { |
| | | await new BLL.AssetsPackageSeriesManufacturerMapping().Update(mapping); |
| | | } |
| | | this.treeList1.RefreshDataSource(); |
| | | return true; |
| | | } |
| | |
| | | if (groupresult) |
| | | { |
| | | _allBindingList.Remove(currentVm); |
| | | var mapping = await new BLL.AssetsPackageSeriesManufacturerMapping().GetBySeriesID(currentVm.ID); |
| | | if (mapping != null) |
| | | { |
| | | await new BLL.AssetsPackageSeriesManufacturerMapping().DeleteByID(Convert.ToInt64(mapping.ManufacturerID)); |
| | | } |
| | | this.treeList1.RefreshDataSource(); |
| | | TipFormHelper.ShowSucceed("删除成功!"); |
| | | } |