Example #1
0
 public PriceModel(Ceny price)
 {
     Id            = price.Id;
     RealPrice     = price.Cena;
     Discount      = price.Rabat;
     DiscountPrice = Discount == null ?
                     RealPrice : RealPrice * (1 - (decimal)Discount / 100);
     Promotion = price.CennikId == null ?
                 null : PromoPresenter.GetPromotionById(price.CennikId);
     Product = price.TowarId == null ?
               null : ProductPresenter.GetProductById(price.TowarId);
 }