コード例 #1
0
 public static void ReturnChange(Sale sale, Payment payment)
 {
     _stateMachine.FireTrigger(sale, SaleEvent.ChangeGiven, payment);
 }
コード例 #2
0
 public static void AddItem(Sale sale, SaleItem saleItem)
 {
     _stateMachine.FireTrigger(sale, SaleEvent.AddItem, saleItem);
 }
コード例 #3
0
 public static void AddPayment(Sale sale, Payment payment)
 {
     _stateMachine.FireTrigger(sale, SaleEvent.Pay, payment);
 }
コード例 #4
0
 private static string getSaleStatus(Sale sale)
 {
     return($"\r\n--> SaleState: {sale.State}     \tBalance: {sale.Balance:$#,##0.00}.");
 }