Ejemplo n.º 1
0
        private void FillFormCombo()
        {
            try
            {
                //TYPE MATERIEL //
                DataSet1TableAdapters.typeTableAdapter typeAdaptater = new DataSet1TableAdapters.typeTableAdapter();
                DataSet1.typeDataTable tab1 = new DataSet1.typeDataTable();
                typeAdaptater.Fill(tab1);
                List <ListItem> listitem = new List <ListItem>();

                foreach (DataSet1.typeRow Row in tab1.Rows)
                {
                    listitem.Add(new ListItem(Row.nom, Row.id_type));
                }
                formFieldTypeMateriel.DataSource = listitem;

                //CLIENT //
                DataSet1TableAdapters.clientTableAdapter clientAdaptater = new DataSet1TableAdapters.clientTableAdapter();
                DataSet1.clientDataTable tab2 = new DataSet1.clientDataTable();
                clientAdaptater.Fill(tab2);
                List <ListItem> listitem2 = new List <ListItem>();

                foreach (DataSet1.clientRow Row in tab2.Rows)
                {
                    listitem2.Add(new ListItem(Row.name, Row.id_client));
                }
                formFieldClient.DataSource = listitem2;


                //SITE//
                DataSet1TableAdapters.siteTableAdapter siteAdaptater = new DataSet1TableAdapters.siteTableAdapter();
                DataSet1.siteDataTable tab3 = new DataSet1.siteDataTable();
                siteAdaptater.Fill(tab3);
                List <ListItem> listitem3 = new List <ListItem>();

                foreach (DataSet1.siteRow Row in tab3.Rows)
                {
                    listitem3.Add(new ListItem(Row.nom, Row.id_site));
                }
                formFieldSite.DataSource = listitem3;
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            //   dbConnection.Close();
        }
Ejemplo n.º 2
0
 private void FillCombo()
 {
     try
     {
         DataSet1TableAdapters.typeTableAdapter typeAdaptater = new DataSet1TableAdapters.typeTableAdapter();
         DataSet1.typeDataTable tab1 = new DataSet1.typeDataTable();
         typeAdaptater.Fill(tab1);
         List <ListItem> listitem = new List <ListItem>();
         listitem.Add(new ListItem("Indifferent", 0));
         foreach (DataSet1.typeRow Row in tab1.Rows)
         {
             listitem.Add(new ListItem(Row.nom, Row.id_type));
         }
         comboBox1.DataSource = listitem;
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message);
     }
     //   dbConnection.Close();
 }
Ejemplo n.º 3
0
        private void FillFormCombo()
        {
            try
            {
                //TYPE MATERIEL //
                DataSet1TableAdapters.typeTableAdapter typeAdaptater = new DataSet1TableAdapters.typeTableAdapter();
                DataSet1.typeDataTable tab1 = new DataSet1.typeDataTable();
                typeAdaptater.Fill(tab1);
                List<ListItem> listitem = new List<ListItem>();

                foreach (DataSet1.typeRow Row in tab1.Rows)
                {
                    listitem.Add(new ListItem(Row.nom, Row.id_type));
                }
                formFieldTypeMateriel.DataSource = listitem;

                //CLIENT //
                DataSet1TableAdapters.clientTableAdapter clientAdaptater = new DataSet1TableAdapters.clientTableAdapter();
                DataSet1.clientDataTable tab2 = new DataSet1.clientDataTable();
                clientAdaptater.Fill(tab2);
                List<ListItem> listitem2 = new List<ListItem>();

                foreach (DataSet1.clientRow Row in tab2.Rows)
                {
                    listitem2.Add(new ListItem(Row.name, Row.id_client));
                }
                formFieldClient.DataSource = listitem2;

                //SITE//
                DataSet1TableAdapters.siteTableAdapter siteAdaptater = new DataSet1TableAdapters.siteTableAdapter();
                DataSet1.siteDataTable tab3 = new DataSet1.siteDataTable();
                siteAdaptater.Fill(tab3);
                List<ListItem> listitem3 = new List<ListItem>();

                foreach (DataSet1.siteRow Row in tab3.Rows)
                {
                    listitem3.Add(new ListItem(Row.nom, Row.id_site));
                }
                formFieldSite.DataSource = listitem3;

            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            //   dbConnection.Close();
        }
Ejemplo n.º 4
0
        private void FillCombo()
        {
            try
            {
                DataSet1TableAdapters.typeTableAdapter typeAdaptater = new DataSet1TableAdapters.typeTableAdapter();
                DataSet1.typeDataTable tab1 = new DataSet1.typeDataTable();
                typeAdaptater.Fill(tab1);
                List<ListItem> listitem = new List<ListItem>();
                listitem.Add(new ListItem("Indifferent", 0));
                foreach (DataSet1.typeRow Row in tab1.Rows)
                {
                    listitem.Add(new ListItem(Row.nom, Row.id_type));
                }
                comboBox1.DataSource = listitem;

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