public ActionResult Details() { if (!IsAdminConnected()) { return(RedirectToAction("Index", "Error", new { error = "You must be an admin to view users data. please go to admin page" })); } return(View(_userBl.GetAllUsers())); }
public JsonResult <IEnumerable <UserInfo> > Get() { UserInfo[] ListOfUsers = UserBl.GetAllUsers(); //testing push var users = from c in ListOfUsers select c; return(Json(users)); }
public ActionResult Edit(string id) { if (!IsAdminConnected()) { return(RedirectToAction("Index", "Error", new { error = "You must be an admin to edit." })); } try { Comment comment = _commentBl.GetById(int.Parse(id)); if (comment == null) { return(RedirectToAction("Index", "Error", new { error = string.Format("Could not find comment with id {0}", id) })); } ViewBag.users = _userBl.GetAllUsers(); return(View(comment)); } catch { return(RedirectToAction("Index", "Error")); } }
public List <User> GetAllUsers() { return(_userBl.GetAllUsers()); }