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)); }
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)); }
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)); }
public void DeleteTour(Tour tour, string imagePath) { ITourDAO tourDao = DALFactory.CreateTourDAO(); tourDao.DeleteTour(tour); }
public IEnumerable <Tour> GetItems() { ITourDAO tourDao = DALFactory.CreateTourDAO(); return(tourDao.GetTours()); }
public TourLogPostgresDAO() { _database = DALFactory.GetDatabase(); _tourDAO = DALFactory.CreateTourDAO(); }