Exemplo n.º 1
0
        private void formFieldSite_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {
                if (formFieldSite.SelectedItem.ToString() == "")
                {
                    return;
                }
                ListItem item = (ListItem)formFieldSite.SelectedItem;
                DataSet1TableAdapters.batimentTableAdapter batimentAdaptater = new DataSet1TableAdapters.batimentTableAdapter();
                DataSet1.batimentDataTable tab1 = new DataSet1.batimentDataTable();
                batimentAdaptater.GetBatimentBySite(tab1, item.ID);
                List <ListItem> listitem = new List <ListItem>();
                foreach (DataSet1.batimentRow Row in tab1.Rows)
                {
                    listitem.Add(new ListItem(Row.nom_batiment, Row.id_batiment));
                }


                formFieldBatiment.DataSource = listitem;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 2
0
        private void formFieldSite_SelectedIndexChanged(object sender, EventArgs e)
        {
            try
            {

                if (formFieldSite.SelectedItem.ToString() == "") return;
                ListItem item = (ListItem)formFieldSite.SelectedItem;
                DataSet1TableAdapters.batimentTableAdapter batimentAdaptater = new DataSet1TableAdapters.batimentTableAdapter();
                DataSet1.batimentDataTable tab1 = new DataSet1.batimentDataTable();
                batimentAdaptater.GetBatimentBySite(tab1, item.ID);
                List<ListItem> listitem = new List<ListItem>();
                foreach (DataSet1.batimentRow Row in tab1.Rows)
                {
                    listitem.Add(new ListItem(Row.nom_batiment, Row.id_batiment));
                }

                formFieldBatiment.DataSource = listitem;

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }