public ActionResult Create(Aluno aluno)
        {
            if (ModelState.IsValid)
            {
                MembershipUser user = Membership.CreateUser(aluno.Login,
                    Membership.GeneratePassword(6, 0),
                    aluno.Email);

                 if (user.IsApproved)
                 {
                     Repositorio.Incluir(aluno);

                     Roles.AddUsersToRole(new string[] { aluno.Login }, "aluno");

                     SGAccountController accountController = new SGAccountController();
                     accountController.ForgotPassword(
                         new SecurityGuard.ViewModels.ForgotPasswordViewModel()
                         {
                             RequireSecretQuestionAndAnswer = false,
                             Email = aluno.Email,
                             Checked = false,
                         });
                 }

                return RedirectToAction("Index");
            }

            ViewBag.ModuloID = new SelectList(TodosModulosEnumerable(), "Id", "Nome", aluno.ModuloID);
            return View(aluno);
        }
        public ActionResult Create(Administrador administrador)
        {
            if (ModelState.IsValid)
            {
                Repositorio.Incluir(administrador);

                MembershipUser user = Membership.CreateUser(administrador.Login,
                    Membership.GeneratePassword(6, 1),
                    administrador.Email);

                if (user.IsApproved)
                {
                    Roles.AddUsersToRole(new string[] { administrador.Login },"admin");

                    SGAccountController accountController = new SGAccountController();
                    accountController.ForgotPassword(
                        new SecurityGuard.ViewModels.ForgotPasswordViewModel()
                        {
                            RequireSecretQuestionAndAnswer = false,
                            Email = administrador.Email,
                            Checked = false,
                        });
                }

                return RedirectToAction("Index");
            }

            return View(administrador);
        }