コード例 #1
0
 private bool Update()
 {
     return(DBShippingTableRate.Update(
                this.shippingTableRateID,
                this.shippingMethodID,
                this.geoZoneGuid,
                this.fromValue,
                this.shippingFee,
                this.additionalValue,
                this.additionalFee,
                this.freeShippingOverXValue));
 }
コード例 #2
0
 private void GetShippingTableRate(int shippingTableRateId)
 {
     using (IDataReader reader = DBShippingTableRate.GetOne(shippingTableRateId))
     {
         if (reader.Read())
         {
             this.shippingTableRateID    = Convert.ToInt32(reader["ShippingTableRateID"]);
             this.shippingMethodID       = Convert.ToInt32(reader["ShippingMethodID"]);
             this.geoZoneGuid            = new Guid(reader["GeoZoneGuid"].ToString());
             this.fromValue              = Convert.ToDecimal(reader["FromValue"]);
             this.shippingFee            = Convert.ToDecimal(reader["ShippingFee"]);
             this.additionalValue        = Convert.ToDecimal(reader["AdditionalValue"]);
             this.additionalFee          = Convert.ToDecimal(reader["AdditionalFee"]);
             this.freeShippingOverXValue = Convert.ToDecimal(reader["FreeShippingOverXValue"]);
         }
     }
 }
コード例 #3
0
        public static ShippingTableRate GetOneMaxValue(int shippingMethodId, decimal fromValue, string geoZoneGuids)
        {
            if (string.IsNullOrEmpty(geoZoneGuids))
            {
                geoZoneGuids = null;
            }

            IDataReader reader        = DBShippingTableRate.GetOneMaxValue(shippingMethodId, fromValue, geoZoneGuids);
            var         lstTableRates = LoadListFromReader(reader);

            if (lstTableRates.Count > 0)
            {
                return(lstTableRates[0]);
            }

            return(null);
        }
コード例 #4
0
        /// <summary>
        /// Persists a new instance of ShippingTableRate. Returns true on success.
        /// </summary>
        /// <returns></returns>
        private bool Create()
        {
            int newID = 0;

            newID = DBShippingTableRate.Create(
                this.shippingMethodID,
                this.geoZoneGuid,
                this.fromValue,
                this.shippingFee,
                this.additionalValue,
                this.additionalFee,
                this.freeShippingOverXValue);

            this.shippingTableRateID = newID;

            return(newID > 0);
        }
コード例 #5
0
        public static List <ShippingTableRate> GetByMethod(int shippingMethodId)
        {
            IDataReader reader = DBShippingTableRate.GetByMethod(shippingMethodId);

            return(LoadListFromReader(reader, true));
        }
コード例 #6
0
 public static bool DeleteByMethod(int shippingMethodId)
 {
     return(DBShippingTableRate.DeleteByMethod(shippingMethodId));
 }
コード例 #7
0
 public static bool Delete(int shippingTableRateId)
 {
     return(DBShippingTableRate.Delete(shippingTableRateId));
 }