Beispiel #1
0
 internal Domain.CampaignItem ToCampaignItem()
 {
     Domain.Money discountPrice = null;
     if (this.DiscountedUnitPrice != null)
     {
         discountPrice = new Domain.Money(this.DiscountedUnitPrice.Value, "DKK");
     }
     return(new Domain.CampaignItem(this.NOTEmainProduct(), this.IsFeatured, discountPrice));
 }
Beispiel #2
0
        private void ProductUpdated(DateTimeOffset timestamp, IIdentity identity, int id, string name, Domain.Money unitPrice)
        {
            var baseCurrency = this.CreateBaseCurrency();

            var ae = new AuditEvent();

            ae.User = identity.Name;
            ae.Time = timestamp.UtcDateTime;
            ae.AuditProductsUpdated.Add(new AuditProductUpdated {
                ProductId = id, Name = name, UnitPrice = unitPrice.ConvertTo(baseCurrency).Amount
            });

            this.context.AddToAuditEvents(ae);
            this.context.SaveChanges();
        }