Exemple #1
0
 public string UpdateUser(int id, string name, string password, string gustosMusicales)
 {
     try
     {
         List <User> users = Users();
         users.ForEach(x => { if (x.Name.Equals(name))
                              {
                                  throw new FindException("Ya existe un usuario con ese nombre");
                              }
                       });
         if (Check())
         {
             return(db.EditUser(id, name, password, gustosMusicales));
         }
     }
     catch (UnCheckException ex)
     {
         throw ex;
     }
     catch (FindException)
     {
         throw new FindException();
     }
     catch (GenericException ex)
     {
         throw ex;
     }
     return("No tienes permisos de administrador");
 }