public void EntityChanged() { this.SearchCountFound = null; this.navigationService.ClearHistory(); this.SelectedMenuItem.OpenCommand.Execute(); eventAggregator.Publish( new CanCreateNewChangeEvent(AuthorisationHelpers.HasEntityRights(SelectedMenuItem.Name))); }
private bool CanAddMappings() { foreach (var system in mappingService.GetSourceSystemNames()) { if (AuthorisationHelpers.HasMappingRights("PartyAccountability", system)) { return(true); } } return(false); }
public void AddMenuItem(MenuItemViewModel menuItem) { this.MenuItems.Add(menuItem); if (MenuItems.Count == 1 || SelectedMenuItem != MenuItems[0]) { this.SelectedMenuItem = this.MenuItems[0]; eventAggregator.Publish( new CanCreateNewChangeEvent(AuthorisationHelpers.HasEntityRights(SelectedMenuItem.Name))); } }
public void OnNavigatedTo(NavigationContext navigationContext) { this.eventAggregator.Subscribe <SearchResultsFound>(this.UpdateSearchResults); this.eventAggregator.Subscribe <CreateEvent>(this.CreateEntity); if (this.SelectedMenuItem != null) { this.applicationCommands.OpenView( this.SelectedMenuItem.SearchResultsViewType, this.SelectedMenuItem.Name, RegionNames.MainSearchResultsRegion); eventAggregator.Publish( new CanCreateNewChangeEvent(AuthorisationHelpers.HasEntityRights(SelectedMenuItem.Name))); } }
public ReferenceDataEditViewModel( IEventAggregator eventAggregator, IReferenceDataService entityService, INavigationService navigationService, IMappingService mappingService, IApplicationCommands applicationCommands) { this.navigationService = navigationService; this.mappingService = mappingService; this.applicationCommands = applicationCommands; this.eventAggregator = eventAggregator; this.entityService = entityService; this.confirmationFromViewModelInteractionRequest = new InteractionRequest <Confirmation>(); this.CanEdit = AuthorisationHelpers.HasEntityRights("ReferenceData"); }
public SourceSystemEditCloneViewModel( IEventAggregator eventAggregator, IMdmService entityService, INavigationService navigationService, IMappingService mappingService, IApplicationCommands applicationCommands) { this.navigationService = navigationService; this.mappingService = mappingService; this.applicationCommands = applicationCommands; this.eventAggregator = eventAggregator; this.entityService = entityService; this.confirmationFromViewModelInteractionRequest = new InteractionRequest <Confirmation>(); this.CanEdit = AuthorisationHelpers.HasEntityRights("SourceSystem"); this.eventAggregator.Subscribe <MappingClonedEvent>(this.MappingCloned); }
public void OnNavigatedTo(NavigationContext navigationContext) { this.Mapping = new MappingViewModel(this.eventAggregator); this.entityId = navigationContext.Parameters[NavigationParameters.EntityId]; this.entityName = navigationContext.Parameters[NavigationParameters.EntityName]; this.entityInstanceName = navigationContext.Parameters[NavigationParameters.EntityInstanceName]; this.eventAggregator.Subscribe <SaveEvent>(this.Save); this.SourceSystems = mappingService.GetSourceSystemNames() .Where(x => AuthorisationHelpers.HasMappingRights(this.entityName, x)) .OrderBy(x => x) .ToList(); this.SourceSystems.Insert(0, string.Empty); RaisePropertyChanged("Context"); }
public LegalEntityEditViewModel( IEventAggregator eventAggregator, IMdmService entityService, INavigationService navigationService, IMappingService mappingService, IApplicationCommands applicationCommands, IList <string> partystatusConfiguration) { this.navigationService = navigationService; this.mappingService = mappingService; this.applicationCommands = applicationCommands; this.eventAggregator = eventAggregator; this.entityService = entityService; this.confirmationFromViewModelInteractionRequest = new InteractionRequest <Confirmation>(); this.CanEdit = AuthorisationHelpers.HasEntityRights("LegalEntity"); this.PartyStatusConfiguration = partystatusConfiguration; }
public LocationEditCloneViewModel( IEventAggregator eventAggregator, IMdmService entityService, INavigationService navigationService, IMappingService mappingService, IApplicationCommands applicationCommands, IList <string> typeConfiguration) { this.navigationService = navigationService; this.mappingService = mappingService; this.applicationCommands = applicationCommands; this.eventAggregator = eventAggregator; this.entityService = entityService; this.confirmationFromViewModelInteractionRequest = new InteractionRequest <Confirmation>(); this.CanEdit = AuthorisationHelpers.HasEntityRights("Location"); this.eventAggregator.Subscribe <MappingClonedEvent>(this.MappingCloned); this.TypeConfiguration = typeConfiguration; }
public void RegisterMenuItem( string menuItemName, string description, Type searchResultsViewType, Uri addNewEntityUri, string searchKey, string searchLabel, string baseEntityName = null) { var vm = this.container.Resolve <MenuItemViewModel>(); vm.Name = menuItemName; vm.Description = description; vm.SearchResultsViewType = searchResultsViewType; vm.AddEntityUri = addNewEntityUri; vm.SearchKey = searchKey; vm.SearchLabel = searchLabel; vm.BaseEntityName = baseEntityName; this.searchViewModel.AddMenuItem(vm); if (AuthorisationHelpers.HasEntityRights(menuItemName)) { this.shellViewModel.AddNewEntityMenuItem(vm); } }
private bool CanEditOrDeleteMapping(int mappingId) { var system = Mappings.Where(x => x.MappingId == mappingId).Select(x => x.SystemName).FirstOrDefault(); return(AuthorisationHelpers.HasMappingRights("PartyAccountability", system)); }