public Trip Get(int id) { ITripDbProvider db = ObjectContainer.GetTripDbProvider(); Trip trip = db.Read(id); trip.ArrangePoints(); return(trip); }
public Trip SaveAndReturn(int userId, Trip trip) { ITripDbProvider db = ObjectContainer.GetTripDbProvider(); if (trip.ID == 0) { return(db.CreateAndReturn(trip, userId)); } else { return(db.UpdateAndReturn(trip, userId)); } }
public List <Location> GetList(int tripId) { ITripDbProvider db = ObjectContainer.GetTripDbProvider(); return(db.Read(tripId).Locations.ToList()); }
public IList <Trip> GetList(int userId) { ITripDbProvider db = ObjectContainer.GetTripDbProvider(); return(db.FindByUserId(userId)); }
public void Delete(int id) { ITripDbProvider db = ObjectContainer.GetTripDbProvider(); db.Delete(id); }