Exemple #1
0
 public ActionResult Subscribe(UserView userView)
 {
     if (ModelState.IsValid)
     {
         if (DB.UserNameExist(userView.UserName))
         {
             ModelState.AddModelError("UserName", "Ce nom d'usager existe déjà.");
             return(View(userView));
         }
         userView.Password = userView.NewPassword;
         DB.AddUser(userView);
         return(RedirectToAction("Login"));
     }
     return(View(userView));
 }