/// <summary> /// Get all Warehouse products and return an ArrayList that contains SMProduct instances /// </summary> /// <returns> /// A <see cref="ArrayList"/> /// </returns> public static ArrayList getProducts() { SBTableProduct tp = new SBTableProduct(); ArrayList prods = tp.getRows("(status = 'publish' OR status = 'initial') ORDER BY creation_date ASC"); if (prods == null) { return(null); } ArrayList obj_prods = new ArrayList(); foreach (Hashtable p in prods) { SBProduct product = new SBProduct(); product.SetDbData(p); obj_prods.Add(product); } return(obj_prods); }
public static ArrayList GetStoreProducts(int store_id) { SBTableProduct tp = new SBTableProduct(); ArrayList _prods = tp.getRows(string.Format("(status = 'publish' OR status = 'initial') AND store_id = {0}", store_id)); if (_prods == null) { return(null); } ArrayList prods = new ArrayList(); foreach (Hashtable prod in _prods) { SBProduct product = new SBProduct(); product.SetDbData(prod); product.GetDbMeta(); prods.Add(product); } return(prods); }