protected void OnButtonPressedBuy(object sender, EventArgs e)
        {
            FlightsService service = Service.getInstanse().flightService;
            string         name    = TextBoxName.Text;
            string         suranme = TextBoxSurname.Text;

            service.AddCustomer(name, suranme);
            service.BuyTicket(DropDownListDeparture.SelectedValue, DropDownListArrival.SelectedValue,
                              name, suranme);

            Response.Redirect("~/FinishBuyTicket.aspx?name=" + name + "&surname=" + suranme);
        }
Example #2
0
        protected void OnButtonPressedAddNewTicket(object sender, EventArgs e)
        {
            string name          = TextBoxName.Text;
            string surname       = TextBoxSurname.Text;
            int    price         = Convert.ToInt32(TextBoxPrice.Text);
            string departureCity = DropDownListDeparture.SelectedValue;
            string arrivelCity   = DropDownListArrival.SelectedValue;

            FlightsService service = Service.getInstanse().flightService;

            service.AddCustomer(name, surname);
            service.BuyTicket(departureCity, arrivelCity, name, surname);
            LoadData();
        }