Exemplo n.º 1
0
        /// <summary>
        /// Supprime un évènement
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            if (condition())
            {
                int id = Int32.Parse(textID.Text);
                try
                {
                    ModeleBDD con = new ModeleBDD();
                    con.supAdherents(id);
                    label10.Text     = textNom.Text + " a été supprimé ";
                    comboBox1.Text   = "";
                    comboBox2.Text   = "";
                    textID.Text      = "";
                    textNom.Text     = "";
                    textPrenom.Text  = "";
                    textLicence.Text = "";
                    //dateTimePicker1.Value = DateTime.Now;
                    textAdresse.Text    = "";
                    textCodePostal.Text = "";
                    textVille.Text      = "";
                    textCotisation.Text = "";

                    dataGridView1.ClearSelection();
                    FillDataGridView();
                }catch (Exception e3)
                {
                    MessageBox.Show("Message d'erreur : " + e3.Message + " \nType de l'exception " + e3.GetType() + " \nPile d'appel" + e3.StackTrace);
                }
            }
            else
            {
                MessageBox.Show("Veuilez remplir tout les champs");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Supprime un évènement
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void buttonDelete_Click(object sender, EventArgs e)
        {
            if (condition())
            {
                int       id  = Int32.Parse(textID.Text);
                ModeleBDD con = new ModeleBDD();
                con.supAdherents(id);
                label10.Text     = textNom.Text + " a été supprimé ";
                comboBox1.Text   = "";
                comboBox2.Text   = "";
                textID.Text      = "";
                textNom.Text     = "";
                textPrenom.Text  = "";
                textLicence.Text = "";
                //dateTimePicker1.Value = DateTime.Now;
                textAdresse.Text    = "";
                textCodePostal.Text = "";
                textVille.Text      = "";
                textCotisation.Text = "";

                dataGridView1.ClearSelection();
                FillDataGridView();
            }
            else
            {
                MessageBox.Show("Veuilez remplir tout les champs");
            }
        }