Esempio n. 1
0
        public IActionResult DatabaseCheck(string id)
        {
            //prevent start wizard if already passed
            if (!bool.Parse(configuration["FirstRun"]))
            {
                return(View("Error", ALREADY_PASSED_MESSAGE));
            }


            if (id == "Delete")
            {
                SystemController.ClearAllDatabases();
                return(RedirectToAction("Gateway"));
            }
            if (id == "Use")
            {
                return(RedirectToAction("Gateway"));
            }


            if ((SystemController.nodesDb.GetAllNodes() != null && SystemController.nodesDb.GetAllNodes().Count != 0) ||
                (SystemController.usersDb.GetUsersCount() != 0))
            {
                return(View("DatabaseIsNotEmpty"));
            }

            return(RedirectToAction("Gateway"));
        }