Пример #1
0
 public FlightsPage InputArrivalCityValue(FlightsModel value)
 {
     div_ArrivalCity.Click();
     input_ArrivalCity.SendKeys(value.Arrival_City);
     Logger.Log.Info(": input arrival city");
     return(this);
 }
Пример #2
0
        private void btnCancelBooking_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count > 0)
            {
                bool   isCanceled = Convert.ToBoolean(dataGridView1.CurrentRow.Cells["IsCanceled"].Value.ToString());
                string bookingID  = dataGridView1.CurrentRow.Cells["Id"].Value.ToString();

                if (!isCanceled)
                {
                    BookingModel bookingModel = new BookingModel();
                    bookingModel.GetBooking(bookingID);

                    FlightsModel flightsModel = new FlightsModel();
                    string       flightNumber = dataGridView1.CurrentRow.Cells["Flight"].Value.ToString();
                    flightsModel.GetFlight(flightNumber);

                    PersonModel personModel = new PersonModel();
                    string      id          = dataGridView1.CurrentRow.Cells["Cust. Id"].Value.ToString();
                    personModel.GetPerson(id);

                    FormAddBooking form = new FormAddBooking(personModel, flightsModel, bookingModel);
                    form.ShowDialog();
                }
                else
                {
                    string message = $"This booking order {bookingID} is already canceled!!!";
                    MessageInformation.Information(message);
                }
            }
        }
Пример #3
0
 public FlightsPage InputDepartureCityValue(FlightsModel value)
 {
     button_close_icon.Click();
     input_DepartureCity.SendKeys(value.Departure_City);
     Logger.Log.Info(": input departure city");
     return(this);
 }
Пример #4
0
        private void btnSelectFlight_Click(object sender, EventArgs e)
        {
            if (cmbSelectDestination.SelectedIndex != -1 && txtNumberPassengers.Text != null)
            {
                using (
                    FormSelectFlight selectedFlight = new FormSelectFlight(cmbSelectDestination.SelectedValue.ToString(), txtNumberPassengers.Text)
                    )
                {
                    if (selectedFlight.ShowDialog() == DialogResult.OK)
                    {
                        flightModel = selectedFlight.Flights;

                        textBox1.Text = selectedFlight.Flights.FlightNumber.ToString();
                        textBox2.Text = selectedFlight.Flights.Origin.ToString();
                        textBox3.Text = selectedFlight.Flights.Destination.ToString();
                        textBox4.Text = selectedFlight.Flights.FlightDate.ToString("ddd, MMM dd, yyyy");
                        textBox5.Text = selectedFlight.Flights.FlightTime.ToString("hh:mm tt");
                        price         = Convert.ToDouble(selectedFlight.Flights.Price.ToString());
                        textBox6.Text = price.ToString();
                        textBox7.Text = txtNumberPassengers.Text;
                        double amount = price * Convert.ToInt32(txtNumberPassengers.Text);
                        textBox8.Text = amount.ToString();

                        capacity         = Convert.ToInt16(selectedFlight.Flights.Capacity.ToString());
                        numberPassengers = Convert.ToInt16(selectedFlight.Flights.NumberPassengers.ToString());
                    }
                }
            }
        }
Пример #5
0
 public HotelPage InputArrivalCityValue(FlightsModel value)
 {
     div_Input.Click();
     input_Value.SendKeys(value.Arrival_City);
     input_Accept_First_Value.Click();
     return(this);
 }
Пример #6
0
 public HotelPage InputArrivalCityValue(FlightsModel value)
 {
     div_Input.Click();
     input_Value.SendKeys(value.Arrival_City);
     input_Accept_First_Value.Click();
     Logger.Log.Info(": input arrival city value");
     return(this);
 }
Пример #7
0
        public FormAddFlight(FlightsModel flightsModel)
        {
            InitializeComponent();

            flight = new FlightsModel();
            flight = flightsModel;

            state = State.Editing;
        }
Пример #8
0
        public FormAddFlight()
        {
            InitializeComponent();

            flight = new FlightsModel();

            state             = State.Additing;
            btnAddFlight.Text = "Add Flight";
        }
