public ActionResult ExportBudget(CC.Web.Models.AgencyReportingBudgetModel model) { var all = model.GetAgencyReportingData(db, Permissions); var filtered = model.ApplyFilter(all); if (!string.IsNullOrEmpty(model.sSearch)) { filtered = filtered.Where(f => f.AgencyGroupName.Contains(model.sSearch) || f.AgencyName.Contains(model.sSearch) || f.ServiceTypeName.Contains(model.sSearch) || f.ServiceName.Contains(model.sSearch)); } var sorted = model.ApplySort(filtered); return(this.Excel("AgencyReportingBudgetRecap", "Data", sorted)); }
public JsonResult BudgetDataTable(CC.Web.Models.AgencyReportingBudgetModel model) { var all = model.GetAgencyReportingData(db, Permissions); var filtered = model.ApplyFilter(all); if (!string.IsNullOrEmpty(model.sSearch)) { filtered = filtered.Where(f => f.AgencyGroupName.Contains(model.sSearch) || f.AgencyName.Contains(model.sSearch) || f.ServiceTypeName.Contains(model.sSearch) || f.ServiceName.Contains(model.sSearch)); } var sorted = model.ApplySort(filtered); var data = new CC.Web.Models.jQueryDataTableResult() { sEcho = model.sEcho, iTotalDisplayRecords = filtered.Count(), iTotalRecords = all.Count(), aaData = sorted.Skip(model.iDisplayStart).Take(model.iDisplayLength) }; return(MyJsonResult(data)); }