public ActionResult InitDataTable(UserSearchModel model) { var query = _userService.GetAllUser(model.UserName, model.Email, model.Phone, model.SelectedRoles, model.iDisplayStart / model.iDisplayLength, model.iDisplayLength); var filterResult = query.Select(t => new UserListModel { Id = t.Id, UserName = t.UserName, Email = t.Email, Phone = t.Phone, Active = t.Active, RegisterDate = WebHelper.ConvertToUserTime(t.RegisterDate) }); int sortId = model.iDisplayStart + 1; var result = from t in filterResult select new[] { t.Id.ToString(), sortId++.ToString(), t.UserName, t.Email, t.Phone.ToString(), t.RegisterDate.ToString(), t.Active.ToString(), t.Id.ToString() }; return DataTableJsonResult(model.sEcho, model.iDisplayStart, query.TotalCount, query.TotalCount, result); }
public ActionResult List() { var model = new UserSearchModel(); return View(model); }