Ejemplo n.º 1
0
 public Promotion(DateTime start, byte days, Article promotedArticle, decimal newPrice)
 {
     this.Start = start;
     this.Days = days;
     this.PromotedArticle = promotedArticle;
     this.NewPrice = newPrice;
 }
Ejemplo n.º 2
0
        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;
            }
        }
Ejemplo n.º 3
0
 public ArticleEventArgs(Article article)
 {
     Article = article;
 }
Ejemplo n.º 4
0
 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);
 }