Esempio n. 1
0
        public List <clsFlightsObject> listOfFlightMethod()
        {
            listOfFlights = new List <clsFlightsObject>();

            string sSQL = sqlStatements.returnFlightInfo();
            int    iRet = 0;

            clsData = new clsDataAccess();

            //This should probably be in a new class.  Would be nice if this new class
            //returned a list of Flight objects that was then bound to the combo box
            //Also should show the flight number and aircraft type together
            ds = clsData.ExecuteSQLStatement(sSQL, ref iRet);

            for (int i = 0; i < iRet; i++)
            {
                flight = new clsFlightsObject((int)ds.Tables[0].Rows[i][0], (string)ds.Tables[0].Rows[i][1], (string)ds.Tables[0].Rows[i][2]);
                listOfFlights.Add(flight);
            }
            return(listOfFlights);
        }
Esempio n. 2
0
        public List <clsPassangerObject> passengerPull(ComboBox cbChooseFlight)
        {
            clsFlightsObject flightSeletedFlight = (clsFlightsObject)cbChooseFlight.SelectedItem;

            listofPassengers = new List <clsPassangerObject>();

            clsData = new clsDataAccess();
            int iRet = 0;


            string sSQL = sqlStatements.getPassengerforFlight(flightSeletedFlight.flightID);

            ds = clsData.ExecuteSQLStatement(sSQL, ref iRet);

            for (int i = 0; i < iRet; i++)
            {
                passanger = new clsPassangerObject((int)ds.Tables[0].Rows[i][0], (string)ds.Tables[0].Rows[i][1], (string)ds.Tables[0].Rows[i][2]);
                listofPassengers.Add(passanger);
            }

            return(listofPassengers);
        }
        private void seatClick(object sender, MouseButtonEventArgs e)
        {
            Label holdLabel = (Label)sender;

            //todo make background the check to see if a passenger should be added
            //if (holdLabel = red)
            //{

            //}

            clsFlightsObject holdFlightObject = (clsFlightsObject)cbChooseFlight.SelectedItem;



            UILogic.insertIntoLinkTable(holdFlightObject.flightID.ToString(), Convert.ToInt32(holdLabel.Content));

            cbChoosePassenger.ItemsSource = UILogic.passengerPull(cbChooseFlight);

            cbChooseFlight.IsEnabled     = true;
            cbChoosePassenger.IsEnabled  = true;
            cmdAddPassenger.IsEnabled    = true;
            cmdChangeSeat.IsEnabled      = true;
            cmdDeletePassenger.IsEnabled = true;
        }