public ActionResult ImportNavigation(Guid id, ImportNavigationSection section) { var details = Task.Run(() => mediator.SendAsync(new GetNotificationDetails(id))).Result; var showAssessmentDecision = Task.Run(() => authorizationService.AuthorizeActivity( ImportNotificationPermissions.CanMakeImportNotificationAssessmentDecision)) .Result; var showKeyDatesOverride = Task.Run(() => authorizationService.AuthorizeActivity( UserAdministrationPermissions.CanOverrideKeyDates)) .Result; var hasComments = Task.Run(() => mediator.SendAsync(new CheckImportNotificationHasComments(id))).Result; var model = new ImportNavigationViewModel { Details = details, ActiveSection = section, ShowImportSections = details.Status == ImportNotificationStatus.NotificationReceived, AdminLinksModel = CreateAdminLinksViewModel(), ShowAssessmentDecision = showAssessmentDecision, ShowKeyDatesOverride = showKeyDatesOverride, HasComments = hasComments }; return(PartialView("_ImportNavigation", model)); }
public ActionResult ImportNavigation(Guid id, ImportNavigationSection section) { var details = Task.Run(() => mediator.SendAsync(new GetNotificationDetails(id))).Result; var showAssessmentDecision = Task.Run(() => authorizationService.AuthorizeActivity( ImportNotificationPermissions.CanMakeImportNotificationAssessmentDecision)) .Result; var showKeyDatesOverride = Task.Run(() => authorizationService.AuthorizeActivity( UserAdministrationPermissions.CanOverrideKeyDates)) .Result; var showDeleteMovementLink = Task.Run(() => authorizationService.AuthorizeActivity( UserAdministrationPermissions.CanDeleteMovements)) .Result; var model = new ImportNavigationViewModel { Details = details, ActiveSection = section, ShowImportSections = details.Status == ImportNotificationStatus.NotificationReceived, AdminLinksModel = CreateAdminLinksViewModel(), ShowAssessmentDecision = showAssessmentDecision, ShowKeyDatesOverride = showKeyDatesOverride, ShowDeleteMovementLink = showDeleteMovementLink }; return PartialView("_ImportNavigation", model); }