Exemple #1
0
        /* private void AddIngredientClick(object sender, EventArgs e)
         * {
         *   if (!ajoutIngredientControl1.Visible)
         *       ajoutIngredientControl1.Show();
         *   else
         *   {
         *       ajoutIngredientControl1.Hide();
         *       Utilities.ResetAllControls(ajoutIngredientControl1);
         *   }
         * }
         */
        public void InitializeListView()
        {
            ingredientsListView.View = View.Details;
            ColumnHeader header1 = ingredientsListView.Columns.Add("Ingrédient", 50 * Convert.ToInt32(ingredientsListView.Font.SizeInPoints), HorizontalAlignment.Center);
            ColumnHeader header2 = ingredientsListView.Columns.Add("Quantité", 20 * Convert.ToInt32(ingredientsListView.Font.SizeInPoints), HorizontalAlignment.Center);
            //ColumnHeader header3 = ingredientsListView.Columns.Add("Supprimer", 10 * Convert.ToInt32(ingredientsListView.Font.SizeInPoints), HorizontalAlignment.Center);

            OracleDataReader vuesDifficulte = interfaceBD.envoyerRequeteSelection("SELECT * FROM DIFFICULTE_VIEW");

            while (vuesDifficulte.Read())
            {
                difficulteComboBox.Items.Add(vuesDifficulte.GetValue(0));
            }

            OracleDataReader vuesTypeRepas = interfaceBD.envoyerRequeteSelection("SELECT * FROM TYPE_REPAS_VIEW");

            while (vuesTypeRepas.Read())
            {
                typeRepasComboBox.Items.Add(vuesTypeRepas.GetValue(0));
            }

            OracleDataReader vuesTypeIngredient =
                interfaceBD.envoyerRequeteSelection("SELECT * FROM TYPE_INGREDIENT_VIEW");

            while (vuesTypeIngredient.Read())
            {
                typeComboBox.Items.Add(vuesTypeIngredient.GetValue(0));
            }
        }
Exemple #2
0
 public void AfficheRecette(int position)
 {
     OracleDataReader recetteNomSelection = interfaceBD.envoyerRequeteSelection("SELECT NOM FROM RECETTE WHERE RECETTE_ID = '"+position+"'");
     while (recetteNomSelection.Read())
     {
         nomRecetteLabel.Text = (recetteNomSelection.GetValue(0)).ToString();
     }
     OracleDataReader recetteNombrePersonnes = interfaceBD.envoyerRequeteSelection("SELECT NB_PERSONNE FROM RECETTE WHERE RECETTE_ID = '" + position + "'");
     while (recetteNombrePersonnes.Read())
     {
         nomPersonneValeurLabel.Text = (recetteNombrePersonnes.GetValue(0)).ToString();
     }
     OracleDataReader recetteType = interfaceBD.envoyerRequeteSelection("SELECT TYPE_RECETTE FROM RECETTE WHERE RECETTE_ID = '" + position + "'");
     while (recetteType.Read())
     {
         typeRepasValeurLabel.Text = (recetteType.GetValue(0)).ToString();
     }
     OracleDataReader tempsPreparation = interfaceBD.envoyerRequeteSelection("SELECT TEMPS_PREPARATION FROM RECETTE WHERE RECETTE_ID = '" + position + "'");
     while (tempsPreparation.Read())
     {
         tempsPreparationValeurLabel.Text = (tempsPreparation.GetValue(0)).ToString();
     }
     OracleDataReader tempsCuisson = interfaceBD.envoyerRequeteSelection("SELECT TEMPS_CUISSON FROM RECETTE WHERE RECETTE_ID = '" + position + "'");
     while (tempsCuisson.Read())
     {
         tempsCuissonValeurLabel.Text = (tempsCuisson.GetValue(0)).ToString();
     }
     OracleDataReader difficulte = interfaceBD.envoyerRequeteSelection("SELECT NOM FROM DIFFICULTE WHERE DIFFICULTE_ID = (SELECT DIFFICULTE FROM RECETTE WHERE RECETTE_ID = '" + position + "')");/**/
     while (difficulte.Read())
     {
         difficulteValeurLabel.Text = (difficulte.GetValue(0)).ToString();
     }
     OracleDataReader ingredients = interfaceBD.envoyerRequeteSelection("SELECT DISTINCT INGREDIENT.NOM, RECETTE_INGREDIENT.QUANTITE FROM INGREDIENT INNER JOIN RECETTE_INGREDIENT ON INGREDIENT.INGREDIENT_ID = RECETTE_INGREDIENT.INGREDIENT_ID WHERE RECETTE_INGREDIENT.RECETTE_ID = '" + position + "'");
     ingredientsListView.Items.Clear();
     while (ingredients.Read())
     {
         string[] row1 = { ingredients.GetValue(0).ToString() };
         ingredientsListView.Items.Add(ingredients.GetValue(1).ToString()).SubItems.AddRange(row1);
     }
     OracleDataReader etapes = interfaceBD.envoyerRequeteSelection("SELECT INSTRUCTIONS FROM RECETTE WHERE RECETTE_ID = '" + position + "'");
     while (etapes.Read())
     {
         EtapeRecetteTextBox.Text = (etapes.GetValue(0)).ToString();
     }
 }