public long CreateUser(string user, string password) { TSeg_Usuarios tSegUser = UserMapper.TransformLoginRequestToTSegUsuario(user, password); TSeg_Usuarios userOut = UserDomainService.CreateUser(tSegUser); return(userOut != null ? userOut.id : -1); }
public bool ValidateUser(string user, string password) { TSeg_Usuarios tSegUser = UserMapper.TransformLoginRequestToTSegUsuario(user, password); bool isValid = UserDomainService.ValidateUser(tSegUser); return(isValid); }
public TSeg_Usuarios CreateTSegUsuario(TSeg_Usuarios tSegUsuario) { try { _context.TSeg_Usuarios.Add(tSegUsuario); _context.SaveChanges(); return(tSegUsuario); } catch (Exception ex) { throw ex; } }
public bool ValidateUser(TSeg_Usuarios tSegUsuario) { try { TSeg_Usuarios tSegUsuarioResult = _context.TSeg_Usuarios.Where(x => x.usuario == tSegUsuario.usuario && x.contrasena == tSegUsuario.contrasena && x.estado == 1).FirstOrDefault(); return(tSegUsuarioResult == null ? false : true); } catch (Exception ex) { return(false); } }
public bool ValidateUser(TSeg_Usuarios user) { user.contrasena = Encryption.CreateMD5Hash(user.contrasena); return(UserRepository.ValidateUser(user)); }
public TSeg_Usuarios CreateUser(TSeg_Usuarios user) { user.contrasena = Encryption.CreateMD5Hash(user.contrasena); user.estado = 1; return(UserRepository.CreateTSegUsuario(user)); }