예제 #1
0
        public async Task <IActionResult> ConfirmConditionsOfAcceptance(ConditionsOfAcceptanceViewModel model)
        {
            if (!ModelState.IsValid)
            {
                model.ErrorMessages = new List <ValidationErrorDetail>();
                var modelErrors = ModelState.Values.SelectMany(v => v.Errors);
                foreach (var modelError in modelErrors)
                {
                    model.ErrorMessages.Add(new ValidationErrorDetail
                    {
                        Field        = "ConditionsAccepted",
                        ErrorMessage = modelError.ErrorMessage
                    });
                }
                return(View("~/Views/Roatp/ConditionsOfAcceptance.cshtml", model));
            }

            if (model.ConditionsAccepted != "YES")
            {
                return(RedirectToAction("ConditionsOfAcceptanceNotAgreed", "RoatpShutterPages", model));
            }
            else if (model.ApplicationId == Guid.Empty)
            {
                return(await StartApplication(new SelectApplicationRouteViewModel
                {
                    ApplicationRouteId = model.ApplicationRouteId,
                    ApplicationId = model.ApplicationId
                }));
            }
            else
            {
                return(RedirectToAction("TaskList", "RoatpApplication", new { applicationId = model.ApplicationId }, "Sequence_1"));
            }
        }
예제 #2
0
 public IActionResult ConditionsOfAcceptanceNotAgreed(ConditionsOfAcceptanceViewModel model)
 {
     return(View("~/Views/Roatp/ShutterPages/ConditionsOfAcceptanceNotAgreed.cshtml", model));
 }