//public IActionResult OnGetList() //{ // if (!ModelState.IsValid) // { // return Page(); // } // RequestReport = _webAddressVerification.ReportRequestGet(Input.Status, Input.FromDate, Input.ToDate, Input.CallerId, Input.Street); // ReportStarted = true; // return Page(); //} public IActionResult OnPost() { if (!ModelState.IsValid) { return(Page()); } try { RequestReport = _webAddressVerification.ReportRequestGet(Input.Status, Input.FromDate, Input.ToDate, Input.CallerId, Input.Street); ReportStarted = true; } catch { ReportStarted = true; ErrorMessage = "Report not found"; } return(Page()); }
public ActionResult <List <Report> > PostReport([FromBody] ReportPost report) { try { var ReportList = _webAddressVerification.ReportRequestGet(report.Status, report.FromDate, report.ToDate, report.CallerId, report.Street); if (ReportList?.Count > 0) { return(Ok(ReportList)); } else { return(NotFound()); } } catch (Exception e) { _logger.LogError(e.Message, e.StackTrace); return(StatusCode(500)); } }