private void getPublishedChapters() { try { String SQL = String.Format("SELECT * FROM BookChapter WHERE OutputID = '{0}'", outputID); DSL.Matrix matrix = RISReader.ReadTable(SQL); for (int x = 0; x < matrix.NumberOfRows; x++) { Chapter cur = new Chapter(matrix.GetNextRow(), this); Chapters.Add(cur); } } catch (Exception e) { } }
private void btnROChAdd_Click(object sender, RoutedEventArgs e) { int selchapter = lsbROChChapters.Items.Count; Chapter cur = new Chapter("New Chapter"+(selchapter +1 ).ToString(), new RichTextBox(), (Book)curDoc, curUser); ((Book)curDoc).AddChapter(cur); grbROChapter.DataContext = cur; lsbROChChapters.DataContext = null; lsbROChChapters.DataContext = curDoc; }
public void AddChapter(Chapter chapter) { Chapters.Add(chapter); UpdateChapterNames(); }