示例#1
0
        public static bool StoreProductExists(int store_id, string product_code)
        {
            SBTableProduct tp   = new SBTableProduct();
            Hashtable      prod = tp.getRow(string.Format("store_id = {0} AND product_code = '{1}'", store_id, product_code.Trim()));

            return((prod == null || prod.Count <= 0) ? false : true);
        }
示例#2
0
 public SBProduct(object code_id = null) : base()
 {
     this.db_table       = new SBTableProduct();
     this._meta          = new Hashtable();
     this._serialNumbers = new ArrayList();
     if (code_id != null)
     {
         this.GetDbData(code_id);
     }
 }
示例#3
0
        /// <summary>
        /// Gets the store product.
        /// </summary>
        /// <returns>
        /// The store product.
        /// A <see cref="SBProduct"/>
        /// </returns>
        /// <param name='store_id'>
        /// Store_id.
        /// </param>
        /// <param name='product_code'>
        /// Product_code.
        /// </param>
        public static SBProduct GetStoreProduct(int store_id, string product_code)
        {
            SBTableProduct tp   = new SBTableProduct();
            Hashtable      prod = tp.getRow(string.Format("store_id = {0} AND product_code = '{1}'", store_id, product_code.Trim()));

            if (prod == null)
            {
                return(null);
            }
            SBProduct product = new SBProduct();

            product.SetDbData(prod);
            product.GetDbMeta();
            return(product);
        }
示例#4
0
        /// <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);
        }
示例#5
0
        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);
        }