Ejemplo n.º 1
0
 public ActionResult CreateAdmin()
 {
     if (ApplicationSetup.HasAdminUser())
     {
         return(RedirectToAction("Step1"));
     }
     return(View(new CreateAdminAccount()));
 }
Ejemplo n.º 2
0
        public ActionResult CreateAdmin(CreateAdminAccount command)
        {
            if (ApplicationSetup.HasAdminUser())
            {
                ModelState.AddModelError("admin-already-exists", "Admin already exists");
            }

            if (!ModelState.IsValid)
            {
                return(View(command));
            }
            try {
                RegisterAccount(command);
            }
            catch (Exception e) {
                ModelState.AddModelError("exception", e);
                return(View(command));
            }

            return(RedirectToRoute("setup"));
        }
Ejemplo n.º 3
0
        public ActionResult Step1()
        {
            if (!ApplicationSetup.IsDatabaseCreated())
            {
                return(View());
            }

            if (!ApplicationSetup.IsSchemaUpToDate())
            {
                return(RedirectToAction("UpdateSchema"));
            }

            if (!ApplicationSetup.HasAdminUser())
            {
                return(View());
            }

            if (!ApplicationSetup.IsAPIKeyCreated())
            {
                return(RedirectToAction("CreateAPIKey"));
            }

            return(RedirectToAction("ThankYou"));
        }