public async Task UpdateCurrentUserProfile(CurrentUserProfileEditDto input) { var user = await GetCurrentUserAsync(); input.MapTo(user); CheckErrors(await UserManager.UpdateAsync(user)); }
public async Task UpdateCurrentUserProfile(CurrentUserProfileEditDto input) { User currentUserAsync = await this.GetCurrentUserAsync(); input.MapTo <CurrentUserProfileEditDto, User>(currentUserAsync); this.CheckErrors(await this.UserManager.UpdateAsync(currentUserAsync)); }
public async Task UpdateCurrentUserProfile(CurrentUserProfileEditDto input) { var user = await GetCurrentUserAsync(); input.MapTo(user); CheckErrors(await UserManager.UpdateAsync(user)); if (Clock.SupportsMultipleTimezone) { if (input.Timezone.IsNullOrEmpty()) { var defaultValue = await _timeZoneService.GetDefaultTimezoneAsync(SettingScopes.User, AbpSession.TenantId); await SettingManager.ChangeSettingForUserAsync(AbpSession.ToUserIdentifier(), TimingSettingNames.TimeZone, defaultValue); } else { await SettingManager.ChangeSettingForUserAsync(AbpSession.ToUserIdentifier(), TimingSettingNames.TimeZone, input.Timezone); } } }
public async Task <string> UpdateCurrentUserProfile(CurrentUserProfileEditDto input) { try { using (CurrentUnitOfWork.DisableFilter(AbpDataFilters.MayHaveTenant)) { if (!string.IsNullOrEmpty(input.EmailAddress) && UserManager.Users.Any(x => x.EmailAddress == input.EmailAddress)) { return("email_da_co"); } } var user = await GetCurrentUserAsync(); input.MapTo(user); CheckErrors(await UserManager.UpdateAsync(user)); if (Clock.SupportsMultipleTimezone) { if (input.Timezone.IsNullOrEmpty()) { var defaultValue = await _timeZoneService.GetDefaultTimezoneAsync(SettingScopes.User, AbpSession.TenantId); await SettingManager.ChangeSettingForUserAsync(AbpSession.ToUserIdentifier(), TimingSettingNames.TimeZone, defaultValue); } else { await SettingManager.ChangeSettingForUserAsync(AbpSession.ToUserIdentifier(), TimingSettingNames.TimeZone, input.Timezone); } } return("ok"); } catch (System.Exception ex) { throw ex; } }
public MySettingsViewModel(CurrentUserProfileEditDto currentUserProfileEditDto) { currentUserProfileEditDto.MapTo(this); }