Esempio n. 1
0
        public async Task UpdateCurrentUserProfile(CurrentUserProfileEditDto input)
        {
            var user = await GetCurrentUserAsync();

            input.MapTo(user);
            CheckErrors(await UserManager.UpdateAsync(user));
        }
Esempio n. 2
0
        public async Task UpdateCurrentUserProfile(CurrentUserProfileEditDto input)
        {
            User currentUserAsync = await this.GetCurrentUserAsync();

            input.MapTo <CurrentUserProfileEditDto, User>(currentUserAsync);
            this.CheckErrors(await this.UserManager.UpdateAsync(currentUserAsync));
        }
Esempio n. 3
0
        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);
                }
            }
        }
Esempio n. 4
0
        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;
            }
        }
Esempio n. 5
0
 public MySettingsViewModel(CurrentUserProfileEditDto currentUserProfileEditDto)
 {
     currentUserProfileEditDto.MapTo(this);
 }