/// <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);
        }
        /// <summary>
        /// Determines whether the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>.
        /// </summary>
        /// <param name="obj">The <see cref="T:System.Object"/> to compare with the current <see cref="T:System.Object"/>.</param>
        /// <returns>
        /// true if the specified <see cref="T:System.Object"/> is equal to the current <see cref="T:System.Object"/>; otherwise, false.
        /// </returns>
        /// <exception cref="T:System.NullReferenceException">The <paramref name="obj"/> parameter is null.</exception>
        /// <remarks>Documented by Dev03, 2009-01-13</remarks>
        public override bool Equals(object obj)
        {
            DbChapter chapter = obj as DbChapter;

            if (chapter == null)
            {
                return(false);
            }

            return(this.GetHashCode() == chapter.GetHashCode());
        }
        /// <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);
        }
Beispiel #4
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;
 }
Beispiel #5
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;
        }