예제 #1
0
        public Trip Get(int id)
        {
            ITripDbProvider db = ObjectContainer.GetTripDbProvider();

            Trip trip = db.Read(id);

            trip.ArrangePoints();

            return(trip);
        }
예제 #2
0
        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));
            }
        }
예제 #3
0
        public List <Location> GetList(int tripId)
        {
            ITripDbProvider db = ObjectContainer.GetTripDbProvider();

            return(db.Read(tripId).Locations.ToList());
        }
예제 #4
0
        public IList <Trip> GetList(int userId)
        {
            ITripDbProvider db = ObjectContainer.GetTripDbProvider();

            return(db.FindByUserId(userId));
        }
예제 #5
0
        public void Delete(int id)
        {
            ITripDbProvider db = ObjectContainer.GetTripDbProvider();

            db.Delete(id);
        }