Esempio n. 1
0
        public FlightTicketData getTicket(Document doc)
        {
            FlightTicketData ftd = new FlightTicketData();

            ftd.Price   = calculatePrice();
            ftd.Luggage = calculateLuggage();
            ftd.GoodDoc = goodDocument(doc);

            return(ftd);
        }
Esempio n. 2
0
        private void button1_Click(object sender, EventArgs e)
        {
            doc = (Document)comboBox1.SelectedValue;

            ftd = flightTicket.getTicket(doc);

            flightPriceField.Text = ftd.Price.ToString();
            luggageField.Text     = ftd.Luggage.ToString();
            if (ftd.GoodDoc)
            {
                goodDocumentField.Text = "yes";
            }
            else if (!ftd.GoodDoc)
            {
                goodDocumentField.Text = "no";
            }
            else
            {
                throw new NotImplementedException("document value undefined");
            }
        }