Ejemplo n.º 1
0
        private void buttonValider_Click(object sender, EventArgs e)
        {
            bool ok = int.TryParse(textBoxCode.Text, out int code);

            Dictionary <string, object> parameters = new Dictionary <string, object>();

            if (ok)
            {
                parameters.Add("@pid_contact", code);

                if ((int)persistanceSQLServer.ExecuteDataReader(parameters, "SearchContact").Count == 0)
                {
                    MessageBox.Show("Le code fournisseur est inexistant", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Error);
                }
                else
                {
                    AffichageFournisseur affichageFournisseur = new AffichageFournisseur(persistanceSQLServer, code);
                    affichageFournisseur.Show();
                }
            }
            else
            {
                MessageBox.Show("Le code est invalide", "Attention", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }
Ejemplo n.º 2
0
 private void buttonCreation_Click(object sender, EventArgs e)
 {
     if (persistanceSQLServer.IsOpen())
     {
         AffichageFournisseur affichageFournisseur = new AffichageFournisseur(persistanceSQLServer);
         affichageFournisseur.Show();
     }
 }