private void LoadBookmark(Chronozoom.Entities.Tour tour) { var bookmarks = DataEnvironmentAccess.AnInstance.GetITourBookmarkView(tour.ID); var bmarks = new List <Chronozoom.Entities.BookMark>(); foreach (var bookmark in bookmarks) { Chronozoom.Entities.BookMark b = new Chronozoom.Entities.BookMark(bookmark.ID, bookmark.Name, (!string.IsNullOrEmpty(bookmark.URL) && bookmark.URL.IndexOf('#') > 0) ? bookmark.URL.Substring(bookmark.URL.IndexOf('#') + 1): string.Empty, bookmark.LapseTime, bookmark.Description ); bmarks.Add(b); } tour.bookmarks = bmarks; }
public List <Chronozoom.Entities.Tour> GetTours() { var tours = new List <Chronozoom.Entities.Tour>(); var trs = DataEnvironmentAccess.AnInstance.GetITourView(); foreach (var tour in trs) { Chronozoom.Entities.Tour t = new Chronozoom.Entities.Tour(tour.ID, tour.Name, tour.UniqueID, tour.AudioBlobUrl, tour.Category, tour.Sequence ); LoadBookmark(t); tours.Add(t); } return(tours); }
// Returns the tour associated with a given bookmark id. public Tour GetBookmarkTour(Bookmark bookmark) { if (bookmark == null) return null; IEnumerable<Tour> bookmarkTour = new Tour[0]; try { retryPolicy.ExecuteAction( () => { bookmarkTour = Database.SqlQuery<Tour>("SELECT * FROM Tours WHERE Id in (SELECT Tour_Id FROM Bookmarks WHERE Id = {0})", bookmark.Id); }); } catch (Exception e) { throw e; } return bookmarkTour.FirstOrDefault(); }
public List<Chronozoom.Entities.Tour> GetTours() { var tours = new List<Chronozoom.Entities.Tour>(); var trs = DataEnvironmentAccess.AnInstance.GetITourView(); foreach (var tour in trs) { Chronozoom.Entities.Tour t = new Chronozoom.Entities.Tour(tour.ID, tour.Name, tour.UniqueID, tour.AudioBlobUrl, tour.Category, tour.Sequence ); LoadBookmark(t); tours.Add(t); } return tours; }