public override void DeleteChapter(string chapterId) { try { using (TransactionScope transaction = new TransactionScope(mConfiguration)) { ChapterDataStore dataStore = new ChapterDataStore(transaction); dataStore.Delete(chapterId); ChapterVersionDataStore dsChapVersion = new ChapterVersionDataStore(transaction); IList <ChapterVersion> chVersionsList = dsChapVersion.FindAllItems(chapterId); foreach (ChapterVersion item in chVersionsList) { item.Deleted = true; dsChapVersion.Update(item); } transaction.Commit(); } } catch { throw new NotImplementedException(); } }
public override IList <ChapterVersion> GetAllChapVersions() { using (TransactionScope transaction = new TransactionScope(mConfiguration)) { ChapterVersionDataStore chapVersion = new ChapterVersionDataStore(transaction); return(chapVersion.FindAllItems()); } }
public override ChapterVersion GetChapterVersion(string chapterId) { using (TransactionScope transaction = new TransactionScope(mConfiguration)) { ChapterVersionDataStore chapVersion = new ChapterVersionDataStore(transaction); return(chapVersion.FindAllItems().First(x => x.Id.Equals(chapterId))); } }
public override IList <string> GetSubChapters(string chapterId) { using (TransactionScope transaction = new TransactionScope(mConfiguration)) { ChapterVersionDataStore chapVersion = new ChapterVersionDataStore(transaction); ChapterVersion cv = chapVersion.FindAllItems().First(x => x.Id.Equals(chapterId)); XHTMLText xhtmlText = new XHTMLText(); IList <string> subChapters = xhtmlText.GetSubChapters(cv.Content); return(subChapters); } }
public override IList <SubSectionChap> GetChapterSubSection(string chapterId) { using (TransactionScope transaction = new TransactionScope(mConfiguration)) { ChapterVersionDataStore chapVersion = new ChapterVersionDataStore(transaction); ChapterVersion cv = chapVersion.FindAllItems().First(x => x.Id.Equals(chapterId)); XHTMLText xhtmlText = new XHTMLText(); IList <string> subChapters = xhtmlText.GetSubChapters(cv.Content); List <SubSectionChap> chapSections = new List <SubSectionChap>(); foreach (string subSec in subChapters) { chapSections.Add(new SubSectionChap { ChapId = chapterId, AnchorTag = subSec }); } return(chapSections); } }