public ActionResult Register(Account acc) { if (ModelState.IsValid) { acc.Password = encry.PasswordEncrytion(acc.Password); db.Accounts.Add(acc); db.SaveChanges(); return(RedirectToAction("Login", "Account")); } return(View(acc)); }
public ActionResult Register(Account acc) { if (ModelState.IsValid) { // mã hóa mật khẩu trước khi lưu vào database acc.Password = encry.PasswordEncrytion(acc.Password); db.Accounts.Add(acc); db.SaveChanges(); return(RedirectToAction("Login", "Account")); } return(View(acc)); }
public ActionResult Register(CheckAccount Checkacc) { if (ModelState.IsValid) { Checkacc.CheckPassword = encry.PasswordEncrytion(Checkacc.CheckPassword); db.CheckAccounts.Add(Checkacc); db.SaveChanges(); return(RedirectToAction("Login", "CheckAccount")); } return(View(Checkacc)); }