private void setPnlStatistiqueParEleveResultat()
        {
            List <Adherent> adherents = GestionAdherent.GetAdherent();
            List <Flux>     fluxs     = GestionFlux.GetLesFlux();

            int y = FrmUtilitaire.Coord;

            foreach (Adherent adherent in adherents)
            {
                int nbFlux = 0;

                List <Label> labels = new List <Label>();
                labels.Add(FrmUtilitaire.setLabel(adherent.Nom.Trim(), y: y));
                labels.Add(FrmUtilitaire.setLabel(adherent.Prenom.Trim(), y: y));

                foreach (Flux flux in fluxs)
                {
                    if (flux.TypeFlux.Libelle.Trim() == Inscription && flux.Adherent.Id == adherent.Id)
                    {
                        nbFlux += 1;
                    }
                }

                labels.Add(FrmUtilitaire.setLabel(nbFlux.ToString(), y: y));

                y += 20;

                FrmUtilitaire.init().putLabelInPnl(labels, this.findControl(PnlStatistiqueParEleve));
            }
        }
        public FrmStatistique()
        {
            InitializeComponent();

            GestionUtilisateurs.SetchaineConnexion(ConfigurationManager.ConnectionStrings["Utilisateur"]);

            this.setPnlStatistiqueParEleveLabel();
            this.setPnlStatistiqueParEleveResultat();

            this.setPnlStatistiqueGenreLabel();
            this.setPnlStatistiqueGenreResultat();

            lblNombreAdherent.Text += " " + GestionAdherent.GetAdherent().Count.ToString();

            List <Adherent> lesAdherents = GestionAdherent.GetLesAdherentByNaissance();
            var             _bind        = from a in lesAdherents
                                           select new
            {
                nom       = a.Nom,
                prenom    = a.Prenom,
                naissance = a.Ddn,
                classe    = a.Classe.Libelle
            };

            dgvNaissance.DataSource = _bind.ToList();
        }
        private void setPnlStatistiqueGenreResultat()
        {
            Dictionary <string, int> genres = new Dictionary <string, int>();

            genres.Add(FrmAjoutEleve.GenreHomme, 0);
            genres.Add(FrmAjoutEleve.GenreFemme, 0);


            List <Adherent> adherents = GestionAdherent.GetAdherent();

            foreach (Adherent adherent in adherents)
            {
                if (adherent.Sexe == 'H')
                {
                    genres[FrmAjoutEleve.GenreHomme] += 1;
                }
                else
                {
                    genres[FrmAjoutEleve.GenreFemme] += 1;
                }
            }

            foreach (KeyValuePair <string, int> genre in genres)
            {
                List <Label> labels = new List <Label>();
                labels.Add(FrmUtilitaire.setLabel(genre.Key));
                labels.Add(FrmUtilitaire.setLabel(genre.Value.ToString()));

                FrmUtilitaire.init().putLabelInPnl(labels, this.findControl(PnlStatistiqueGenre));
            }
        }
Ejemplo n.º 4
0
 public FrmAjoutFlux()
 {
     InitializeComponent();
     GestionUtilisateurs.SetchaineConnexion(ConfigurationManager.ConnectionStrings["Utilisateur"]);
     comboBoxEleve.DataSource          = GestionAdherent.GetAdherent();
     comboBoxEleve.DisplayMember       = "FullName";
     comboBoxBudget.DataSource         = GestionBudget.GetLesBudget();
     comboBoxBudget.DisplayMember      = "libelle";
     comboBoxTypeTransac.DataSource    = GestionTypeFlux.GetLesTypeFlux();
     comboBoxTypeTransac.DisplayMember = "libelle";
 }
Ejemplo n.º 5
0
        public FrmModifFlux()
        {
            InitializeComponent();
            GestionUtilisateurs.SetchaineConnexion(ConfigurationManager.ConnectionStrings["Utilisateur"]);
            comboBoxEleve.DataSource          = GestionAdherent.GetAdherent();
            comboBoxEleve.DisplayMember       = "FullName";
            comboBoxTypeTransac.DataSource    = GestionTypeFlux.GetLesTypeFlux();
            comboBoxTypeTransac.DisplayMember = "libelle";

            //récupération du flux sauvegarder via le button modif du FrmDetailsFlux
            Flux fluxSauvegarder = Flux.FluxSauvegarder;

            //initialisation des données par default avec les données du flux récupérer
            txtNom.Text                      = fluxSauvegarder.Libelle.Trim();
            numUpMontant.Value               = fluxSauvegarder.Montant;
            dtpDate.Value                    = fluxSauvegarder.Date;
            checkPrelevement.Checked         = fluxSauvegarder.Prelevement;
            comboBoxEleve.SelectedItem       = fluxSauvegarder.Adherent;
            comboBoxTypeTransac.SelectedItem = fluxSauvegarder.TypeFlux;
        }
