public ActionResult Registration() { RegistrUserModel registrUserModel = new RegistrUserModel(); ViewBag.ListRole = registrUserModel.GetListRole(); return(View(registrUserModel)); }
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()); }
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; }