public ActionResult Create(user user)
 {
     try
     {
         var senhaCriptografada = Criptografic.Codifica(user.Password);
         user.Password = senhaCriptografada;
         user.Login    = user.Login.Trim();
         var numUser = ur.GetAll().Where(x => x.Login == user.Login).Count();
         if (numUser > 0)
         {
             string error = "Já existe este login no sistema";
             return(RedirectToAction("Create", new { erro = error }));
         }
         else
         {
             ur.Save(user);
             return(RedirectToAction("Index"));
         }
     }
     catch
     {
         return(View());
     }
 }
Beispiel #2
0
 public void Save()
 {
     repo.Save();
 }