public ActionResult DataSource(Syncfusion.JavaScript.DataManager dm) { DataResult result = new DataResult(); Syncfusion.JavaScript.DataSources.DataOperations dataOperations = new Syncfusion.JavaScript.DataSources.DataOperations(); result.result = context.Albums.Include(a => a.Artista).Include(a => a.Genero).ToList(); if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting { result.result = dataOperations.PerformSorting(result.result, dm.Sorted); } if (dm.Where != null && dm.Where.Count > 0) //Filtering { result.result = dataOperations.PerformWhereFilter(result.result, dm.Where, dm.Where[0].Operator); if (!dm.RequiresCounts) { return(Json(result.result)); } } result.count = context.Albums.Include(a => a.Artista).Include(a => a.Genero).AsQueryable().Count(); if (dm.Skip != 0) { result.result = dataOperations.PerformSkip(result.result, dm.Skip); } if (dm.Take != 0) { result.result = dataOperations.PerformTake(result.result, dm.Take); } if (dm.Search != null) { result.result = dataOperations.PerformSearching(result.result, dm.Search); } return(Json(new { result = result.result, count = result.count }, JsonRequestBehavior.AllowGet)); }
public ActionResult DataEmpleado(Syncfusion.JavaScript.DataManager dm) { DataResultEmpleado result = new DataResultEmpleado(); Syncfusion.JavaScript.DataSources.DataOperations dataOperations = new Syncfusion.JavaScript.DataSources.DataOperations(); result.result = context.Empleados.Include(e => e.Departamento).Include(e => e.Sexo).Include(e => e.EstadoCivil).ToList(); if (dm.Sorted != null && dm.Sorted.Count > 0) //Sorting { result.result = dataOperations.PerformSorting(result.result, dm.Sorted); } if (dm.Where != null && dm.Where.Count > 0) //Filtering { result.result = dataOperations.PerformWhereFilter(result.result, dm.Where, dm.Where[0].Operator); if (!dm.RequiresCounts) { return(Json(result.result)); } } result.count = context.Empleados.Include(e => e.Departamento).Include(e => e.Sexo).Include(e => e.EstadoCivil).AsQueryable().Count(); if (dm.Skip != 0) { result.result = dataOperations.PerformSkip(result.result, dm.Skip); } if (dm.Take != 0) { result.result = dataOperations.PerformTake(result.result, dm.Take); } return(Json(new { result = result.result, count = result.count }, JsonRequestBehavior.AllowGet)); }
public ActionResult GetOutletsForAutocomplete(DataManager value) { var models = GetTestData(); IEnumerable <AutocompleteModel> Data = GetTestData(); Syncfusion.JavaScript.DataSources.DataOperations operation = new Syncfusion.JavaScript.DataSources.DataOperations(); if (value.Where != null && value.Where.Count > 0) //Filtering { Data = operation.PerformWhereFilter(models, value.Where, value.Where[0].Operator); } return(Json(Data, JsonRequestBehavior.AllowGet)); }
// GET: Employee public ActionResult Index(DataManager value) { var models = GetTestData(); IEnumerable Data = GetTestData(); Syncfusion.JavaScript.DataSources.DataOperations operation = new Syncfusion.JavaScript.DataSources.DataOperations(); var data = operation.Execute(models, value); if (value.Where != null && value.Where.Count > 0) //Filtering { data = operation.PerformWhereFilter(models, value.Where, value.Where[0].Operator); } return(Json(data, JsonRequestBehavior.AllowGet)); }