public Promotion(DateTime start, byte days, Article promotedArticle, decimal newPrice) { this.Start = start; this.Days = days; this.PromotedArticle = promotedArticle; this.NewPrice = newPrice; }
public void Load(Article article) { var key = article.GetType().Name + " " + article.Model; var alreadyHave = this.Articles.FirstOrDefault(a => a.Key == key); if (alreadyHave.Key==null ) { this.Articles.Add(key, article); this.Promotions.Add(new Promotion(DateTime.Now, 3, article, (article.Price - article.Price * 0.1m))); } else { alreadyHave.Value.Count += article.Count; } }
public ArticleEventArgs(Article article) { Article = article; }
public void GetQuantity(Article article) { var key = article.GetType().Name + " " + article.Model; Console.WriteLine("Article: {0}\nModel: {1}", article.GetType().Name, article.Model); Console.WriteLine("Quantity: {0}", this.Articles[key].Count); }