Exemplo n.º 1
0
        public ActionResult CreateSupportCase(Models.SupportCases supportCases)
        {
            //Checks that the user is logged in, if they aren't then they are redirected to the login page
            if (HttpContext.Session["username"] == null)
            {
                return(RedirectToAction("Index", "Login"));
            }

            //Checks access level of the user, to see if they can acess this page
            if (!Permissions.hasPermission(HttpContext.Session["accessLevel"].ToString(), Permissions.perms.CreateSupportCase))
            {
                return(RedirectToAction("Index", "Dashboard"));
            }


            if (supportCases != null)
            {
                supportCases.addNewCase();
                return(RedirectToAction("Index", "SupportCases"));
            }
            else
            {
                return(View("Index"));
            }
        }