public bool TryValidateSearchParams(out HttpStatusViewResult exception) { exception = null; if (!IsPageValid()) { exception = new HttpBadRequestResult($"EmployerSearch: Invalid page {p}"); } if (!IsEmployerSizeValid()) { exception = new HttpBadRequestResult($"EmployerSearch: Invalid EmployerSize {es.ToDelimitedString()}"); } if (!IsReportingStatusValid()) { exception = new HttpBadRequestResult($"EmployerSearch: Invalid ReportingStatus {st.ToDelimitedString()}"); } return(exception == null); }
private string DecodeEmployerIdentifier(string employerIdentifier, out ActionResult actionResult) { string result = string.Empty; actionResult = new EmptyResult(); if (string.IsNullOrWhiteSpace(employerIdentifier)) { actionResult = new HttpBadRequestResult("Missing employer identifier"); } try { result = HttpUtility.UrlDecode(Encryption.DecryptQuerystring(employerIdentifier)); } catch (Exception ex) { CustomLogger.Error($"Cannot decrypt return id from '{employerIdentifier}'", ex); actionResult = View("CustomError", new ErrorViewModel(400)); } return(result); }