Exemple #1
0
        public ActionResult ChangerMotDePasse()
        {
            NouveauMotDePasse nmdp = new NouveauMotDePasse {
                login = SessionUtilisateur.Utilisateur.login
            };

            return(View(nmdp));
        }
Exemple #2
0
 public ActionResult ChangerMotDePasse(NouveauMotDePasse e)
 {
     if (ModelState.IsValid)
     {
         e.login = SessionUtilisateur.Utilisateur.login;
         if (new UtilisateurServiceAPI().ChangerMotDePasse(e))
         {
             return(RedirectToAction("Index", "Home"));
         }
     }
     return(View(e));
 }
Exemple #3
0
        public bool ChangerMotDePasse(NouveauMotDePasse e)
        {
            string              contenuJson = JsonConvert.SerializeObject(e, Formatting.Indented);
            StringContent       contenu     = new StringContent(contenuJson, Encoding.UTF8, "application/json");
            HttpResponseMessage reponse     = _client.PostAsync($"Utilisateur/ChangerMotDePasse/", contenu).Result;

            if (!reponse.IsSuccessStatusCode)
            {
                throw new Exception("Echec de la réception de données.");
            }
            return(bool.Parse(reponse.Content.ReadAsStringAsync().Result));

            throw new NotImplementedException();
        }
Exemple #4
0
        public bool ChangerMotDePasse(NouveauMotDePasse e)
        {
            UtilisateurService us = new UtilisateurService();

            return(us.ChangerMotDePasse(e.login, e.ancienMotDePasse, e.motDePasse, null));
        }