コード例 #1
0
        private DBDiscountType GetDiscountTypeFromReader(IDataReader dataReader)
        {
            DBDiscountType discountType = new DBDiscountType();

            discountType.DiscountTypeID = NopSqlDataHelper.GetInt(dataReader, "DiscountTypeID");
            discountType.Name           = NopSqlDataHelper.GetString(dataReader, "Name");
            return(discountType);
        }
コード例 #2
0
        private DBDiscountType GetDiscountTypeFromReader(IDataReader dataReader)
        {
            var item = new DBDiscountType();

            item.DiscountTypeId = NopSqlDataHelper.GetInt(dataReader, "DiscountTypeID");
            item.Name           = NopSqlDataHelper.GetString(dataReader, "Name");
            return(item);
        }
コード例 #3
0
        /// <summary>
        /// Gets all discount types
        /// </summary>
        /// <returns>Discount type collection</returns>
        public override DBDiscountTypeCollection GetAllDiscountTypes()
        {
            DBDiscountTypeCollection discountTypeCollection = new DBDiscountTypeCollection();
            Database  db        = NopSqlDataHelper.CreateConnection(_sqlConnectionString);
            DbCommand dbCommand = db.GetStoredProcCommand("Nop_DiscountTypeLoadAll");

            using (IDataReader dataReader = db.ExecuteReader(dbCommand))
            {
                while (dataReader.Read())
                {
                    DBDiscountType discountType = GetDiscountTypeFromReader(dataReader);
                    discountTypeCollection.Add(discountType);
                }
            }

            return(discountTypeCollection);
        }