예제 #1
0
        public async Task <IActionResult> UpdateClientSetting(UpdateClientSettingAddressModel model)
        {
            var currentUser = await GetKahlaUser();

            if (model.ThemeId.HasValue)
            {
                currentUser.ThemeId = model.ThemeId ?? 0;
            }
            if (model.EnableEmailNotification.HasValue)
            {
                currentUser.EnableEmailNotification = model.EnableEmailNotification == true;
            }
            if (model.EnableEnterToSendMessage.HasValue)
            {
                currentUser.EnableEnterToSendMessage = model.EnableEnterToSendMessage == true;
            }
            if (model.EnableInvisiable.HasValue)
            {
                currentUser.EnableInvisiable = model.EnableInvisiable == true;
            }
            if (model.MarkEmailPublic.HasValue)
            {
                currentUser.MarkEmailPublic = model.MarkEmailPublic == true;
            }
            if (model.ListInSearchResult.HasValue)
            {
                currentUser.ListInSearchResult = model.ListInSearchResult == true;
            }
            await _userManager.UpdateAsync(currentUser);

            return(this.Protocol(ErrorType.Success, "Successfully update your client setting."));
        }
예제 #2
0
        public async Task <IActionResult> UpdateClientSetting(UpdateClientSettingAddressModel model)
        {
            var currentUser = await GetKahlaUser();

            currentUser.ThemeId = model.ThemeId;
            await _userManager.UpdateAsync(currentUser);

            return(this.Protocol(ErrorType.Success, "Successfully update your client setting."));
        }
예제 #3
0
        public async Task <IActionResult> UpdateClientSetting(UpdateClientSettingAddressModel model)
        {
            var currentUser = await GetKahlaUser();

            if (model.ThemeId != null)
            {
                currentUser.ThemeId = model.ThemeId ?? 0;
            }
            if (model.EnableEmailNotification != null)
            {
                currentUser.EnableEmailNotification = model.EnableEmailNotification ?? false;
            }
            await _userManager.UpdateAsync(currentUser);

            return(this.Protocol(ErrorType.Success, "Successfully update your client setting."));
        }