Ejemplo n.º 1
0
        private void loadLocationComboBox()
        {
            try
            {
                DBcon.DBCON cn = new DBcon.DBCON();

                locationComboBox.AutoCompleteMode   = AutoCompleteMode.Suggest;
                locationComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;

                String sql = "select * from locations where country_id = " + countryComboBox.SelectedValue + "";
                //MessageBox.Show(countryComboBox.SelectedValue.ToString());
                OracleDataAdapter locationAdapter = new OracleDataAdapter(sql, cn.thisCon);
                DataTable         locationDt      = new DataTable();
                locationAdapter.Fill(locationDt);

                locationComboBox.DataSource    = locationDt;
                locationComboBox.DisplayMember = "location_name";
                locationComboBox.ValueMember   = "location_id";
                //loadHotelComboBox();
            }
            catch (Exception)
            {
                //    MessageBox.Show(exp.Message);
            }
        }
Ejemplo n.º 2
0
        private void loadComboBox()
        {
            DBcon.DBCON cn = new DBcon.DBCON();
            try
            {
                countryComboBox.AutoCompleteMode   = AutoCompleteMode.Suggest;
                countryComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;

                String            sql1           = "select * from countries";
                OracleDataAdapter countryAdapter = new OracleDataAdapter(sql1, cn.thisCon);
                DataTable         countryDt      = new DataTable();
                countryAdapter.Fill(countryDt);

                countryComboBox.DataSource    = countryDt;
                countryComboBox.DisplayMember = "country_name";
                countryComboBox.ValueMember   = "country_id";
            }
            catch (Exception exp)
            {
                MessageBox.Show(exp.Message);
            }
        }
Ejemplo n.º 3
0
        private void loadLocationComboBox()
        {
            try
            {
                DBcon.DBCON cn = new DBcon.DBCON();
                locationComboBox.AutoCompleteMode   = AutoCompleteMode.Suggest;
                locationComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;

                String            sql1            = "Select * from locations";
                OracleDataAdapter locationAdapter = new OracleDataAdapter(sql1, cn.thisCon);
                DataTable         locationDt      = new DataTable();
                locationAdapter.Fill(locationDt);

                locationComboBox.DataSource    = locationDt;
                locationComboBox.DisplayMember = "location_name";
                locationComboBox.ValueMember   = "location_id";
            }
            catch (Exception exp)
            {
                MessageBox.Show("location Combobox can not be constructed cause {0}", exp.Message);
            }
        }
Ejemplo n.º 4
0
        private void loadTypeComboBox()
        {
            DBcon.DBCON cn = new DBcon.DBCON();
            try
            {
                hotelTypeCombobox.AutoCompleteMode   = AutoCompleteMode.Suggest;
                hotelTypeCombobox.AutoCompleteSource = AutoCompleteSource.ListItems;


                String            sql1           = "select hotel_type from hotel_info";
                OracleDataAdapter countryAdapter = new OracleDataAdapter(sql1, cn.thisCon);
                DataTable         countryDt      = new DataTable();
                countryAdapter.Fill(countryDt);
                hotelTypeCombobox.DataSource    = countryDt;
                hotelTypeCombobox.DisplayMember = "hotel_type";
                hotelTypeCombobox.ValueMember   = "hotel_type";
            }
            catch (Exception exp)
            {
                MessageBox.Show("Country Combobox can not be constructed cause {0}", exp.Message);
            }
        }
Ejemplo n.º 5
0
        private void loadHotelComboBox()
        {
            try
            {
                DBcon.DBCON cn = new DBcon.DBCON();

                hotelComboBox.AutoCompleteMode   = AutoCompleteMode.Suggest;
                hotelComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;

                String sql = "select * from hotel_info where location_id = " + locationComboBox.SelectedValue + "";
                //MessageBox.Show(locationComboBox.SelectedValue.ToString());
                OracleDataAdapter hotelAdpater = new OracleDataAdapter(sql, cn.thisCon);
                DataTable         dt           = new DataTable();
                hotelAdpater.Fill(dt);

                hotelComboBox.DataSource    = dt;
                hotelComboBox.DisplayMember = "hotel_name";
                hotelComboBox.ValueMember   = "hotel_id";
            }
            catch (Exception)
            {
            }
        }
Ejemplo n.º 6
0
        private void loadCountryComboBox()
        {
            DBcon.DBCON cn = new DBcon.DBCON();
            try
            {
                countryComboBox.AutoCompleteMode   = AutoCompleteMode.Suggest;
                countryComboBox.AutoCompleteSource = AutoCompleteSource.ListItems;

                String            sql1           = "select * from countries";
                OracleDataAdapter countryAdapter = new OracleDataAdapter(sql1, cn.thisCon);
                DataTable         countryDt      = new DataTable();
                countryAdapter.Fill(countryDt);

                countryComboBox.DataSource    = countryDt;
                countryComboBox.DisplayMember = "country_name";
                countryComboBox.ValueMember   = "country_id";
                //MessageBox.Show(countryComboBox.SelectedValue.ToString());
                //loadLocationComboBox();
            }
            catch (Exception)
            {
                //MessageBox.Show("Country Combobox can not be constructed cause {0}", exp.Message);
            }
        }