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); } } }
/// <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); }