Exemple #1
0
        private void ecranDeStatistiqueToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GestionBudgetForm gestionBudget;

            gestionBudget = new GestionBudgetForm();
            gestionBudget.Show();
            this.Close();
        }
Exemple #2
0
        private void gestionBudgetsToolStripMenuItem_Click(object sender, EventArgs e)
        {
            GestionBudgetForm budget;

            budget = new GestionBudgetForm();
            budget.Show();
            this.Close();
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            ValidateMontant();
            ValidateLibelle();

            bool montant = textBox2.Text.All(char.IsDigit);

            if (String.IsNullOrEmpty(textBox1.Text) == true || String.IsNullOrEmpty(textBox2.Text) == true || !montant)
            {
                MessageBox.Show("Veuillez remplir tous les champs");
            }
            else
            {
                string libelleBudget  = textBox1.Text;
                int    montantInitial = int.Parse(textBox2.Text);
                MessageBox.Show("Le nouveau budget a bien été ajouté");
                Budget unBudget = new Budget(libelleBudget, montantInitial);
                GestionBudget.AjoutBudget(unBudget);
                this.Close();
                GestionBudgetForm gestionBudget;
                gestionBudget = new GestionBudgetForm();
                gestionBudget.Show();
            }
        }