public JsonResult Report(Guid id, bool grouped = false, bool includeUnknown = false) { var imageBaseUrl = $"{this.Request.Scheme}://{this.Request.Host}"; // TODO: DJC this looks supiciously wrong... Investigate var inspectionItems = InspectionService.GetInspectionItems(_context) .Single(i => i.Id == id) .InspectionItems; return(InspectionService.BuildInspectionReport(_context, imageBaseUrl, inspectionItems, grouped, includeUnknown)); }
public ActionResult ReportForOrder(string id, bool grouped = false, bool includeUnknown = false) { var imageBaseUrl = $"{this.Request.Scheme}://{this.Request.Host}"; var inspectionItems = InspectionService.GetInspectionItems(_context) .SingleOrDefault(i => i.WorkOrderId == id) ?.InspectionItems; if (inspectionItems == null) { return(NotFound()); } return(InspectionService.BuildInspectionReport(_context, imageBaseUrl, inspectionItems, grouped, includeUnknown)); }