public async Task <IActionResult> GetPerformanceReport([FromBody] PerformanceReportViewModel prvm) { try { return(Ok(await prRepo.GetPerformanceReport(prvm))); } catch (CustomException cex) { var responseObj = new EmaintenanceMessage(cex.Message, cex.Type, cex.IsException, cex.Exception?.ToString()); return(StatusCode(StatusCodes.Status500InternalServerError, responseObj)); } catch (Exception ex) { return(Ok(new EmaintenanceMessage(ex.Message))); } }
public async Task <IEnumerable <dynamic> > GetPerformanceReport(PerformanceReportViewModel prvm) { string sql = "dbo.EAppRptPerformance"; using (var conn = util.MasterCon()) { try { return(await(conn.QueryAsync <dynamic>(sql, new { prvm.ReportType, prvm.ClientSiteId, prvm.PlantAreaId, prvm.LanguageId, prvm.FromDate, prvm.ToDate }, commandType: CommandType.StoredProcedure))); } catch (Exception ex) { throw new CustomException("Unable to Load Data, Please Contact Support!!!", "Error", true, ex); } } }