private void GetPaymentBouchet(Bouchet bouchet) { var cost = bouchet.GetPriceBouchet(); _transactionReports.StoreStatisticsBouchet(bouchet, cost); SaveTransactionBouchet(bouchet, cost); }
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; } }
public override void CheckOut(Bouchet bouchet) { GetPaymentBouchet(bouchet); }
public virtual void CheckOut(Bouchet bouchet) { }