public IActionResult Delete()
        {
            bool result = login.checkSession();

            if (result == false)
            {
                curPage.errorMsg = "Either you do not have access to these tools or your session has timed out...";
                ViewBag.error    = "Still A viewbag CHANGE";
                return(RedirectToAction("Index", "VideoBackend", curPage));
            }

            AccountManager sqlStuff = new AccountManager();

            login userInformation = new login();

            curUser.username  = login.returnUsername();
            curUser.userTable = userdb;
            curUser           = AccountManager.checkAdmin(curUser);



            if (curUser.Admin == "Yes")
            {
                ViewBag.username = QUToolsUtilities.QueryString("uid");
                return(View());
            }
            else
            {
                curPage.errorMsg = "You do not appear to be an Administrator. ";
                return(RedirectToAction("Index", "VideoBackend", curPage));
            }
        }
        public ActionResult MainMenu()
        {
            //checks if the session id is valid
            bool result = login.checkSession();

            if (result == false)
            {
                TempData["error"] = login.connectionReturn;
                return(RedirectToAction("Index", "VideoBackend"));
            }

            curUser.username  = login.returnUsername();
            ViewData["user"]  = curUser.username;
            curUser.userTable = userdb;

            if (result == false)
            {
                return(RedirectToAction("Index", "VideoBackend"));
            }
            string error = QUToolsUtilities.QueryString("errors");

            if (error != null)
            {
                ViewBag.Error = error;
            }
            AccountManagerViewModel sqlStuff = new AccountManagerViewModel();

            sqlStuff = AccountManager.checkUser(curUser);


            if (sqlStuff.userlevel == null)
            {
                curPage.errorMsg = "You do not appear to have rights to access this Tool. ";
                ViewBag.errorMsg = curUser.returnMsg;

                return(RedirectToAction("Index", "VideoBackend", curPage));
            }
            if (curUser.Admin != "Yes")

            {
                curPage.errorMsg = "You do not appear to be an Administrator. ";
                //AccountManager curUser = new AccountManager();
                TempData["error"] = curPage.errorMsg;
                return(RedirectToAction("Index", "VideoBackend", curPage));
            }

            return(View());
        }