Exemplo n.º 1
0
        private Booking booking;                                  //a booking object to be displayed on screen
        public Invoice(Booking booking, SerializeData serializer) //a constructor
        {
            InitializeComponent();
            this.booking = booking;
            InvoiceBooking invoice = new InvoiceBooking(booking, serializer);          //create a new invoicebooking object which deals with calculations

            tbBookingReferenceNumber.Text = booking.BookingReferenceNumber.ToString(); //show the booking reference number on screen
            tbCostPerNight.Text           = invoice.basicCost().ToString();            //show the cost per night
            tbExtrasCost.Text             = invoice.extrasCost().ToString();           //show the extras cost
        }
Exemplo n.º 2
0
        private List <string> listOfGuests;                              //a list of all the guests of the booking

        public InvoiceBooking(Booking booking, SerializeData serializer) //constructor
        {
            this.booking    = booking;
            this.serializer = serializer;
            listOfGuests    = booking.GuestArray; //gets the guests from the booking
        }