Example #1
0
        public async Task <ActionResult <List <Report> > > GetReportByParam([FromQuery] QueryParameters request)
        {
            (bool success, List <Report> output) = await _webSiteServices.GetReportByParam(request.CompanyId, request.StartDate, request.EndDate);

            if (success)
            {
                return(output);
            }
            else
            {
                return(StatusCode(500, "Internal server error"));
            }
        }
        public async Task <IActionResult> GetReportByParam([FromQuery] QueryParameters request)
        {
            (bool success, List <Report> output) = await _webSiteServices.GetReportByParam(request.CompanyId, request.StartDate, request.EndDate);

            if (success)
            {
                return(View(output));
            }
            else
            {
                var NotFoundViewModel = new ErrorViewModel {
                    RequestId = Activity.Current?.Id ?? HttpContext.TraceIdentifier
                };
                return(View("Error", NotFoundViewModel));
            }
        }