Exemple #1
0
        public virtual void ChangePrice(decimal newPrice)
        {
            var priceHistory = new ProductPriceHistory(Id, Price);

            priceHistory.HasChangedPrice(newPrice);

            PriceHistories.Add(priceHistory);

            OldPrice = Price;
            Price    = newPrice;
        }
Exemple #2
0
        public void AddPriceHistory(User loginUser)
        {
            var priceHistory = new ProductPriceHistory
            {
                CreatedBy         = loginUser,
                UpdatedBy         = loginUser,
                Product           = this,
                Price             = Price,
                OldPrice          = OldPrice,
                SpecialPrice      = SpecialPrice,
                SpecialPriceStart = SpecialPriceStart,
                SpecialPriceEnd   = SpecialPriceEnd
            };

            PriceHistories.Add(priceHistory);
        }