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

            _transactionReports.StoreStatisticsBouchet(bouchet, cost);
            SaveTransactionBouchet(bouchet, cost);
        }
Exemple #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;
            }
        }
Exemple #4
0
 public override void CheckOut(Bouchet bouchet)
 {
     GetPaymentBouchet(bouchet);
 }
Exemple #5
0
 public virtual void CheckOut(Bouchet bouchet)
 {
 }