Exemple #1
0
        public ActionResult Registration()
        {
            RegistrUserModel registrUserModel = new RegistrUserModel();

            ViewBag.ListRole = registrUserModel.GetListRole();
            return(View(registrUserModel));
        }
Exemple #2
0
 public ActionResult Registration(RegistrUserModel model, string ConfirmPassword)
 {
     if (ModelState.IsValid)
     {
         bool IsCompareLogin = Authentification.NoMatches(model.LogIn);
         if (IsCompareLogin)
         {
             Authentification.Registration(model);
             return(RedirectToAction("ViewerNameForum", "Home"));
         }
     }
     return(View());
 }
Exemple #3
0
        public static void Registration(RegistrUserModel user)
        {
            Entities db    = new Entities();
            Users    users = new Users()
            {
                FIO = user.FIO, LogIn = user.LogIn, Password = Encript.Encrypt(user.Password), Role_id = int.Parse(user.Role)
            };

            db.Users.Add(users);
            db.SaveChanges();
            _FIO      = users.FIO;
            _password = users.Password;
            _role     = GetRole(int.Parse(user.Role));
            _status   = true;
        }