| | |
| | | this.PageTitle.HeaderSvgImage = this.svgImage32[1]; |
| | | this.PageTitle.SvgImageSize = new Size(24, 24); |
| | | this.typeTreeListCtrl2.FocusedChangedEvent += TypeTreeListCtrl2_FocusedChangedEvent; |
| | | |
| | | } |
| | | |
| | | private List<SysCatalogViewModel> _allBindingList = null; |
| | |
| | | { |
| | | var dlg = new AddSysCatalogDlg(); |
| | | var typeID = this.typeTreeListCtrl2.GetCurrentID(); |
| | | if (typeID == 0) |
| | | return; |
| | | dlg.SetBindingData(typeID); |
| | | dlg.ReloadDataEvent += async (rhs) => |
| | | { |
| | |
| | | } |
| | | if (MessageBoxHelper.IsClickOk($"确认删除数据行?", "提示")) |
| | | return; |
| | | var result = await _bll.DeleteByID(currentVm.ID); |
| | | if (result) |
| | | try |
| | | { |
| | | _allBindingList.Remove(currentVm); |
| | | this.catlogViewModelBindingSource.ResetBindings(false); |
| | | MessageBoxHelper.ShowSuccess($"删除成功!"); |
| | | var result = await _bll.DeleteByID(currentVm.ID); |
| | | if (result) |
| | | { |
| | | _allBindingList.Remove(currentVm); |
| | | this.catlogViewModelBindingSource.ResetBindings(false); |
| | | MessageBoxHelper.ShowSuccess($"删除成功!"); |
| | | } |
| | | else |
| | | { |
| | | MessageBoxHelper.ShowError($"删除失败!"); |
| | | return; |
| | | } |
| | | } |
| | | else |
| | | catch (Yw.Dto.InternalException ex) |
| | | { |
| | | MessageBoxHelper.ShowError($"删除失败!"); |
| | | return; |
| | | MessageBoxHelper.ShowError(ex.ErrorMsg); |
| | | } |
| | | } |
| | | |