示例#1
0
        public static async void Traitement(VenteItem vente)
        {
            Initialize();

            await Select(vente);

            Debug.WriteLine(" \n\n fin traitement \n\n");
        }
示例#2
0
        public static async Task Select(VenteItem id)
        {
            string query = "SELECT * FROM produit where id=" + id.IdProduit;

            //Create a list to store the result
            ProduitItem produit = new ProduitItem();

            //Open connection
            if (OpenConnection() == true)
            {
                //Create Command
                MySqlCommand cmd = new MySqlCommand(query, connection);
                //Create a data reader and Execute the command

                MySqlDataReader reader;
                using (reader = cmd.ExecuteReader())
                {
                    if (reader.Read())
                    {
                        Debug.WriteLine("\n\n" + String.Format("{0}", reader["nom"]));
                    }
                }
                //Read the data and store them in the list

                //close Data Reader
                reader.Close();

                //close Connection
                CloseConnection();

                //return list to be displayed
            }
            else
            {
                Debug.WriteLine("\n\n probleme con");
            }
            await Task.Yield();
        }