Esempio n. 1
0
 public IActionResult Users()
 {
     try
     {
         var list = _facade.GetAllUsersExceptMe(new Guid(HttpContext.Session.Id));
         return(View(list.Select(b => new AdminUsersDisplayModel()
         {
             Guid = b.Guid,
             Username = b.Username,
         }).ToList()));
     }
     catch (GeneralServerError)
     {
         var redirect = this.Url.Action("Index", "Admin");
         var message  = new UserMessage(redirect, "An error has occured. Please refresh and try again.");
         return(View("UserMessage", message));
     }
     catch (DatabaseConnectionTimeoutException)
     {
         var redirect = this.Url.Action("Index", "Admin");
         var message  = new UserMessage(redirect, "An error has occured. Please refresh and try again. (Database connection lost).");
         return(View("UserMessage", message));
     }
 }
Esempio n. 2
0
 public ICollection <BaseUser> GetAllUsersExceptMe(Guid cookie)
 {
     return(_serviceFacade.GetAllUsersExceptMe(cookie));
 }