예제 #1
0
        public async Task <IActionResult> Index(Guid requestId, bool edit)
        {
            var supportRequest = await _mediator.Send(new GetTempSupportRequest(requestId));

            var vm = new YourDetailsViewModel(supportRequest, requestId, edit);

            return(View("~/Views/RequestSupport/YourDetails.cshtml", vm));
        }
예제 #2
0
        public async Task <IActionResult> Index(Guid requestId, YourDetailsViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction("Index", "YourDetails", new { requestId }));
            }

            var supportRequest = await _mediator.Send(new GetTempSupportRequest(requestId));

            viewModel.UpdateTempSupportRequest(supportRequest);

            await _mediator.Send(new SaveTempSupportRequest());

            if (viewModel.Edit == true)
            {
                return(RedirectToAction("Index", "CheckYourDetails", new { requestId = requestId }));
            }

            return(RedirectToAction("Index", "OrganisationType", new { requestId = requestId }));
        }