コード例 #1
0
ファイル: UI.cs プロジェクト: bramboomen/mso3
 private void DoPayment(Payment pay, float price)
 {
     pay.Connect();
     pay.StartPayment(price);
     pay.EndPayment();
     pay.Disconnect();
 }
コード例 #2
0
ファイル: Ticket.cs プロジェクト: bramboomen/mso3
 public Ticket(string from, string to, UIClass cls, int way, float discount, Payment payment)
 {
     this.from = from;
     this.to = to;
     this.cls = cls;
     this.way = way;
     this.discount = discount;
     this.payment = payment;
 }
コード例 #3
0
ファイル: UI.cs プロジェクト: YannickMeijer/mso-lab3-master
 private void handlePayment(UIInfo info)
 {
     // *************************************
     // This is the code you need to refactor
     // *************************************
     StandardTicket ticket = new StandardTicket(info);
     Payment payment = new Payment(ticket, info);
     printer = new Printer();
     printer.CreateTicket(info, ticket);
 }
コード例 #4
0
ファイル: PaymentFactory.cs プロジェクト: Jeswer9/LabThree
        public bool MakePayment(UIPayment uiPayment, float price)
        {
            switch (uiPayment)
            {
                case UIPayment.CreditCard:
                    payment = new CreditCard();
                    break;
                case UIPayment.DebitCard:
                    payment = new DebitCard();
                    break;
                case UIPayment.Chipknip:
                    payment = new Chipknip();
                    break;
                case UIPayment.Cash:
                    payment = new Cash();
                    break;
            }

            return payment.HandlePayment(price);
        }