コード例 #1
0
        public virtual void Clone(BaseOffer offer)
        {
            var properties = typeof(BaseOffer).GetProperties().Where(p => p.CanRead && p.CanWrite);

            foreach (var property in properties)
            {
                var value = property.GetValue(offer, null);
                property.SetValue(this, value, null);
            }
        }
コード例 #2
0
        public static decimal Calculate(IEnumerable <MarkupConfig> markups, BaseOffer offer, User user, Address address)
        {
            if (offer == null)
            {
                return(0);
            }
            if (address == null)
            {
                return(0);
            }

            var type = offer.GetMarkupType();

            var cost = user.IsDelayOfPaymentEnabled && !user.ShowSupplierCost ? offer.GetResultCost() : offer.Cost;

            return((Calculate(markups, type, cost, address)?.Markup).GetValueOrDefault());
        }
コード例 #3
0
 protected BaseOffer(BaseOffer offer)
 {
     Clone(offer);
 }