public async Task<ActionResult> Index(Guid id)
        {
            var details = await mediator.SendAsync(new GetSummary(id));
            var authorised = Task.Run(() => authorizationService.AuthorizeActivity(typeof(GetOriginalNumberOfShipments))).Result;

            var model = new SummaryTableContainerViewModel
            {
                Details = details,
                ShowChangeLinks = details.Status == ImportNotificationStatus.NotificationReceived,
                ShowChangeShipmentNumberLink = authorised && details.Status == ImportNotificationStatus.Consented
            };

            return View(model);
        }
Esempio n. 2
0
        public async Task <ActionResult> Index(Guid id)
        {
            var details = await mediator.SendAsync(new GetSummary(id));

            var canChangeNumberOfShipments = Task.Run(() => authorizationService.AuthorizeActivity(typeof(GetOriginalNumberOfShipments))).Result;
            var canChangeEntryExitPoint    = Task.Run(() => authorizationService.AuthorizeActivity(ImportNotificationPermissions.CanChangeImportEntryExitPoint)).Result;
            var canChangeWasteTypes        = Task.Run(() => authorizationService.AuthorizeActivity(ImportNotificationPermissions.CanChangeWasteTypes)).Result;
            var canChangeWasteOperation    = Task.Run(() => authorizationService.AuthorizeActivity(ImportNotificationPermissions.CanChangeWasteOperation)).Result;
            var canEditContactDetails      = Task.Run(() => authorizationService.AuthorizeActivity(ImportNotificationPermissions.CanEditImportContactDetails)).Result;

            var model = new SummaryTableContainerViewModel(details, canChangeNumberOfShipments, canChangeEntryExitPoint, canChangeWasteTypes, canChangeWasteOperation, canEditContactDetails);

            return(View(model));
        }