Beispiel #1
0
        public ProductCollection FetchByQuery(Query qry)
        {
            ProductCollection coll = new ProductCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
        /// <summary>
        /// Searches the products.
        /// </summary>
        /// <param name="searchTerm">The search term.</param>
        /// <returns></returns>
        public ProductCollection SearchProducts(string searchTerm)
        {
            IDataReader       reader            = SPs.ProductSearch(searchTerm).GetReader();
            ProductCollection productCollection = new ProductCollection();

            productCollection.LoadAndCloseReader(reader);
            return(productCollection);
        }
        /// <summary>
        /// Fetches all products by category id.
        /// </summary>
        /// <param name="categoryId">The category id.</param>
        /// <returns></returns>
        public ProductCollection FetchAllProductsByCategoryId(int categoryId)
        {
            IDataReader       reader            = SPs.FetchAllProductsByCategoryId(categoryId).GetReader();
            ProductCollection productCollection = new ProductCollection();

            productCollection.LoadAndCloseReader(reader);
            return(productCollection);
        }
        /// <summary>
        /// Fetches the random products.
        /// </summary>
        /// <returns></returns>
        public ProductCollection FetchRandomProducts()
        {
            IDataReader       reader            = SPs.FetchRandomProducts().GetReader();
            ProductCollection productCollection = new ProductCollection();

            productCollection.LoadAndCloseReader(reader);
            return(productCollection);
        }
        /// <summary>
        /// Fetches the most popular products.
        /// </summary>
        /// <returns></returns>
        public ProductCollection FetchMostPopularProducts()
        {
            IDataReader       reader            = SPs.FetchMostPopularProducts((int)BrowsingBehaviour.Browsing_Product).GetReader();
            ProductCollection productCollection = new ProductCollection();

            productCollection.LoadAndCloseReader(reader);
            return(productCollection);
        }
        /// <summary>
        /// Fetches the product cross sells.
        /// </summary>
        /// <param name="productId">The product id.</param>
        /// <returns></returns>
        public ProductCollection FetchProductCrossSells(int productId)
        {
            IDataReader       reader            = SPs.FetchProductCrossSells(productId).GetReader();
            ProductCollection productCollection = new ProductCollection();

            productCollection.LoadAndCloseReader(reader);
            return(productCollection);
        }
        /// <summary>
        /// Fetches the products by category id and price range.
        /// </summary>
        /// <param name="categoryId">The category id.</param>
        /// <param name="priceStart">The price start.</param>
        /// <param name="priceEnd">The price end.</param>
        /// <returns></returns>
        public ProductCollection FetchProductsByCategoryIdAndPriceRange(int categoryId, decimal priceStart, decimal priceEnd)
        {
            IDataReader       reader            = SPs.FetchProductsByCategoryIdAndPriceRange(categoryId, priceStart, priceEnd).GetReader();
            ProductCollection productCollection = new ProductCollection();

            productCollection.LoadAndCloseReader(reader);
            return(productCollection);
        }
Beispiel #8
0
        public ProductCollection FetchAll()
        {
            ProductCollection coll = new ProductCollection();
            Query             qry  = new Query(Product.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
        public static MettleSystems.dashCommerce.Store.ProductCollection GetProductCollection(int varCustomizedProductDisplayTypeId)
        {
            SubSonic.QueryCommand cmd = new SubSonic.QueryCommand(
                "SELECT * FROM dashCommerce_Store_Product INNER JOIN dashCommerce_Store_CustomizedProductDisplayType_Product_Map ON " +
                "dashCommerce_Store_Product.ProductId=dashCommerce_Store_CustomizedProductDisplayType_Product_Map.ProductId WHERE dashCommerce_Store_CustomizedProductDisplayType_Product_Map.CustomizedProductDisplayTypeId=@CustomizedProductDisplayTypeId", CustomizedProductDisplayType.Schema.Provider.Name);

            cmd.AddParameter("@CustomizedProductDisplayTypeId", varCustomizedProductDisplayTypeId, DbType.Int32);
            IDataReader       rdr  = SubSonic.DataService.GetReader(cmd);
            ProductCollection coll = new ProductCollection();

            coll.LoadAndCloseReader(rdr);
            return(coll);
        }