示例#1
0
        public void ProcessTicket(TicketViewModel ticket)
        {
            PaymentsViewModel viewModel = new PaymentsViewModel(ticket, _paymentService);
            PaymentsView view = new PaymentsView(viewModel);
            view.ShowDialog();

            RemoveTicket(ticket);
        }
示例#2
0
        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;
        }
示例#3
0
 public void RemoveTicket(TicketViewModel ticket)
 {
     tickets.Remove(ticket);
 }
示例#4
0
 public void AddTicket(TicketViewModel ticket)
 {
     tickets.Add(ticket);
 }