Esempio n. 1
0
        public async Task <ActionResult> Approved(string hashedAccountId, string hashedCommitmentId)
        {
            if (!await IsUserRoleAuthorized(hashedAccountId, Role.Owner, Role.Transactor))
            {
                return(View("AccessDenied"));
            }

            var model = await _employerCommitmentsOrchestrator.GetAcknowledgementModelForExistingCommitment(
                hashedAccountId,
                hashedCommitmentId,
                OwinWrapper.GetClaimValue(@"sub"));

            var currentStatusCohortAny = await _employerCommitmentsOrchestrator
                                         .AnyCohortsForCurrentStatus(hashedAccountId, RequestStatus.ReadyForApproval);

            model.Data.BackLink = currentStatusCohortAny
                ? new LinkViewModel {
                Text = "Return to Approve cohorts", Url = Url.Action("ReadyForApproval", new { hashedAccountId })
            }
                : new LinkViewModel {
                Text = "Return to Your cohorts", Url = Url.Action("YourCohorts", new { hashedAccountId })
            };

            return(View(model));
        }