Example #1
0
        /// <summary>
        /// Gets the specified chapter_id.
        /// </summary>
        /// <param name="chapter_id">The chapter_id.</param>
        /// <returns></returns>
        /// <remarks>Documented by Dev03, 2009-01-13</remarks>
        public IChapter Get(int chapter_id)
        {
            DbChapter chapter = new DbChapter(chapter_id, false, Parent.GetChildParentClass(this));

            if (!chapter.HasPermission(PermissionTypes.Visible))
            {
                throw new PermissionException();
            }
            return(chapter);
        }
Example #2
0
        /// <summary>
        /// Finds the specified title.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <returns></returns>
        /// <remarks>Documented by Dev03, 2009-01-13</remarks>
        public IChapter Find(string title)
        {
            int id = connector.FindChapter(LmId, title);

            if (id < 0)
            {
                return(null);
            }

            DbChapter chapter = new DbChapter(id, false, Parent.GetChildParentClass(this));

            if (!chapter.HasPermission(PermissionTypes.Visible))
            {
                return(null);
            }

            return(chapter);
        }
Example #3
0
 /// <summary>
 /// Gets the specified chapter_id.
 /// </summary>
 /// <param name="chapter_id">The chapter_id.</param>
 /// <returns></returns>
 /// <remarks>Documented by Dev03, 2009-01-13</remarks>
 public IChapter Get(int chapter_id)
 {
     DbChapter chapter = new DbChapter(chapter_id, false, Parent.GetChildParentClass(this));
     if (!chapter.HasPermission(PermissionTypes.Visible))
         throw new PermissionException();
     return chapter;
 }
Example #4
0
        /// <summary>
        /// Finds the specified title.
        /// </summary>
        /// <param name="title">The title.</param>
        /// <returns></returns>
        /// <remarks>Documented by Dev03, 2009-01-13</remarks>
        public IChapter Find(string title)
        {
            int id = connector.FindChapter(LmId, title);

            if (id < 0)
                return null;

            DbChapter chapter = new DbChapter(id, false, Parent.GetChildParentClass(this));
            if (!chapter.HasPermission(PermissionTypes.Visible))
                return null;

            return chapter;
        }