public List <Trip> GetTripsByUser(User.User user) { List <Trip> tripList = new List <Trip>(); User.User loggedUser = UserSession.GetInstance().getLoggedUser(); bool isFriend = false; if (loggedUser != null) { foreach (User.User friend in user.GetFriends()) { if (friend.Equals(loggedUser)) { isFriend = true; break; } } if (isFriend) { tripList = TripDAO.FindTripsByUser(user); } return(tripList); } else { throw new UserNotLoggedInException(); } }
protected virtual List <Trip> FindTripsByUser(User.User user) { return(TripDAO.FindTripsByUser(user)); }
protected virtual List <Trip> GetTripsBy(User.User user) { return(_tripDAO.FindTripsByUser(user)); }
public List <Trip> FindTripsByUser(User.User user) { return(TripDAO.FindTripsByUser(user)); }
public virtual List <Trip> FindTrips(User.User user) { return(TripDAO.FindTripsByUser(user)); }