private static List<Inline> MemberToDisplay(Membre m) { //StringBuilder sb = new StringBuilder(" ", 0, nbrIndentSpace * indentLevel); List<Inline> ic = new List<Inline>(); ic.Add(new Run(m.NomUtilisateur)); ic.Add(new LineBreak()); ic.Add(new Run(Indent(1))); ic.Add(new Run(m.Prenom + " " + m.Nom)); ic.Add(new LineBreak()); ic.Add(new Run(Indent(1))); ic.Add(new Run(m.Age.ToString())); if (m.Age > 1) { ic.Add(new Run(" " + Nutritia.UI.Ressources.Localisation.FenetreInfoMembre.Ages)); } else ic.Add(new Run(" " + Nutritia.UI.Ressources.Localisation.FenetreInfoMembre.Age)); //ic.Add(new Bold(new Run(" my"))); //ic.Add(new Run(" faithful")); //ic.Add(new Underline(new Run(" computer"))); //ic.Add(new Run(". ")); //ic.Add(new Italic(new Run("You rock!"))); return ic; }
/// <summary> /// Un objet équipable sur un membre d'un héro /// </summary> /// <param name="Nom">Le nom</param> /// <param name="Description">La description</param> /// <param name="Prix">Le prix de vente</param> /// <param name="Membre">Le membre sur lequel l'objet doit être utilisé</param> /// <param name="ClasseRestreinte">La classe auquel l'objet est restreint</param> public Equipable(string Nom, string Description, double Prix, Attributs Attributs, Membre Membre, ClasseRef ClasseRestreinte = ClasseRef.Tous) : base(Nom, Description, Prix) { _attributs = Attributs; _membre = Membre; _classeRestreinte = ClasseRestreinte; AppliquerConditions(); }
public MiseAJourMotDePasseViewModel(INavigation navigation, int membreId) { _navigation = navigation; _membre = new Membre(); _membreModifPassword = new MembreModifPassword(); _membre.Id = membreId; _validatorMiseAjourMotdePasse = new ValidateurMotDePasseMiseAJour(); ValiderCommand = new Command(async() => await EnregistrementPassword()); // AjoutImageProfil = new Command(); FetchUserConnexionDetails(); }
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e) { if (GridView1.SelectedValue != null) { Membre edited = MembreFactory.Get(((Logements)Master).CnnStr, "", int.Parse(GridView1.SelectedValue.ToString()))[0]; Modal_ID.Value = edited.Id.ToString(); Modal_Email.Value = edited.Courriel; Modal_Prenom.Value = edited.Prenom; Modal_Nom.Value = edited.Nom; Modal_Adresse.Value = edited.Adresse; Modal_Telephone.Value = edited.Telephone; Modal_IsAdmin.Checked = edited.IsAdmin; Modal_IsActive.Checked = edited.IsActive; buttonConfirm.CommandArgument = edited.Id.ToString(); confirmDeletion.CommandArgument = edited.Id.ToString(); ClientScript.RegisterStartupScript(GetType(), "Show", "<script> $('#formulaireMembre').modal('show');</script>"); } }
protected void Page_Load(object sender, EventArgs e) { membre = Session[SESSIONMEMBRE] as Membre; if (membre != null) { lnkConn.Visible = false; lnkIns.Visible = false; lnkAdd.Visible = true; lnkDeco.Visible = true; lnkMembre.Visible = true; lnkMembre.NavigateUrl = "profil.aspx"; lblMembre.Text = membre.Prenom + " " + membre.Nom; if (membre.IsAdmin) { AdminPanel.Visible = true; } } }
public DetailMembreViewModel(INavigation navigation, int selectedMembreID) { _navigation = navigation; _membre = new Membre(); _membre.Id = selectedMembreID; _typeMembre = new TypeMembre { IdTypeMembre = selectedMembreID }; DeleteCommand = new Command(async() => await DeleteMembre()); MiseAjourPageCommand = new Command(async() => await ModificationDesInfos()); FetchMembreDetailsAsync(); FetchTypeMembreDetailsAsync(); }
public Membre RecupUnMembre(string n) { Membre leMembre; string sel = "select * from membre where nom = '" + n + "'"; DataSet dsMembres = maBD.Recuperer(sel); DataTable tableMembres = dsMembres.Tables[0]; int cmp = tableMembres.Rows.Count; if (cmp > 1) { MessageBox.Show("Alerte il y a " + cmp + " membres " + n); } leMembre = new Membre(tableMembres.Rows[0]); return(leMembre); }
protected void Page_Load(object sender, EventArgs e) { membre = Session[Logements.SESSIONMEMBRE] as Membre; if (membre != null && membre.IsAdmin) { if (!Page.IsPostBack) { Membre[] membres; membres = MembreFactory.Get(((Logements)Master).CnnStr, "notAccepted", 0); Repeater_Demandes.DataSource = membres; Repeater_Demandes.DataBind(); } } else { Response.Redirect("Default.aspx"); } }
public async Task <IActionResult> Details(int IdFeat, int IdMembre) //ID Feat { Feat feat = _context.Feats .Where(b => b.Id == IdFeat) .Include(b => b.Createur) .Include("Reponses.Helper") .Include(b => b.Adresse) .Include(b => b.Materiel) .Include(b => b.Type) .FirstOrDefault(); var Reponses = _context.ReponseHelpers .Where(b => b.Feat.Id == IdFeat) .Where(b => b.DesistementDate == null) .ToList(); ViewBag.IdMembre = IdMembre; ViewBag.Reponses = Reponses; if (Reponses.Count() != 0) { ViewBag.PrenomHelper = Reponses.FirstOrDefault().Helper.Prenom; ViewBag.NomHelper = Reponses.FirstOrDefault().Helper.Nom; } Membre membre = _context.Membres .Where(b => b.Id == IdMembre) .FirstOrDefault(); ViewBag.PrenomMembre = membre.Prenom; ViewBag.NomMembre = membre.Nom; if (feat.Createur.Id == IdMembre) { ViewBag.Affichage = 1; } else { ViewBag.Affichage = 2; } return(View(feat)); }
protected void Page_Load(object sender, EventArgs e) { ((Label)Page.Master.FindControl("titrebandeau")).Text = "Mon espace"; //create_radiobutton(); if (this.RadioButtonMesBiens.Checked) { fill_table("Mes biens"); } else if (RadioButtonTousLesBiens.Checked) { fill_table("Tous les biens"); } else if (RadioButtonMonAgence.Checked) { fill_table("Mon agence"); } else { fill_table("Mes biens"); } if (Session["logged"].Equals(true)) { // permet le "Bonjour Mr X" Membre member = (Membre)Session["Membre"]; LabelPrenom.Text = member.CIVILITE; LabelNom.Text = member.NOM; } else { Response.Redirect("./recherche.aspx"); } //Lorsque l'on clique sur certains items, tels que les radiobuttons, l'option autopostback="true", permet recharger la page mais pas ce qui suit : if (!Page.IsPostBack) { RadioButtonMesBiens.Checked = true; populate_DDL_Acq(); } }
public async Task <IActionResult> ModifFeatGiftee(int IdFeat, int IdMembre, int JeSuis) //IdFeat { IQueryable <string> recupTypeAide = from m in _context.TypeAides orderby m.NomAide select m.NomAide; IQueryable <string> recupMateriel = from m in _context.Materiels orderby m.NomMateriel select m.NomMateriel; IQueryable <string> recupAdresse = from m in _context.Adresses orderby m.NomDeVoie select m.NomDeVoie; Feat featToModify = _context.Feats .Where(b => b.Id == IdFeat) .Include(b => b.Createur) .Include(b => b.Adresse) .Include(b => b.Materiel) .Include(b => b.Type) .Include("Reponses.Helper") .FirstOrDefault(); ViewBag.IdMembre = IdMembre; ViewBag.JeSuis = JeSuis; ViewBag.Materiels = new SelectList(await recupMateriel.Distinct().ToListAsync()); ViewBag.TypesAide = new SelectList(await recupTypeAide.Distinct().ToListAsync()); ViewBag.Adresse = new SelectList(await recupAdresse.Distinct().ToListAsync()); Membre membre = _context.Membres .Where(b => b.Id == IdMembre) .FirstOrDefault(); ViewBag.PrenomMembre = membre.Prenom; ViewBag.NomMembre = membre.Nom; return(View(featToModify)); }
protected void Page_Load(object sender, EventArgs e) { Membre member = (Membre)Session["Membre"]; if (member == null || (member.STATUT != "nego" && member.STATUT != "ultranego")) { Response.Close(); } ((Label)Page.Master.FindControl("titrebandeau")).Text = "Mon espace"; if (!IsPostBack) { DropDownListPageSize.SelectedValue = Session["annoncesPage"].ToString(); GridViewHist.PageSize = int.Parse(DropDownListPageSize.SelectedValue); BindData(); } }
private void btnAjout_Click(object sender, RoutedEventArgs e) { if (grilleDonnees.SelectedIndex >= 0) { if (cptn == null) { cptn = grilleDonnees.SelectedItem as Membre; if (aAjouter.Ajouter_un_membre(cptn)) { aAjouter.FaireAjoutUnMembre(cptn); aAjouter.Capitaine = cptn; this.labelNbJoueur.Content = "Nombre de joueur : 1/" + Convert.ToString(this.competCourante.Nb_Joueur); MessageBox.Show("capitaine ajouté"); } else { cptn = null; MessageBox.Show("Le capitaine n'a pas pu etre ajouté. Essayer un autre membre"); } } else { if (aAjouter.Composition_Equipe.Count < this.competCourante.Nb_Joueur) { membreAAjouter = grilleDonnees.SelectedItem as Membre; if (aAjouter.Ajouter_un_membre(membreAAjouter)) { aAjouter.FaireAjoutUnMembre(membreAAjouter); this.labelNbJoueur.Content = "Nombre de joueur : " + Convert.ToString(aAjouter.Composition_Equipe.Count) + "/" + Convert.ToString(this.competCourante.Nb_Joueur); MessageBox.Show("joueur ajouté"); } else { MessageBox.Show("Le joueur n'a pas pu etre ajouté. Essayer un autre membre. Faire attention aux dates communes de compet, à l'age et au sexe"); } } else { MessageBox.Show("Votre equipe est complete retourner au menu princiale"); } } } }
protected void ChangeInfo(object sender, EventArgs e) { Membre membre = membreService.Read(userID); if (this.newPrenom.Text != null && this.newPrenom.Text != "") { string newPrenom = this.newPrenom.Text; membre.Prenom = newPrenom; } if (this.newNom.Text != null && this.newNom.Text != "") { string newNom = this.newNom.Text; membre.Nom = newNom; } membreService.Update(membre); change_info_message.Text = "Vos informations ont été mis à jour. L'affichage va être mis à jour après votre prochaine connexion."; change_info_message.Visible = true; }
protected void Page_Load(object sender, EventArgs e) { Membre member = (Membre)Session["Membre"]; if (member == null || (member.STATUT != "nego" && member.STATUT != "ultranego")) { Response.Redirect("./recherche.aspx"); Response.Close(); } ((Label)Page.Master.FindControl("titrebandeau")).Text = "Mon espace"; if (Session["Membre"] != null) { member = (Membre)Session["Membre"]; } if (!IsPostBack) { } }
protected void ButtonAddAcquereur_Click(object sender, EventArgs e) { Acquereur acquereur = new Acquereur(); if (checkField(acquereur)) { Membre member = new Membre(); member = (Membre)Session["Membre"]; AcquereurDAO.addAcquereur(acquereur, member.IDCLIENT, member.NOM); if (Request.QueryString["refBien"] == null) { Response.Redirect("./liste_acquereur.aspx"); } else { Response.Redirect("./rapprochementbien.aspx?idAcq=" + Request.QueryString["refBien"]); } } }
public async Task <IActionResult> Dispo(int Id) { ViewBag.IdMembre = Id; List <Disponibilite> listDispo = _context.Disponibilites .Where(b => b.membre.Id == Id) //.Where(b => b.ValiditeFinDate >= DateTime.Now) .Include(b => b.Jour) .Include(b => b.membre) .ToList(); Membre membre = _context.Membres .Where(b => b.Id == Id).FirstOrDefault(); ViewBag.IdMembre = membre.Id; ViewBag.PrenomMembre = membre.Prenom; ViewBag.NomMembre = membre.Nom; return(View(listDispo)); }
public static List <Membre> lesMembres(string order) { string chConnexion = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; SqlConnection connexion = new SqlConnection(chConnexion); string requete = "SELECT * FROM Membre ORDER BY " + order; SqlCommand commande = new SqlCommand(requete, connexion); commande.CommandType = System.Data.CommandType.Text; List <Membre> maListe = new List <Membre>(); try { connexion.Open(); SqlDataReader dr = commande.ExecuteReader(); while (dr.Read()) { Membre a = new Membre { Numero = (string)dr["Numero"], Civilite = (string)dr["Civilite"], Nom = (string)dr["Nom"], Prenom = (string)dr["Prenom"], Langue = (string)dr["Langage"], Telephone = (string)dr["Telephone"], Adresse = (string)dr["Adresse"], Courriel = (string)dr["Courriel"], DateInscri = (DateTime)dr["DateInscri"], Cote = (int)dr["Cote"], MotDePasse = (string)dr["MDP"] }; maListe.Add(a); } dr.Close(); return(maListe); } catch (Exception e) { System.Console.WriteLine(e.Message); } finally { connexion.Close(); } return(null); }
public static Membre GetUserByNumero(string numero) { Membre user = null; string connectionString = ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString; SqlConnection connection = new SqlConnection(connectionString); string request = "SELECT * FROM Membre WHERE Numero = '" + numero + "'"; SqlCommand command = new SqlCommand(request, connection); try { connection.Open(); SqlDataReader dr = command.ExecuteReader(); if (dr.Read()) { user = new Membre { Numero = (string)dr["Numero"], Civilite = (string)dr["Civilite"], Nom = (string)dr["Nom"], Prenom = (string)dr["Prenom"], Langue = (string)dr["Langage"], Telephone = (string)dr["Telephone"], Adresse = (string)dr["Adresse"], Courriel = (string)dr["Courriel"], DateInscri = (DateTime)dr["DateInscri"], Cote = (int)dr["Cote"], MotDePasse = (string)dr["MDP"] }; } dr.Close(); return(user); } catch (Exception e) { System.Console.WriteLine(e.Message); } finally { connection.Close(); } return(null); }
public static Association CreerAssociation3() { Association assoc = new Association("BDE du dpt mesures physiques", "../images/BDE.png"); Membre membre1 = new Membre("Laurine", "LeFevbre", Role.VicePresident, "Je suis vide-trésorier", "0459859", "../images/BradPitt.jpg", "*****@*****.**"); Membre membre2 = new Membre("Vince", "Fournier", Role.President, "Je suis en deuxième année à l'iut de clermont-ferrand dans le dept bio", "07869859", "../images/BradPitt.jpg", "*****@*****.**"); Membre membre3 = new Membre("Richard ", "Martinez", Role.Secretaire, "Je suis secrétaire au bde BIO", "09869859", "../images/BradPitt.jpg", "*****@*****.**"); Membre membre4 = new Membre(" Thibault", "LeDuc", Role.ViceSecretaire, "Je suis vice-secrétaire au bde BIO", "09869859", "../images/BradPitt.jpg", "*****@*****.**"); Evenement evenement = new Evenement("Journée Aquarium", new DateTime(2020, 11, 05, 17, 30, 00), "Clermont-Ferrand", 20f, "https://img.grouponcdn.com/deal/24sH6M6RmzCc53CYjUhLnRnWZ3NQ/24-1120x672/v1/c700x420.jpg", "Il s'agit d'une excursion à l'aquarium de Clermont-Ferrand."); Evenement evenement1 = new Evenement("Visite d'une exposition", new DateTime(2020, 11, 05, 20, 30, 00), "ASM Experience", 0, "https://www.roz-sur-couesnon.fr/wp-content/uploads/2016/03/Evt-770x470.png", "Visite d'une galerie d'expériences scientifiques."); Evenement evenement2 = new Evenement("Boite de nuit", new DateTime(2020, 4, 06, 20, 30, 00), "L'Appart", 8f, "https://www.cozycozy.com/fr/ou-dormir/wp-content/uploads/biarritz-boite-de-nuit.jpg", "Sortie en boite de nuit"); assoc.AjouterEvenement(evenement); assoc.AjouterUnMembre(membre1); assoc.AjouterUnMembre(membre2); assoc.AjouterUnMembre(membre3); assoc.AjouterUnMembre(membre4); return(assoc); }
public ActionResult UpdateEnchere(string id) { // LangueController.CreateCulture(getLangue()); CreateCulture(getLangue()); Membre mb = MembreRequette.GetUserByEmail(@User.Identity.Name); Encher en = EnchereRequette.getEnchereById(id); UpdateEnchereViewModel model = new UpdateEnchereViewModel(); model.Id = en.Id; model.IdObjet = en.IdObjet; model.IdAcheteur = mb.Numero; model.IdVendeur = en.IdVendeur; model.PrixAchat = en.PrixAchat; model.PasDePrix = en.PasDePrix; model.DateDepart = en.DateDepart; model.DateFin = en.DateFin; model.Etat = en.Etat; return(View(model)); }
protected void Envoyer_Click(object sender, EventArgs e) { string nom = txtNom.Text; string prenom = txtPrenom.Text; string adresse = txtAdresse.Text; string telephone = txtTelephone.Text; string courriel = txtCourriel.Text; string mdp = txtMDP.Text; string mdp2 = txtMDP2.Text; bool isDriver = CheckBoxConducteur.Checked; bool fumeur = CheckBoxFumeur.Checked; bool animaux = CheckBoxAnimaux.Checked; bool equipe = CheckBoxBienEquipe.Checked; Membre membre = new Membre(0, nom, prenom, adresse, telephone, courriel, mdp, false, isDriver, fumeur, animaux, equipe); MembreFactory.Save(ConfigurationManager.ConnectionStrings["cnnStr"].ConnectionString, membre); Response.Redirect("Default.aspx"); }
protected void Page_Load(object sender, EventArgs e) { membre = (Membre)Session["membre"]; if (membre == null || (membre.STATUT != "ultranego" && membre.STATUT != "nego") || Request.QueryString["id"] == null) { Response.Redirect("recherche.aspx"); } string requete = "SELECT Locations.*,Biens.*, id_client,tel_client,nom_client,prenom_client,nom,prenom,tel,portable,mail FROM Biens,Locations,Clients,Acquereurs WHERE Biens.ref = ref_bien AND Locations.id_nego = Clients.idclient AND id_acq = id_acquereur AND ID = " + Request.QueryString["id"]; string requete2 = "SELECT Ventes_honoraires.*,nom_client,prenom_client FROM Ventes_honoraires,Clients WHERE id_nego = Clients.idclient AND id_location = " + Request.QueryString["id"] + " ORDER BY type,montant DESC"; Connexion c = new Connexion(System.Configuration.ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString); c.Open(); location = c.exeRequetteOpen(requete).Tables[0].Rows[0]; listeHonoraire = c.exeRequette(requete2).Tables[0].Rows; locationEtMandat = (listeHonoraire[0]["type"].ToString() == "Mandat et location"); foreach (DataRow ligne in listeHonoraire) { totalCommission += (int)ligne["montant"]; } System.Data.DataSet ds2 = c.exeRequetteOpen("Select * from Environnement"); String racine_site = (String)ds2.Tables[0].Rows[0]["Chemin_racine_site"]; string filePathBail = racine_site + "Locations\\" + Request.QueryString["id"] + "_bail.pdf"; if (System.IO.File.Exists(filePathBail)) { oldBail.Text = "<span id='newBail'><a href='../Locations/" + Request.QueryString["id"] + "_bail.pdf'>Voir Fichier</a></span>"; } else { oldBail.Text = "Aucun fichier"; } c.Close(); c = null; }
public void AfficherInfoPersonne() { Personne personne = SelectionnerPersonne(); Type type = personne.GetType(); if (type == typeof(Membre)) { Membre membre = (Membre)personne; if (membre.Type == TypeMembre.Adherent) { membre.Afficher(); } else { if (type == typeof(Dirigeant)) { Dirigeant dirigeant = (Dirigeant)membre; dirigeant.Afficher(); } else if (type == typeof(EntraineurSalarie)) { EntraineurSalarie entraineurSalarie = (EntraineurSalarie)membre; entraineurSalarie.Afficher(); } } } else if (type == typeof(Dirigeant)) { Dirigeant dirigeant = (Dirigeant)personne; dirigeant.Afficher(); } else if (type == typeof(EntraineurSalarie)) { EntraineurSalarie entraineurSalarie = (EntraineurSalarie)personne; entraineurSalarie.Afficher(); } else if (type == typeof(EntraineurIndependant)) { EntraineurIndependant entraineurIndependant = (EntraineurIndependant)personne; entraineurIndependant.Afficher(); } }
public ActionResult Editer(FormCollection collection) { try { string courriel = Convert.ToString(collection["Courriel"]); bool trouve = false; string chemin = Server.MapPath(@"~/App_Data/membres.txt"); using (StreamReader fichier = new StreamReader(chemin, true)) { string ligne; string[] attributs = null; char delimiteur = ','; Membre unMembre = new Membre(); while ((ligne = fichier.ReadLine()) != null && !trouve) { attributs = ligne.Split(delimiteur); if (String.Equals(attributs[2], courriel)) { trouve = true; unMembre = new Membre() { Image = attributs[0], Prenom = attributs[1], Courriel = attributs[2], Telephone = attributs[3], Commentaire = attributs[4] }; } } fichier.Close(); if (trouve) { Effacer(collection); return(View(unMembre)); } else { return(View("Error")); } } } catch { return(View("Error")); } }
protected Boolean FileUpload(object sender, EventArgs e) { Boolean boolFileUpload1 = true; // Récupère le chemin racine du site Connexion c = new Connexion(_ConnectionString); c.Open(); System.Data.DataSet ds2 = c.exeRequette("Select * from Environnement"); c.Close(); String racine_site = (String)ds2.Tables[0].Rows[0]["Chemin_racine_site"]; Membre member = (Membre)Session["Membre"]; // chargement de photo if (FileUpload1.HasFile) { string fileExt1 = System.IO.Path.GetExtension(FileUpload1.FileName); if (fileExt1 == ".jpg" || fileExt1 == ".jpeg" || fileExt1 == ".JPG" || fileExt1 == ".JPEG") { try { FileUpload1.SaveAs(racine_site + "img_nego\\" + member.IDCLIENT + "_PHOTO" + fileExt1); } catch (Exception ex) { Label1.Text = "ERROR: " + ex.Message.ToString(); } } else { Label1.Text = "Only .jpg files allowed!"; boolFileUpload1 = false; } } if (boolFileUpload1) { return(true); } else { return(false); } }
public ActionResult ModifierMDP() { Membre u = MembreRequette.GetUserByEmail(User.Identity.Name); MembreMDP mmdp = new MembreMDP(u); ViewBag.Nom = u.Nom; /* str = Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"]; * if (User.Identity.IsAuthenticated && u != null) str = u.Langue; * string cookie = ""; * if (this.ControllerContext.HttpContext.Request.Cookies.AllKeys.Contains("Cookie")) { * cookie = this.ControllerContext.HttpContext.Request.Cookies["Cookie"].Value; * ViewBag.cookie = cookie; * CreateCulture(cookie); * } * else CreateCulture(str); */ return(View(mmdp)); }
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; } }
public async Task <IActionResult> Create([Bind("MembreID,MontantPayer,DatePayement,MoyenPayement,IDTransaction,AvanceAccord,MontantAvance,MembreReference")] Paiement paiement) { //if (ModelState.IsValid) if (paiement != null) { if (paiement.MembreReference != null) { Membre membreReference = _context.Membre.FirstOrDefault(m => (m.Nom + " " + m.Prenom).ToLower().Contains(paiement.MembreReference.ToLower())); if (membreReference != null) { paiement.MembreAvanceID = membreReference.ID; } } _context.Add(paiement); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(paiement)); }
protected void Page_Load(object sender, EventArgs e) { Membre member = (Membre)Session["Membre"]; if (member == null || (member.STATUT != "ultranego" && member.STATUT != "nego")) { Response.Redirect("./recherche.aspx"); } if (Request.QueryString["type"] == "doc") { dir = "reseau_documents"; } if (Request.QueryString["type"] == "lettres") { dir = "reseau_lettres"; } ((Label)Page.Master.FindControl("titrebandeau")).Text = "Modèles de documents"; }
public ActionResult Create([Bind(Include = "PretID,DateDuPret,DateRetour,MembreID,LivreID")] Pret pret) { if (ModelState.IsValid) { Membre trouve = db.Membre.Find(pret.MembreID); if (trouve.nbLivres != 3) { db.Pret.Add(pret); trouve.nbLivres = trouve.nbLivres + 1; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.msn = 1; return(View()); } ViewBag.LivreID = new SelectList(db.Livre, "LivreID", "Titre", pret.LivreID); ViewBag.MembreID = new SelectList(db.Membre, "MembreID", "Nom", pret.MembreID); return(View(pret)); }
protected void ButtonEnregistrer_Click1(object sender, EventArgs e) { Membre member = new Membre(); if (checkField(member)) { try { MembreDAO.addMember(member); Response.Redirect("./inscriptionAccueil.aspx?valid=oui"); } catch { LabelErrorLogin.Visible = true; LabelErrorLogin.Text = "Email déjà utilisé, veuillez recommencer votre inscription"; } } }
/// <summary> /// Méthode de validation du champ "Nom d'utilisateur". Celui-ci est un champ alphanumérique (lettres et chiffres uniquement). /// De plus, la longueur du nom d'utilisateur doit être comprise entre 2 et 15 charactères. /// </summary> private void Valider_Utilisateur() { /*-----------------------------------Vérifier que le nom d'utilisateur n'est pas vide-----------------------------------*/ if (string.IsNullOrEmpty(Nom_utilisateur.Text)) { lbl_utilisateur.Foreground = Brushes.Red; lbl_utilisateur.Content = FenetreProfil.UsernameVide; Erreur = true; } else { /*-----------------------------------Vérifier que le nom d'utilisateur n'est pas trop petit ou grand-----------------------------------*/ if (Nom_utilisateur.Text.Length < 2 || Nom_utilisateur.Text.Length > 15) { lbl_utilisateur.Foreground = Brushes.Red; lbl_utilisateur.Content = FenetreProfil.UsernameLongueur; Erreur = true; } else { /*-----------------------------------Vérifier que le nom d'utilisateur n'inclus que des caractères valides (A-z 0-9)-----------------------------------*/ Regex RgxUtilisateur = new Regex("[^A-z0-9]"); bool ContientSeulement = RgxUtilisateur.IsMatch(Nom_utilisateur.Text); if (ContientSeulement) { lbl_utilisateur.Foreground = Brushes.Red; lbl_utilisateur.Content = FenetreProfil.UsernameCaractereInvalide; Erreur = true; } else { Membre membreValidation = new Membre(); membreValidation = ServiceFactory.Instance.GetService<IMembreService>().Retrieve(new RetrieveMembreArgs{NomUtilisateur = Nom_utilisateur.Text}); if(membreValidation.NomUtilisateur != null) { lbl_utilisateur.Foreground = Brushes.Red; lbl_utilisateur.Content = FenetreProfil.UsernameUnique; Erreur = true; } else { lbl_utilisateur.Foreground = Brushes.DarkGreen; lbl_utilisateur.Content = FenetreProfil.UsernameGeneral; } } } } }
/// <summary> /// Méthode de validation du champ "Nom d'utilisateur". Celui-ci doit exister dans la base de données. /// </summary> private void Valider_Utilisateur() { /*-----------------------------------Vérifier que le nom d'utilisateur n'est pas vide-----------------------------------*/ if (string.IsNullOrEmpty(Nom_utilisateur.Text)) { lbl_utilisateur.Foreground = Brushes.Red; lbl_utilisateur.Content = Nutritia.UI.Ressources.Localisation.FenetreConnexion.NomUtilisateurVide; Erreur = true; } else { membreValidation = ServiceFactory.Instance.GetService<IMembreService>().Retrieve(new RetrieveMembreArgs { NomUtilisateur = Nom_utilisateur.Text }); if (membreValidation.NomUtilisateur == null) { lbl_utilisateur.Foreground = Brushes.Red; lbl_utilisateur.Content = Nutritia.UI.Ressources.Localisation.FenetreConnexion.UtilisateurNonExistant; Erreur = true; } else { lbl_utilisateur.Foreground = Brushes.DarkGreen; lbl_utilisateur.Content = Nutritia.UI.Ressources.Localisation.FenetreConnexion.NomUtilisateur; } } }