public void ExecuteNewBusinessAreaCommand(Object obj) { AddBusinessAreaController addBusinessAreaController = App.Container.Resolve <AddBusinessAreaController>(); BusinessUnit businessUnit = addBusinessAreaController.AddBusinessArea(); if (businessUnit == null) { return; } var result = socket.AddBusinessUnit(businessUnit); if (result == false) { MessageBox.Show("Fehler beim Hinzufügen des Geschäftsbereiches!"); } parent.restartBusinessUnitCommand(); }
/////////////////////////////////////////////// ///////////// BUSINESSAREA ///////////////// private void ExecuteNewBusinessAreaCommand(Object obj) { AddBusinessAreaController addBusinessAreaController = new AddBusinessAreaController(); BusinessUnit businessUnit = addBusinessAreaController.AddBusinessArea(); if (businessUnit == null) { return; } socket.AddBusinessUnit(businessUnit); //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(); }