Example #1
0
 public Person Buy(Product product, bool isConsume = true)
 {
     BuyProducts.Add(product);
     if (isConsume)
     {
         return(Consume(product));
     }
     return(this);
 }
Example #2
0
 /// <summary>
 ///  потратил
 /// </summary>
 /// <returns></returns>
 public decimal GetPaied()
 {
     return(BuyProducts.Sum(x => x.Price));
 }
        private void Button_Click_2(object sender, RoutedEventArgs e)
        {
            BuyProducts buyProducts = new BuyProducts();

            buyProducts.Show();
        }