Beispiel #1
0
        public async Task <IActionResult> DebtStoppedAllAction(CreditorDebtStoppedAllActionViewModel model)
        {
            SetJourneyObject(model);
            if (!ModelState.IsValid)
            {
                return(ContinueJourneyRedirect(nameof(DebtStoppedAllAction)));
            }

            await _creditorServiceGateway.SubmitDebtStoppedAllAction(model);

            var modelOut = new CreditorBannerViewModel
            {
                BannerHeading = _bannerHeader,
                BannerText    = "You’ve stopped all action against the debt",
            };

            return(CompleteSubJourneyRedirect(nameof(BreathingSpace), modelOut));
        }
Beispiel #2
0
        public IActionResult DebtStoppedAllAction(int index)
        {
            var storedModel = GetJourneyObject <CreditorDebtStoppedAllActionViewModel>();

            if (storedModel != null)
            {
                TryValidateModel(storedModel);
                return(View(storedModel));
            }

            var debts = GetTempDataObject <List <CreditorDebtPartialViewModel> >(_debts);

            var model = new CreditorDebtStoppedAllActionViewModel
            {
                Debt = debts[index]
            };

            return(View(model));
        }