public async Task <JsonResult> UpdatePassword([FromBody] UpdateDealerPasswordRequest request) { SettingsController settingsController = this; BaseResponse baseResponse = new BaseResponse(); string userId = HttpContext.Session.GetString(SessionKeyManager.Login); AppUser byIdAsync = await settingsController._userManager.FindByIdAsync(userId); if ((await settingsController._userManager.ChangePasswordAsync(byIdAsync, request.CurrentPassword, request.NewPassword)).Succeeded) { baseResponse.Number = 1; baseResponse.Message = "Şifreniz Başarıyle Değiştirilmiştir.."; return(settingsController.Json((object)baseResponse)); } baseResponse.Number = 2; baseResponse.Message = "Eski Şifrenizi Yanlış Girdiniz.."; return(settingsController.Json((object)baseResponse)); }
public async Task <JsonResult> UserDetail() { SettingsController settingsController = this; string userId = HttpContext.Session.GetString(SessionKeyManager.Login); AppUser byIdAsync = await settingsController._userManager.FindByIdAsync(userId); return(settingsController.Json((object)new UserDetailResponse() { CompanyName = byIdAsync.AuthorizedPerson })); }
public async Task <JsonResult> UpdateDealer([FromBody] UpdateDealerRequest request) { SettingsController settingsController = this; BaseResponse response = new BaseResponse(); string userId = HttpContext.Session.GetString(SessionKeyManager.Login); AppUser byIdAsync = await settingsController._userManager.FindByIdAsync(userId); byIdAsync.Email = request.Email; byIdAsync.UserName = request.Email; byIdAsync.PhoneNumber = request.Phone; byIdAsync.Address = request.Address; byIdAsync.CompanyName = request.CompanyName; byIdAsync.AuthorizedPerson = request.Authorized; if ((await settingsController._userManager.UpdateAsync(byIdAsync)).Succeeded) { response.Message = "Bilgiler Başarıyla Değiştirilmiştir.."; response.Number = 1; return(settingsController.Json((object)response)); } response.Message = "Bu Email Adresi Kayıtlıdır.Lütfen Farklı Bir Email Adresi Giriniz"; response.Number = 2; return(settingsController.Json((object)response)); }