public void SaveRecentHistory(int tocId, string tocTitle, string email, string serviceCode)
 {
     var publication = GlobalAccess.Instance.CurrentPublication.DlBook;
     var tocDetail   = packageAccess.GetTOCDetailByTOCId(publication.GetDecryptedDbFullName(), tocId);
     //RecentHistory history = new RecentHistory
     //{
     //    BookId = publication.BookId,
     //    DocID = tocDetail != null ? string.Join(",", tocDetail.Select(o => o.DocID)) : string.Empty,
     //    LastReadDate = DateTime.Now,
     //    TOCTitle = tocTitle,
     //    ColorPrimary = publication.ColorPrimary,
     //    ServiceCode = serviceCode,
     //    Email = email,
     //    DlBookTitle = publication.Name
     //};
     //recentHistoryAccess.UpdateRecentHistory(history);
 }
Esempio n. 2
0
        /// <summary>
        /// get Annotations By TocId
        /// </summary>
        /// <param name="bookId"></param>
        /// <param name="tocId"></param>
        /// <returns></returns>
        public List <Annotation> GetAnnotationsByTocId(int bookId, int tocId)
        {
            DomainEvents.Publish(new PublicationOpeningEvent(bookId, false)).Wait();
            var tocdDetails = packageAccess.GetTOCDetailByTOCId(GlobalAccess.Instance.CurrentPublication.DecryptedDbFullName, tocId);

            if (tocdDetails != null)
            {
                List <Annotation> annotations = new List <Annotation>();
                foreach (var tocdDetail in tocdDetails)
                {
                    annotations.AddRange(GetAnnotationsByDocId(tocdDetail.DocID, GlobalAccess.Instance.CurrentPublication.DlBook));
                }
                return(annotations);
            }
            else
            {
                return(null);
            }
        }