private static List <VwProjectCloseouts> GetData(ProjectCloseoutsParams Params) { using var db = new ModelContext(); return(db.VwProjectCloseouts .Where(x => Params.Client == null || Params.Client == "" || x.Client == Params.Client) .Where(x => Params.ProjectTitle == null || Params.ProjectTitle == "" || x.Title == Params.ProjectTitle) .Where(x => Params.StartDate == null || x.DateCreated >= Params.StartDate.Value) .Where(x => Params.EndDate == null || x.DateCreated <= Params.EndDate.Value.AddDays(1)) .ToList()); }
public IActionResult Get(ProjectCloseoutsParams Params) { return(Ok(GetData(Params))); }
public IActionResult GetExcel(ProjectCloseoutsParams Params) { var data = GetData(Params); return(File(ExcelService.GenerateExcelWorkbook(data), "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")); }
public async Task <HttpResponseMessage> GetProjectCloseoutsExcel(ProjectCloseoutsParams para) { return(await http.PostAsJsonAsync("api/reports/project-closeouts/excel", para)); }