Пример #1
0
 public ActionResult Index(int?UserID)
 {
     if (UserID != null)
     {
         ViewBag.Username = repository.getUserByID((int)UserID).Name.ToString();
         return(View(repository.UserResults.Where(u => u.UserId == UserID).OrderByDescending(r => r.TestTakenTime)));
     }
     ViewBag.Username = Session["User"].ToString();
     return(View(repository.UserResults.Where(u => u.UserId == repository.getUserByName(Session["User"].ToString()).ID).OrderByDescending(r => r.TestTakenTime)));
 }
Пример #2
0
 public ActionResult ControlUsers(int userID)
 {
     repository.deactivateUser(userID);
     TempData["Message"] = string.Format("მომხმარებლის წაშლა მოხდა წარმატებით", repository.getUserByID(userID).Name);
     return(RedirectToAction("ControlUsers"));
 }