Exemplo n.º 1
0
        /// <summary>
        /// Gets an IList with page of instances of KLNewsType.
        /// </summary>
        /// <param name="pageNumber">The page number.</param>
        /// <param name="pageSize">Size of the page.</param>
        /// <param name="totalPages">total pages</param>
        public static List <KLNewsType> GetPage(int pageNumber, int pageSize, out int totalPages)
        {
            totalPages = 1;
            IDataReader reader = DBKLNewsType.GetPage(pageNumber, pageSize, out totalPages);

            return(LoadListFromReader(reader));
        }
Exemplo n.º 2
0
 /// <summary>
 /// Updates this instance of KLNewsType. Returns true on success.
 /// </summary>
 /// <returns>bool</returns>
 private bool Update()
 {
     return(DBKLNewsType.Update(
                this.newsTypeID,
                this.name,
                this.url,
                this.parentID,
                this.isDelected));
 }
Exemplo n.º 3
0
        /// <summary>
        /// Persists a new instance of KLNewsType. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            int newID = 0;

            newID = DBKLNewsType.Create(
                this.name,
                this.url,
                this.parentID,
                this.isDelected);

            this.newsTypeID = newID;

            return(newID > 0);
        }
Exemplo n.º 4
0
 /// <summary>
 /// Gets an instance of KLNewsType.
 /// </summary>
 /// <param name="newsTypeID"> newsTypeID </param>
 private void GetKLNewsType(
     int newsTypeID)
 {
     using (IDataReader reader = DBKLNewsType.GetOne(
                newsTypeID))
     {
         if (reader.Read())
         {
             this.newsTypeID = Convert.ToInt32(reader["NewsTypeID"]);
             this.name       = reader["Name"].ToString();
             this.url        = reader["Url"].ToString();
             this.parentID   = Convert.ToInt32(reader["ParentID"]);
             this.isDelected = Convert.ToBoolean(reader["IsDelected"]);
         }
     }
 }
Exemplo n.º 5
0
        /// <summary>
        /// Gets an IList with all instances of KLNewsType.
        /// </summary>
        public static List <KLNewsType> GetAll()
        {
            IDataReader reader = DBKLNewsType.GetAll();

            return(LoadListFromReader(reader));
        }
Exemplo n.º 6
0
 /// <summary>
 /// Gets a count of KLNewsType.
 /// </summary>
 public static int GetCount()
 {
     return(DBKLNewsType.GetCount());
 }
Exemplo n.º 7
0
 /// <summary>
 /// Deletes an instance of KLNewsType. Returns true on success.
 /// </summary>
 /// <param name="newsTypeID"> newsTypeID </param>
 /// <returns>bool</returns>
 public static bool Delete(
     int newsTypeID)
 {
     return(DBKLNewsType.Delete(
                newsTypeID));
 }