private void btnSupprimerDebits_Click(object sender, EventArgs e)
        {
            List <Flux> liste = new List <Flux>();

            liste = GestionFlux.GetFlux(2);

            var result1 = MessageBox.Show("Voulez-vous vraiment supprimer ce débit ?", "Message d'information", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

            if (result1 == DialogResult.Yes)
            {
                dtgDebits.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
                int rowIndex    = dtgDebits.CurrentCell.RowIndex;
                int columnIndex = dtgDebits.CurrentCell.ColumnIndex;

                // Il choisit la colonne infectée par le choix
                libelleColumnId = Int32.Parse(dtgDebits.Rows[rowIndex].Cells[columnIndex].Value.ToString());

                // Supprime le crédit avec l'id concerné
                GestionFlux.DeleteFlux(libelleColumnId);

                var result2 = MessageBox.Show("Votre débit a bien été supprimé" + "\nVoulez vous supprimé un autre débit ?", "Message d'information", MessageBoxButtons.YesNo, MessageBoxIcon.Question);

                if (result2 == DialogResult.No)
                {
                    Form.ActiveForm.Close();
                }
            }
        }
        private void btnActualiserDebits_Click(object sender, EventArgs e)
        {
            List <Flux> liste = new List <Flux>();

            liste = GestionFlux.GetFlux(2);
            dtgDebits.DataSource = liste;
        }
        public FrmGestionBudget()
        {
            InitializeComponent();
            GestionBudget.SetchaineConnexion(ConfigurationManager.
                                             ConnectionStrings["AssocBudget"]);
            GestionFlux.SetchaineConnexion(ConfigurationManager.
                                           ConnectionStrings["AssocFlux"]);

            List <BudgetBO> budgetInitialAS = new List <BudgetBO>();

            budgetInitialAS = GestionBudget.GetBudget("AS");
            List <BudgetBO> budgetInitialEPS = new List <BudgetBO>();

            budgetInitialEPS = GestionBudget.GetBudget("EPS");
            List <Flux> listeCredit = new List <Flux>();

            listeCredit = GestionFlux.GetFlux(1);
            List <Flux> listeDebit = new List <Flux>();

            listeDebit = GestionFlux.GetFlux(2);


            // Rattachement de la List à la source de données du datagridview

            dtgBudgetAS.ColumnHeadersVisible  = false;
            dtgBudgetEPS.ColumnHeadersVisible = false;

            dtgBudgetAS.DataSource  = budgetInitialAS;
            dtgBudgetEPS.DataSource = budgetInitialEPS;
            dtgDebits.DataSource    = listeDebit;
            dtgCredits.DataSource   = listeCredit;
        }
        private void btnActualiserCredits_Click(object sender, EventArgs e)
        {
            List <Flux> listeCredit = new List <Flux>();

            listeCredit           = GestionFlux.GetFlux(1);
            dtgCredits.DataSource = listeCredit;
        }
        private void dtgDebits_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            dtgDebits.AutoGenerateColumns = false;

            DataGridViewTextBoxColumn libelleColumn = new DataGridViewTextBoxColumn();

            libelleColumn.DataPropertyName = "libelle_flux";
            libelleColumn.HeaderText       = "Libelle";

            DataGridViewTextBoxColumn montantColumn = new DataGridViewTextBoxColumn();

            montantColumn.DataPropertyName = "montant_flux";
            montantColumn.HeaderText       = "Montant";

            DataGridViewTextBoxColumn dateColumn = new DataGridViewTextBoxColumn();

            dateColumn.DataPropertyName = "date_flux";
            dateColumn.HeaderText       = "Date";

            DataGridViewTextBoxColumn AdherentColumn = new DataGridViewTextBoxColumn();

            AdherentColumn.DataPropertyName = "id_adherent";
            AdherentColumn.HeaderText       = "Adherent";

            DataGridViewTextBoxColumn TypeFluxColumn = new DataGridViewTextBoxColumn();

            TypeFluxColumn.DataPropertyName = "id_type_flux";
            TypeFluxColumn.HeaderText       = "Type de Flux";

            DataGridViewTextBoxColumn EventColumn = new DataGridViewTextBoxColumn();

            EventColumn.DataPropertyName = "id_budget";
            EventColumn.HeaderText       = "Budget Impacté";

            dtgDebits.Columns.Add(libelleColumn);
            dtgDebits.Columns.Add(montantColumn);
            dtgDebits.Columns.Add(dateColumn);
            dtgDebits.Columns.Add(AdherentColumn);
            dtgDebits.Columns.Add(TypeFluxColumn);
            dtgDebits.Columns.Add(EventColumn);

            dtgDebits.ColumnHeadersVisible = true;
            DataGridViewCellStyle columnHeaderStyle = new DataGridViewCellStyle();

            columnHeaderStyle.BackColor = Color.Beige;
            columnHeaderStyle.Font      = new Font("Verdana", 12, FontStyle.Bold);

            dtgDebits.ColumnHeadersDefaultCellStyle = columnHeaderStyle;
            dtgDebits.AutoSizeColumnsMode           = DataGridViewAutoSizeColumnsMode.Fill;

            // Création d'un objet Liste à afficher dans le datagridview
            List <Flux> liste = new List <Flux>();

            liste = GestionFlux.GetFlux(2);

            // Rattachement de la List à la source de données du datagridview

            dtgDebits.DataSource = liste;
        }