public async Task <ActionResult> ChangePostcode(OutcomeViewModel model) { ModelState.Clear(); await _auditLogger.LogEventData(model, "User elected to change postcode."); return(View(model));; }
public async Task <ActionResult> Postcode(OutcomeViewModel model) { ModelState.Clear(); model.UserInfo.CurrentAddress.IsPostcodeFirst = false; await _auditLogger.LogEventData(model, "User entered postcode on second request"); return(View(model)); }
public string GetViewName(JourneyViewModel model, ControllerContext context) { if (model == null) { return("../Question/Question"); } switch (model.NodeType) { case NodeType.Outcome: if (model.OutcomeGroup.IsPostcodeFirst()) { model.UserInfo.CurrentAddress.IsPostcodeFirst = true; _auditLogger.LogEventData(model, "Postcode first journey started"); } var viewFilePath = model.OutcomeGroup.IsPostcodeFirst() ? "../PostcodeFirst/Postcode" : "../Outcome/" + model.OutcomeGroup.Id; if (ViewExists(viewFilePath, context)) { _userZoomDataBuilder.SetFieldsForOutcome(model); return(viewFilePath); } throw new ArgumentOutOfRangeException(string.Format("Outcome group {0} for outcome {1} has no view configured", model.OutcomeGroup.ToString(), model.Id)); case NodeType.DeadEndJump: _userZoomDataBuilder.SetFieldsForOutcome(model); return("../Outcome/DeadEndJump"); case NodeType.PathwaySelectionJump: _userZoomDataBuilder.SetFieldsForOutcome(model); return("../Outcome/PathwaySelectionJump"); case NodeType.CareAdvice: _userZoomDataBuilder.SetFieldsForCareAdvice(model); return("../Question/InlineCareAdvice"); case NodeType.Question: default: _userZoomDataBuilder.SetFieldsForQuestion(model); return("../Question/Question"); } }
public ActionResult GetDirections(OutcomeViewModel model, int selectedServiceId, string selectedServiceName, string selectedServiceAddress) { _auditLogger.LogEventData(model, string.Format("User selected service '{0}' ({1})", selectedServiceName, selectedServiceId)); return(Redirect(string.Format(_configuration.MapsApiUrl, selectedServiceName, selectedServiceAddress))); }