Exemplo n.º 1
0
        public Chapter GetChapterDetailByChapterId(int chapterId)
        {
            var chapterFromSql = _sqlHelper.GetDataRow("select * from ChapterCaterogyContent where ChapterId=" + chapterId);
            var chapter=new Chapter
                            {
                                ChapterName = chapterFromSql["Title"].ToString(),
                                Content = chapterFromSql["Description"].ToString(),
                                ImageUrl = chapterFromSql["ImageUrl"].ToString()
                            };

            return chapter;
        }
Exemplo n.º 2
0
        public ChapterCollection GetAllChapter()
        {
            var dataTable = _sqlHelper.GetDataTable("select * from Chapter");
            var chapterCollection = new ChapterCollection();

            for (var i = 0; i < dataTable.Rows.Count; i++)
            {
                var chapter = new Chapter()
                                  {
                                      Id = Convert.ToInt32(dataTable.Rows[i]["Id"].ToString()),
                                      ChapterName = dataTable.Rows[i]["ChapterName"].ToString()
                                  };
                chapterCollection.Add(chapter);
            }

            return chapterCollection;
        }