public void EditUserPersonalData(long userId, PersonalData personalData) { UserAccount userAccount = UserInformationService.GetUserAccountById(userId); userAccount.PersonalData.FirstName = personalData.FirstName; userAccount.PersonalData.LastName = personalData.LastName; userAccount.PersonalData.PESEL = personalData.PESEL; userAccount.PersonalData.PhoneNumber = personalData.PhoneNumber; userAccount.PersonalData.Address.Street = personalData.Address.Street; userAccount.PersonalData.Address.PostalCode = personalData.Address.PostalCode; userAccount.PersonalData.Address.City = personalData.Address.City; userAccount.PersonalData.Address.Country = personalData.Address.Country; AccountAdministrationService.SaveOrUpdateUser(userAccount); }
public void ChangePassword(long userAccountId, string oldPassword, string newPassword) { UserAccount userAccount = UserInformationService.GetUserAccountById(userAccountId); if (userAccount.Password != AuthorizationService.EncryptPassword(oldPassword)) { //PASSWORD DOES NOT MATCH } else { userAccount.Password = AuthorizationService.EncryptPassword(newPassword); AccountAdministrationService.SaveOrUpdateUser(userAccount); } }