示例#1
0
        public Tour AddNewItem(string name, string description, string start, string end, int distance)
        {
            ITourDAO  tourDao   = DALFactory.CreateTourDAO();
            IMapQuest mapQuest  = new MapQuest.MapQuest();
            string    imagePath = mapQuest.LoadImage(start, end);

            return(tourDao.AddNewItem(name, description, start, end, distance, imagePath));
        }
示例#2
0
        public Tour EditTour(Tour currentTour, string newName, string newDescription, string newStart, string newEnd, int newDistance)
        {
            ITourDAO  tourDao   = DALFactory.CreateTourDAO();
            IMapQuest mapQuest  = new MapQuest.MapQuest();
            string    imagePath = mapQuest.LoadImage(newStart, newEnd);

            return(tourDao.EditTour(currentTour, newName, newDescription, newStart, newEnd, newDistance, imagePath));
        }
示例#3
0
        public bool JsonExport()
        {
            IJsonManager jsonManager = new JsonManager(new SaveFile(), new OpenFile());
            ITourLogDAO  tourLogDao  = DALFactory.CreateTourLogDAO();
            ITourDAO     tourDao     = DALFactory.CreateTourDAO();

            IEnumerable <Tour>    tours    = tourDao.GetTours();
            IEnumerable <TourLog> tourLogs = tourLogDao.GetAllTourLogs();

            return(jsonManager.JsonExport(tours, tourLogs));
        }
示例#4
0
        public void DeleteTour(Tour tour, string imagePath)
        {
            ITourDAO tourDao = DALFactory.CreateTourDAO();

            tourDao.DeleteTour(tour);
        }
示例#5
0
        public IEnumerable <Tour> GetItems()
        {
            ITourDAO tourDao = DALFactory.CreateTourDAO();

            return(tourDao.GetTours());
        }
 public TourLogPostgresDAO()
 {
     _database = DALFactory.GetDatabase();
     _tourDAO  = DALFactory.CreateTourDAO();
 }