public string GetMecha() { List <Context.Mekanik> dbitems = new List <Context.Mekanik>(); dbitems = RepoMecha.FindAll().ToList(); return(new JavaScriptSerializer().Serialize(dbitems)); }
public string Binding() { GridRequestParameters param = GridRequestParameters.Current; List <Context.Mekanik> items = RepoMekanik.FindAll(param.Skip, param.Take, (param.Sortings != null ? param.Sortings.ToList() : null), param.Filters); List <Mekanik> ListModel = new List <Mekanik>(); foreach (Context.Mekanik item in items) { ListModel.Add(new Mekanik(item)); } int total = RepoMekanik.Count(param.Filters); return(new JavaScriptSerializer().Serialize(new { total = total, data = ListModel })); }