public void ExecuteDeleteBusinessAreaCommand(Object obj) { if (businessAreaViewModel.SelectedBusinessArea != null) { var result = socket.DeleteBusinessUnit(businessAreaViewModel.SelectedBusinessArea); if (result == false) { MessageBox.Show("Fehler beim Löschen des Geschäftsbereiches!"); } parent.restartBusinessUnitCommand(); } }
private void ExecuteDeleteBusinessAreaCommand(Object obj) { if ((fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).SelectedBusinessArea != null) { socket.DeleteBusinessUnit((fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).SelectedBusinessArea); //Fetch new BusinessAreas fleetManagementViewModel.ActiveViewModel = new BusinessAreasViewController().Initialize(); (fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).BusinessAreas = new ObservableCollection <BusinessUnit>(socket.GetAllBusinessUnits()); //Persist Entry State BusinessAreas (fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).entryBusinessArea = (fleetManagementViewModel.ActiveViewModel as BusinessAreasViewModel).BusinessAreas.ToList(); } }