public void ProcessTicket(TicketViewModel ticket) { PaymentsViewModel viewModel = new PaymentsViewModel(ticket, _paymentService); PaymentsView view = new PaymentsView(viewModel); view.ShowDialog(); RemoveTicket(ticket); }
public PaymentsViewModel(TicketViewModel ticket, IPaymentService paymentService) { _ticket = ticket; _paymentService = paymentService; var defaultMethod = new PaymentMethodViewModel() { PaymentMethod = "Cash", Value = _ticket.Total }; methods.Add(defaultMethod); methods.Add(new PaymentMethodViewModel() { PaymentMethod = "Cheque" }); methods.Add(new PaymentMethodViewModel() { PaymentMethod = "Voucher" }); methods.Add(new PaymentMethodViewModel() { PaymentMethod = "Card" }); methods.Add(new PaymentMethodViewModel() { PaymentMethod = "Debt" }); methods.Add(new PaymentMethodViewModel() { PaymentMethod = "Free" }); SelectedMethod = defaultMethod; }
public void RemoveTicket(TicketViewModel ticket) { tickets.Remove(ticket); }
public void AddTicket(TicketViewModel ticket) { tickets.Add(ticket); }