public AdherentController()
 {
     aDA             = new AdherentDA();
     participantDA   = new ParticipantDA();
     participationDA = new ParticipationDA();
     conjointDA      = new ConjointDA();
     enfantDA        = new EnfantDA();
 }
Exemple #2
0
 //Will be only one instance
 public static ParticipantDA getInstance()
 {
     if (instance == null)
     {
         instance = new ParticipantDA();
     }
     return(instance);
 }
 public ParticipantController()
 {
     pDA = new ParticipantDA();
 }
 AuthenticationHandler()
 {
     userDA        = UserDA.getInstance();
     participantDA = ParticipantDA.getInstance();
     venueHostDA   = VenueHostDA.getInstance();
 }
Exemple #5
0
 public ParticipantHandler()
 {
     userDA        = UserDA.getInstance();
     addressDA     = AddressDA.getInstance();
     participantDA = ParticipantDA.getInstance();
 }
Exemple #6
0
        private void btAccepter_Click(object sender, EventArgs e)
        {
            try
            {
                ActiviteDA    aDA   = new ActiviteDA();
                AdherentDA    aDDA  = new AdherentDA();
                ParticipantDA pDA   = new ParticipantDA();
                int           reste = aDA.restePlace(int.Parse(dataActiviteActuel.CurrentRow.Cells[0].Value.ToString()));
                if (reste <= 0)
                {
                    MessageBox.Show("Le nombre de place est peline", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                }
                else
                {
                    int i   = 0;
                    int nbr = 0;
                    foreach (Participation l in listAdherent)
                    {
                        nbr++;
                    }
                    if (nbr <= reste)
                    {
                        reste = nbr;
                    }
                    else
                    {
                    }
                    Mailing m;
                    foreach (Participation l in listAdherent)
                    {
                        if ((aDDA.getNombrePoint(l.participant.matricule) <= 0))
                        {
                            pc.refuser(l.id);
                            MessageBox.Show("Demande réfusé", "Message", MessageBoxButtons.OK, MessageBoxIcon.Information);
                            continue;
                        }
                        else
                        {
                            foreach (String a in a.listAdresse(l.participant.matricule))
                            {
                                m = new Mailing(a, "Notification", "Vous etes le bienvenue , nous avons accepte votre demande");
                                m.sendMail();
                            }
                            pc.AccepterAdherent(l.participant.matricule, int.Parse(dataActiviteActuel.CurrentRow.Cells[0].Value.ToString()), 0, int.Parse(dataActiviteActuel.CurrentRow.Cells[4].Value.ToString()));

                            if (i == reste)
                            {
                                MessageBox.Show("Erreur");
                                break;
                            }
                            i++;
                        }
                    }
                    foreach (Participation l in listConjoint)
                    {
                        pc.AccepterConjoint(l.participant.matricule, int.Parse(dataActiviteActuel.CurrentRow.Cells[0].Value.ToString()), 0, 0);
                    }
                    foreach (Participation l in listEnfant)
                    {
                        pc.AccepterEnfant(l.participant.matricule, int.Parse(dataActiviteActuel.CurrentRow.Cells[0].Value.ToString()), 0, 0);
                    }
                    a            = new AdherentDA();
                    listAdherent = pc.DemandeListAdherent(int.Parse(dataActiviteActuel.CurrentRow.Cells[0].Value.ToString()));
                    pc.AfficheDemandeParActivite(dataDemande, int.Parse(dataActiviteActuel.CurrentRow.Cells[0].Value.ToString()));
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }