public ActionResult CheckAdmin()
        {
            try
            {
                if (Session["UserID"].ToString() == null)
                {
                    throw new NotLoggedInException();
                }

                if (userBusinessContext.CheckAdmin(new Guid(Session["UserID"].ToString())))
                {
                    return(View("Admin"));
                }
                else
                {
                    return(View("NotAdmin"));
                }
            }
            catch (NotLoggedInException ex)
            {
                return(RedirectToAction("ExceptionCatch", "Static", new { exception = ex }));
            }
            catch (Exception ex)
            {
                return(RedirectToAction("ExceptionCatch", "Static", new { exception = ex }));
            }
        }
Exemplo n.º 2
0
 public ActionResult CheckAdmin()
 {
     try
     {
         if (userBusinessContext.CheckAdmin(new Guid(Session["UserID"].ToString())))
         {
             return(View("Admin"));
         }
         else
         {
             return(View("NotAdmin"));
         }
     }
     catch (Exception)
     {
         return(View("InternalError"));
     }
 }