Example #1
0
        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()));
        }
Example #2
0
        public JsonResult <IEnumerable <UserInfo> > Get()
        {
            UserInfo[] ListOfUsers = UserBl.GetAllUsers();
            //testing push
            var users = from c in ListOfUsers
                        select c;


            return(Json(users));
        }
Example #3
0
 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"));
     }
 }
Example #4
0
 public List <User> GetAllUsers()
 {
     return(_userBl.GetAllUsers());
 }