Beispiel #1
0
        public ActionResult MonProfil()
        {
            string identificateur = User.Identity.GetUserId();
            photo = new Photo();

            ProfileModels model = new ProfileModels();
            var user = UserManager.FindById(identificateur);

            model.Email = user.Email; 
            model.PhoneNumber = user.PhoneNumber;
            return View(model);
        }
Beispiel #2
0
        public ActionResult   UpdateAccount(ProfileModels model)
        {
            
            string identificateur = User.Identity.GetUserId();  
            if (model.Image != null)
            {
                MemoryStream target = new MemoryStream();
                model.Image.InputStream.CopyTo(target); 
                photo = new Photo();
                photo.UpdatePhoto(identificateur, target.ToArray());
            }
            var user = UserManager.FindById(identificateur);
            user.Email = model.Email;  
            user.PhoneNumber = model.PhoneNumber;
             UserManager.Update(user);
             return  RedirectToAction("MonProfil", "Account");

        }