Ejemplo n.º 1
0
        //private void LoadBook()
        //{
        //    using (var helper = new DbHelper.ActAndRes())
        //    {
        //        var book = helper.GetBook(BookId);



        //        var toc = helper.GetTocOfBook(BookId);

        //        //var content = helper.GetContentOfBook(toc);
        //    }
        //}

        private void LoadTOC()
        {
            using (var helper = new DbHelper.ActAndRes())
            {
                var toc = helper.GetChaptersOfBook(BookId);
                if (!toc.Any())
                {
                    var user = Page.User as CustomPrincipal;
                    if (user != null)
                    {
                        if ((user.IsInRole(DbHelper.StaticValues.Roles.CourseEditor) ||
                             user.IsInRole(DbHelper.StaticValues.Roles.Manager) ||
                             user.IsInRole(DbHelper.StaticValues.Roles.Teacher)))
                        {
                            Response.Redirect("~/Views/ActivityResource/Book/ChapterCreate.aspx?bId=" + BookId +
                                              "&pcId=0&SubId=" + SubjectId + "&secId=" + SectionId);
                        }
                    }
                }
                else
                {
                    LoadParentChapters(toc);
                }
                //var content = helper.GetContentOfBook(toc);
            }
        }