Exemplo n.º 1
0
        private void button1_Click(object sender, EventArgs e)
        {
            ValidateAdherent();
            ValidateBudget();
            ValidateFlux();
            ValidateMontant();
            ValidatePrelev();
            ValidateTypeflux();

            //Vérification si le formulaire est plein
            if (String.IsNullOrEmpty(libelleTextBox.Text) == true ||
                String.IsNullOrEmpty(montantTextBox.Text) == true || String.IsNullOrEmpty(comboBox1.Text) == true || String.IsNullOrEmpty(comboBox2.Text) == true || String.IsNullOrEmpty(comboBox3.Text) == true || String.IsNullOrEmpty(comboBox4.Text))
            {
                MessageBox.Show("Veuillez remplir tous les champs");
            }
            else
            {
                string   libelle    = libelleTextBox.Text;
                string   etatPrelev = comboBox4.Text;
                int      montant    = int.Parse(montantTextBox.Text);
                int      budget     = (int)comboBox1.SelectedValue;
                int      adherent   = (int)comboBox2.SelectedValue;
                int      type       = (int)comboBox3.SelectedValue;
                DateTime thisDay    = DateTime.Today;
                /*id_flux, libelle_flux, date_flux, montant_flux, id_adherent, id_typeFlux, id_budget, etat_prelevement*/
                Flux unFlux = new Flux(id_flux, libelle, thisDay, montant, adherent, type, budget, etatPrelev);
                GestionFlux.ModificationFlux(unFlux);
                MessageBox.Show("Le flux a bien été modifié");
                AffichageFlux flux;
                flux = new AffichageFlux();
                flux.Show();
                this.Close();
            }
        }