Beispiel #1
0
        /// <summary>
        /// Gets the category.
        /// </summary>
        /// <returns>
        /// The category <see cref="SBProductCategory"/>.
        /// </returns>
        /// <param name='category_id'>
        /// Category_id.
        /// </param>
        public static SBProductCategory GetCategory(int category_id)
        {
            SBProductCategory cat = new SBProductCategory();

            cat.GetDbData(category_id);

            return(cat);
        }
Beispiel #2
0
        public void GetChilds()
        {
            ArrayList childs = this.db_table.getRows(string.Format("parent = {0}", this.CategoryID));

            if (childs != null)
            {
                foreach (Hashtable row in childs)
                {
                    SBProductCategory cat = new SBProductCategory();
                    cat.SetDbData(row);
                    (this.Data["childs"] as ArrayList).Add(cat);
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Gets the categories.
        /// The method return an array list of SBProductCategory objects
        /// </summary>
        /// <returns>
        /// The categories., <see cref="SBProductCategory" />
        /// </returns>
        public static ArrayList getCategories(int store_id = 0)
        {
            var tc   = new SBTableProductCategories();
            var rows = tc.getRows("parent = 0");

            if (rows == null)
            {
                return(null);
            }
            var cats = new ArrayList();

            foreach (Hashtable row in rows)
            {
                SBProductCategory cat = new SBProductCategory();
                cat.SetDbData(row);
                cats.Add(cat);
            }
            return(cats);
        }