public ActionResult list(string query = null) { var data = new List <Student>(); if (!String.IsNullOrWhiteSpace(query)) { data = _db.GetAllStudents(query, LoggedUser.IsSystemAdministrator); } else { data = _db.GetAllStudents(LoggedUser.IsSystemAdministrator); } return(new JsonNetResult(new { aaData = data })); }
public ActionResult index(string id) { ViewBag.ID = id; ViewBag.Students = _db.GetAllStudents(); ViewBag.Batch = _db.GetBatch(id); ViewBag.SelectedStudents = Newtonsoft.Json.JsonConvert.SerializeObject(_db.GetAllBatchUserMappings(id).Select(P => P.UserID).ToList()); return(View()); }