Пример #1
0
 public Ticket(string from, string to, UIClass cls, UIWay way)
 {
     this.from = from;
     this.to   = from;
     this.cls  = cls;
     this.way  = way;
 }
Пример #2
0
 public Ticket(UIClass seatClass, UIDiscount discount, UIWay way, string from, string to)
 {
     this.seatClass = ClassAssigner.GetClass(seatClass);
     this.discount  = DiscountAssigner.GetDiscount(discount);
     this.way       = way;
     this.from      = from;
     this.to        = to;
 }
Пример #3
0
 public UIInfo(string from, string to, UIClass cls, UIWay way, UIDiscount discount, UIPayment payment)
 {
     this.from     = from;
     this.to       = to;
     this.cls      = cls;
     this.way      = way;
     this.discount = discount;
     this.payment  = payment;
 }
Пример #4
0
 public TicketautomaatInvoer(string from, string to, UIClass cls, UIWay way, UIDiscount discount, UIPayment payment)
 {
     this.from     = from;
     this.to       = to;
     this.cls      = cls;
     this.way      = way;
     this.discount = discount;
     this.payment  = payment;
 }
Пример #5
0
 public UIInfo(string from, string to, UIClass cls, UIWay way, UIDiscount discount, UIPayment payment)
 {
     this.from = from;
     this.to = to;
     this.cls = cls;
     this.way = way;
     this.discount = discount;
     this.payment = payment;
 }
Пример #6
0
 private void getPrice(int tariefeenheden, int tableColumn, UIWay way)
 {
     // Get price
     price = PricingTable.getPrice(tariefeenheden, tableColumn);
     if (way == UIWay.Return)
     {
         price *= 2;
     }
 }
Пример #7
0
 public Bestelling(string from, string to, UIClass cls, UIWay way, UIDiscount discount, UIPayment payment, int aantalKaartjes)
 {
     this.from           = from;
     this.to             = to;
     this.cls            = cls;
     this.way            = way;
     this.discount       = discount;
     this.payment        = payment;
     this.aantalKaartjes = aantalKaartjes;
 }
Пример #8
0
        public Ticket(UIInfo info)
        {
            klasse      = info.Class;
            discount    = info.Discount;
            destination = info.To;
            origin      = info.From;
            way         = info.Way;

            GetPrice g = new GetPrice(klasse, discount, destination, origin, way);

            price = g.ReturnPrice();
        }
Пример #9
0
        public GetPrice(UIClass klasse, UIDiscount discount, String destination, String origin, UIWay way)
        {
            // Get number of tariefeenheden
            int tariefeenheden = Tariefeenheden.getTariefeenheden(origin, destination);

            // Compute the column in the table based on choices
            int tableColumn;

            // First based on class
            switch (klasse)
            {
            case UIClass.FirstClass:
                tableColumn = 3;
                break;

            default:
                tableColumn = 0;
                break;
            }
            // Then, on the discount
            switch (discount)
            {
            case UIDiscount.TwentyDiscount:
                tableColumn += 1;
                break;

            case UIDiscount.FortyDiscount:
                tableColumn += 2;
                break;
            }

            // Get price
            price = PricingTable.getPrice(tariefeenheden, tableColumn);
            if (way == UIWay.Return)
            {
                price *= 2;
            }
        }
Пример #10
0
        public static Ticket makeTicket(string from, string to, UIClass cls, UIWay way)
        {
            Ticket ticket = new Ticket(from, to, cls, way);

            return(ticket);
        }
Пример #11
0
 public void PrintTicket(string from, string to, UIClass cls, UIWay way, UIDiscount discount, UIPayment payment)
 {
     MessageBox.Show("Uw ticket\nStart location: " + from + "\nDestination: " + to +
                     "\nClass: " + cls + "\nWay: " + way + "\nDiscount: " + discount + "\nPayment method: " + payment);
 }