Example #1
0
        private void GetPaymentBouchet(Bouchet bouchet)
        {
            var cost = bouchet.GetPriceBouchet();

            _transactionReports.StoreStatisticsBouchet(bouchet, cost);
            SaveTransactionBouchet(bouchet, cost);
        }
Example #2
0
 private void SaveTransactionBouchet(Bouchet bouchet, int cost)
 {
     Transactions.Add(new Transaction
     {
         Name        = bouchet.GetType().Name,
         Quantity    = bouchet.Quantity,
         Cost        = cost,
         CurrentDate = DateTime.Now.ToShortDateString()
     });
 }
        public void StoreStatisticsBouchet(Bouchet bouchet, int cost)
        {
            var tran = new Transaction();

            var bouchetName = bouchet.GetType().Name;
            var bh          = BouchetSales.FirstOrDefault(b => b.Name == bouchetName);

            if (bh == null)
            {
                tran.Name          = bouchetName;
                tran.Quantity      = bouchet.Quantity;
                tran.TotalEarnings = cost;

                BouchetSales.Add(tran);
            }
            else
            {
                bh.Quantity      += bouchet.Quantity;
                bh.TotalEarnings += cost;
            }
        }
Example #4
0
 public override void CheckOut(Bouchet bouchet)
 {
     GetPaymentBouchet(bouchet);
 }
Example #5
0
 public virtual void CheckOut(Bouchet bouchet)
 {
 }