Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.49 KB | None | 0 0
  1. if (foundUser != null && string.Compare(password, repeatPassword, false) == 0)
  2. {
  3.     foundUser.Password = CreateHash(password);
  4.     db.Entry(foundUser).State = EntityState.Modified;
  5.     db.SaveChanges();
  6.  
  7.     return RedirectToAction("Index");
  8. }
  9. else if (foundUser == null)
  10.     ModelState.AddModelError("", "User not found! Please provide correct name and e-mail");
  11. else if (string.Compare(password, repeatPassword, false) != 0)
  12.     ModelState.AddModelError("", "Passwords are not the same!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement