public async Task <IActionResult> ProfilAyarlari(AppUserGuncelleVM model) { bool result = await _userManagerBusiness.KullaniciGuncelle(model); MesajYaz(result, "Profil bilgileriniz başarıyla güncellenmiştir.", "Mevcut şifrenizi lütfen doğru giriniz."); return(View(model)); }
public async Task <bool> KullaniciGuncelle(AppUserGuncelleVM model) { AppUser user = await KullaniciGetir(model.Username); if (user == null) { user = await KullaniciGetir(model.Email); } user.PhoneNumber = model.PhoneNumber; user.TuttuguTakim = model.TuttuguTakim; await _userManager.UpdateAsync(user); if (!string.IsNullOrEmpty(model.Password) && !string.IsNullOrEmpty(model.PasswordTekrar) && !string.IsNullOrEmpty(model.CurrentPassword)) { IdentityResult result = await _userManager.ChangePasswordAsync(user, model.CurrentPassword, model.Password); if (!result.Succeeded) { return(false); } else { } } return(true); }
public async Task <IActionResult> ProfilAyarlari() { AppUserGuncelleVM user = await _userManagerBusiness.GuncellenecekKullaniciGetir(User.Identity.Name); return(View(user)); }