private void AfficherPar() { Membres = club.Membres; BindingList <MembreModel> AfficherMembres = new BindingList <MembreModel> { }; if (EstAfficherParCotisation != "") { foreach (MembreModel m in Membres) { if (MembreService.CotisationAJour(club, m).ToString() == EstAfficherParCotisation) { AfficherMembres.Add(m); } } Membres = AfficherMembres; } AfficherMembres = new BindingList <MembreModel> { }; if (EstAfficherParCompetition != "" && EstAfficherParSexe != "") { foreach (MembreModel m in Membres) { if (m.Sexe.ToString() == EstAfficherParSexe && m.Competition.ToString() == EstAfficherParCompetition) { AfficherMembres.Add(m); } } Membres = AfficherMembres; } else { if (EstAfficherParCompetition != "") { foreach (MembreModel m in Membres) { if (m.Competition.ToString() == EstAfficherParCompetition) { AfficherMembres.Add(m); } } Membres = AfficherMembres; } else { if (EstAfficherParSexe != "") { foreach (MembreModel m in Membres) { if (m.Sexe.ToString() == EstAfficherParSexe) { AfficherMembres.Add(m); } } Membres = AfficherMembres; } } } }
protected void payerActivites(object sender, EventArgs e) { InscriptionService inscriptionService = new InscriptionService(); MembreService membreService = new MembreService(); string idMembre = (string)HttpContext.Current.Session["userID"]; Membre membre = membreService.Read(idMembre); DateTime dateDebut = DateTime.Now; List <Models.Activite> panier = (List <Models.Activite>)Session["panier"]; foreach (Models.Activite activite in panier) { DateTime dateFin = dateDebut.AddDays(activite.Duree); Inscription inscriptionModel = new Inscription(); inscriptionModel.IdActivite = activite.id.ToString(); inscriptionModel.IdMembre = idMembre; inscriptionModel.DateInscription = dateDebut; inscriptionModel.DateFin = dateFin; inscriptionService.Add(inscriptionModel); } membre.Adresse = adresseField.Text; membre.Cart_Credit = noCarteField.Text; membre.Cart_CVC = cvcField.Text; membreService.Update(membre); Session["panier"] = null; Response.Redirect("Confirmation.aspx"); }
private void SupprimerMembre(object obj) { MembreModel m = obj as MembreModel; MembreService.SupprimerMembre(club, m); membres.Remove(m); }
private void Inititialisation() { competiteurs = MembreService.ListeCompetiteur(club); foreach (CompetiteurModel c in competiteurs) { NombreDeMatcheJoue.Add(c.IdMembre, c.MatchesJoue.Count); } }
protected void Page_Load() { membreService = new MembreService(); if (HttpContext.Current.Session["userID"] == null) { FormsAuthentication.SignOut(); Response.Redirect("~/Account/Login.aspx"); } userID = (string)HttpContext.Current.Session["userID"]; MySQL.SelectCommand = "SELECT m.prenom, m.nom, m.email, v.date, v.ipAdresse FROM visite v, membre m WHERE v.idMembre= m.id AND v.idMembre=" + userID + " ORDER BY date DESC"; }
public void Initialisation() { foreach (PersonnelModel e in PersonnelService.ListeEntraineur(club)) { ListeDesEntraineurs.Add(e); } ListeDesCompetiteursSansEquipe = MembreService.ListeCompetiteurDisponible(club); AjouterCompetiteurSCommand = new SimpleCommand(AjouterCompetiteurS); SupprimerCompetiteurSCommand = new SimpleCommand(SupprimerCompetiteurS); AjouterEquipeCommand = new SimpleCommand(AjouterEquipe); }
public void AjouterMembre(object parameters) { if (Membre.Competition) { CompetiteurModel c = new CompetiteurModel(Membre); MembreService.AjouterMembre(club, c); } else { MembreService.AjouterMembre(club, Membre); } ButtonAjouter = "Hidden"; ButtonVoirMembre = "Visible"; Cotisation = MembreService.CalculCotisation(Membre); }
private void MiseAJourDesListe() { foreach (MembreModel m in club.Membres) { if (!StageService.VeutParticiper(club, stage, m) && MembreService.EstDisponible(club, m, stage) && !StageService.ParticipeAuStage(m, stage)) { Membres.Add(m); } if (StageService.VeutParticiper(club, stage, m)) { Participants.Add(m); } if (StageService.ParticipeAuStage(m, stage)) { ParticipantsStage.Add(m); } } }
public void Initialisation() { Dictionary <string, int> Intclassement = new Dictionary <string, int> { }; Intclassement.Add("-15", 0); Intclassement.Add("-4/6", 1); Intclassement.Add("-2/6", 2); Intclassement.Add("0", 3); Intclassement.Add("1/6", 4); Intclassement.Add("2/6", 5); Intclassement.Add("3/6", 6); Intclassement.Add("4/6", 7); Intclassement.Add("5/6", 8); Intclassement.Add("15", 9); Intclassement.Add("30", 15); Intclassement.Add("15/5", 14); Intclassement.Add("15/4", 13); Intclassement.Add("15/3", 12); Intclassement.Add("15/2", 11); Intclassement.Add("15/1", 10); Intclassement.Add("40", 21); Intclassement.Add("30/5", 20); Intclassement.Add("30/4", 19); Intclassement.Add("30/3", 18); Intclassement.Add("30/2", 17); Intclassement.Add("30/1", 16); foreach (CompetiteurModel c in MembreService.ListeCompetiteurDisponible(club)) { if (c.Equipe == null && Intclassement[c.Classement] >= Intclassement[equipe.Niveau]) { this.membresDispo.Add(c); } } foreach (CompetiteurModel c in Equipe.ListeDeJoueur) { this.joueursEquipe.Add(c); } AjouterJoueurCommand = new SimpleCommand(AjouterJoueur); SupprimerJoueurCommand = new SimpleCommand(SupprimerJoueur); }
protected void CreateUser_Click(object sender, EventArgs e) { MembreService membreService = new MembreService(); Membre membre = new Membre(); membre.Prenom = First_name.Text; membre.Nom = Last_name.Text; membre.Email = Email.Text; membre.Password = FormsAuthentication.HashPasswordForStoringInConfigFile(Password.Text, "SHA1"); if (membreService.EmailUnique(membre)) { membreService.inscrire(membre); Response.Redirect("~/Account/Login.aspx?email=" + membre.Email); } else { ErrorMessage.Text = "L'adresse courriel utilisée appartient déjà à un utilisateur."; ErrorMessage.Visible = true; } }
protected void LogIn(object sender, EventArgs e) { MembreService membreService = new MembreService(); Membre membre = new Membre(); VisiteService visiteService = new VisiteService(); Visite visite = new Visite(); membre.Email = Email.Text; membre.Password = FormsAuthentication.HashPasswordForStoringInConfigFile(Password.Text, "SHA1"); membre = membreService.MembreValid(membre); if (membre != null) { string [] roles = new string[2] { "normal", null }; if (membre.IsAdmin == 1) { roles[1] = "admin"; } string ipAdresse = Request.UserHostAddress; if ("::1".Equals(ipAdresse)) { ipAdresse = "127.0.0.1"; } visite.IdMembre = membre.IdMembre; visite.IPAdresse = ipAdresse; visiteService.Login(visite); CreateTicket(membre.Nom, roles); HttpContext.Current.Session["userID"] = membre.IdMembre; HttpContext.Current.Response.Redirect("~/default.aspx"); } else { FailureText.Text = "Mauvaise combinaison de Couriel/Mot de passe, veillez réessayer."; FailureText.Visible = true; } }
private void ModifierMembre(object obj) { MembreService.ModifierMembre(club, M);; SauvegarderVisible = "Hidden"; }
protected void Page_Load(object sender, EventArgs e) { membreService = new MembreService(); this.membres = getMembres(); }