public AttributeItemCollection FetchByQuery(Query qry)
        {
            AttributeItemCollection coll = new AttributeItemCollection();

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
        public AttributeItemCollection FetchAll()
        {
            AttributeItemCollection coll = new AttributeItemCollection();
            Query qry = new Query(AttributeItem.Schema);

            coll.LoadAndCloseReader(qry.ExecuteReader());
            return(coll);
        }
Beispiel #3
0
        /// <summary>
        /// Fetches the selected attribute item.
        /// </summary>
        /// <param name="attributeId">The attribute id.</param>
        /// <param name="skuSuffix">The sku suffix.</param>
        /// <returns></returns>
        public AttributeItem FetchSelectedAttributeItem(int attributeId, string skuSuffix)
        {
            Query query = new Query(Store.AttributeItem.Schema).
                          AddWhere(Store.AttributeItem.Columns.AttributeId, attributeId).
                          AddWhere(Store.AttributeItem.Columns.SkuSuffix, skuSuffix);
            IDataReader             reader = query.ExecuteReader();
            AttributeItemCollection attributeItemCollection = new AttributeItemCollection();

            attributeItemCollection.LoadAndCloseReader(reader);
            if (attributeItemCollection.Count > 0)
            {
                return(attributeItemCollection[0]);
            }
            else
            {
                return(null);
            }
        }
        public AttributeItemCollection FetchByID(object AttributeItemId)
        {
            AttributeItemCollection coll = new AttributeItemCollection().Where("AttributeItemId", AttributeItemId).Load();

            return(coll);
        }