Пример #9
0
        public FormAddBooking(PersonModel personModel, FlightsModel flightModel, BookingModel bookingModel)
        {
            InitializeComponent();

            this.personModel  = personModel;
            this.flightModel  = flightModel;
            this.bookingModel = bookingModel;

            customerId = personModel.Id.ToString();

            state = State.Editing;
        }
Пример #10
0
        async void FlightListItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            FlightsModel selectedModel = (FlightsModel)e.SelectedItem;

            var userRes = await DisplayAlert("Arrival Flight", $"Do you want to change your arrival flight as Flight No. {selectedModel.ArrFlight}", "Yes", "No");

            if (userRes)
            {
                ArrFlightLabel.TextColor = Color.Black;
                ArrFlightLabel.Text      = selectedModel.ArrFlight;

                var arrTime = GeneratePayloadDate(selectedModel.AirpArrTime);

                Constants._arrFlight     = selectedModel.ArrFlight;
                Constants._arrFlightTIme = arrTime;

                PostServiceManager postServiceManager = new PostServiceManager();
                FlightPayload      payload            = new FlightPayload(
                    Settings.HotelCode,
                    Constants._reservation_id,
                    "500",
                    Settings.HotelCode,
                    Constants._reservation_id,
                    Constants._arrFlight,     // arr flight
                    Constants._arrFlightTIme, //arr time
                    Constants._depFlight,     //dep flight
                    Constants._depFlightTIme, //dep time
                    "0000000000",
                    "",
                    "",
                    ""

                    );

                var serviceRes = await postServiceManager.SetFlightDetails(payload);

                if (serviceRes == "Success")
                {
                    await DisplayAlert("Success!", "Flight is set successfully", "OK");
                }
                else
                {
                    await DisplayAlert("Error!", "Flight setting is failed", "OK");
                }


                Debug.WriteLine(selectedModel.ArrFlight);

                await Navigation.PopAsync(true);
            }
        }
Пример #11
0
        public FormAddBooking()
        {
            InitializeComponent();

            personModel  = new PersonModel();
            flightModel  = new FlightsModel();
            bookingModel = new BookingModel();

            customerId = "0";

            state = State.Additing;

            btnAddBooking.Text = "Add Booking";
        }
Пример #12
0
        private void btnEditFlight_Click(object sender, EventArgs e)
        {
            if (dataGridView1.SelectedRows.Count > 0)
            {
                FlightsModel flightsModel = new FlightsModel();

                flightsModel.FlightNumber = dataGridView1.CurrentRow.Cells["Flight"].Value.ToString();
                flightsModel.Origin       = dataGridView1.CurrentRow.Cells["Origin"].Value.ToString();
                flightsModel.Destination  = dataGridView1.CurrentRow.Cells["Destination"].Value.ToString();
                flightsModel.Capacity     = Convert.ToInt16(dataGridView1.CurrentRow.Cells["Capacity"].Value.ToString());
                string price = Validation.RemoveChars(dataGridView1.CurrentRow.Cells["Price"].Value.ToString());
                //flightsModel.Price = Convert.ToDouble(dataGridView1.CurrentRow.Cells["Price"].Value.ToString());
                flightsModel.Price      = Convert.ToDouble(price);
                flightsModel.FlightDate = Convert.ToDateTime(dataGridView1.CurrentRow.Cells["Date"].Value.ToString());
                flightsModel.FlightTime = Convert.ToDateTime(dataGridView1.CurrentRow.Cells["Time"].Value.ToString());
                flightsModel.Duration   = Convert.ToDateTime(dataGridView1.CurrentRow.Cells["Duration"].Value.ToString());

                FormAddFlight form = new FormAddFlight(flightsModel);
                form.ShowDialog();
            }
        }
Пример #13
0
 public FlightsPage InputArrivalCityValue(FlightsModel value)
 {
     div_ArrivalCity.Click();
     input_ArrivalCity.SendKeys(value.Arrival_City);
     return(this);
 }
Пример #14
0
        private FlightsModel flights; // = new FlightsModel();


        public FormViewFlights()
        {
            InitializeComponent();

            flights = new FlightsModel();
        }
Пример #15
0
        // C# 6.0 style:
        // public void SetModel(FlightsModel model) => _model = model;

        public void SetModel(FlightsModel model)
        {
            _model = model;
        }
Пример #16
0
 public FlightsVM()
 {
     models = new FlightsModel();
     models.TakeAllRouts();
 }