Ejemplo n.º 6
0
        public FrmDetailsEleve()
        {
            InitializeComponent();

            GestionUtilisateurs.SetchaineConnexion(ConfigurationManager.ConnectionStrings["Utilisateur"]);
            List <Adherent> adherents = GestionAdherent.GetAdherent();

            int x = 20;
            int y = 20;

            foreach (Adherent adherent in adherents)
            {
                y += 20;

                Label lblNom = new Label();
                lblNom.Text      = adherent.Nom.Trim();
                lblNom.AutoSize  = true;
                lblNom.Location  = new Point(x, y);
                lblNom.Dock      = DockStyle.Fill;
                lblNom.TextAlign = ContentAlignment.MiddleCenter;

                Label lblPrenom = new Label();
                lblPrenom.Text      = adherent.Prenom.Trim();
                lblPrenom.AutoSize  = true;
                lblPrenom.Location  = new Point(x, y);
                lblPrenom.Dock      = DockStyle.Fill;
                lblPrenom.TextAlign = ContentAlignment.MiddleCenter;

                Label lblClasse = new Label();
                lblClasse.Text      = adherent.Classe.Libelle;
                lblClasse.AutoSize  = true;
                lblClasse.Location  = new Point(x, y);
                lblClasse.Dock      = DockStyle.Fill;
                lblClasse.TextAlign = ContentAlignment.MiddleCenter;

                Label lblDdn = new Label();
                lblDdn.Text      = adherent.Ddn.ToString();
                lblDdn.AutoSize  = true;
                lblDdn.Location  = new Point(x, y);
                lblDdn.Dock      = DockStyle.Fill;
                lblDdn.TextAlign = ContentAlignment.MiddleCenter;

                Label lblSexe = new Label();
                lblSexe.Text      = adherent.Sexe.ToString();
                lblSexe.AutoSize  = true;
                lblSexe.Location  = new Point(x, y);
                lblSexe.Dock      = DockStyle.Fill;
                lblSexe.TextAlign = ContentAlignment.MiddleCenter;

                Label lblNum = new Label();
                lblNum.Text      = adherent.NumTel;
                lblNum.AutoSize  = true;
                lblNum.Location  = new Point(x, y);
                lblNum.Dock      = DockStyle.Fill;
                lblNum.TextAlign = ContentAlignment.MiddleCenter;

                Label lblNumPrnt = new Label();
                lblNumPrnt.Text      = adherent.NumParnt;
                lblNumPrnt.AutoSize  = true;
                lblNumPrnt.Location  = new Point(x, y);
                lblNumPrnt.Dock      = DockStyle.Fill;
                lblNumPrnt.TextAlign = ContentAlignment.MiddleCenter;

                Label lblEmail = new Label();
                lblEmail.Text      = adherent.Email.Trim();
                lblEmail.AutoSize  = true;
                lblEmail.Location  = new Point(x, y);
                lblEmail.Dock      = DockStyle.Fill;
                lblEmail.TextAlign = ContentAlignment.MiddleCenter;

                Label lblMaj = new Label();
                lblMaj.Text      = adherent.DateMaj.ToString();
                lblMaj.AutoSize  = true;
                lblMaj.Location  = new Point(x, y);
                lblMaj.Dock      = DockStyle.Fill;
                lblMaj.TextAlign = ContentAlignment.MiddleCenter;

                Button btnUpdate = new Button();
                btnUpdate.Tag       = adherent;
                btnUpdate.Text      = "Modifier";
                btnUpdate.AutoSize  = true;
                btnUpdate.Location  = new Point(x, y);
                btnUpdate.Dock      = DockStyle.Fill;
                btnUpdate.Click    += new EventHandler(btnUpdate_Click);
                btnUpdate.TextAlign = ContentAlignment.MiddleCenter;

                Button btnDelete = new Button();
                btnDelete.Tag       = adherent.Id;
                btnDelete.Text      = "Supprimer";
                btnDelete.AutoSize  = true;
                btnDelete.Location  = new Point(x, y);
                btnDelete.Dock      = DockStyle.Fill;
                btnDelete.Click    += new EventHandler(btnDelete_Click);
                btnDelete.TextAlign = ContentAlignment.MiddleCenter;

                this.Controls.Find("pnl", true)[0].Controls.Add(lblNom);
                this.Controls.Find("pnl", true)[0].Controls.Add(lblPrenom);
                this.Controls.Find("pnl", true)[0].Controls.Add(lblClasse);
                this.Controls.Find("pnl", true)[0].Controls.Add(lblDdn);
                this.Controls.Find("pnl", true)[0].Controls.Add(lblSexe);
                this.Controls.Find("pnl", true)[0].Controls.Add(lblNum);
                this.Controls.Find("pnl", true)[0].Controls.Add(lblNumPrnt);
                this.Controls.Find("pnl", true)[0].Controls.Add(lblEmail);
                this.Controls.Find("pnl", true)[0].Controls.Add(lblMaj);
                this.Controls.Find("pnl", true)[0].Controls.Add(btnUpdate);
                this.Controls.Find("pnl", true)[0].Controls.Add(btnDelete);
            }
        }