public void DeleteUserAccount(Guid id) { if (UserAccounts.ContainsKey(id)) { UserAccounts.Remove(id); } }
public List <AwardItem> GetAwardsForUser(Guid userAccountId) { if (!UserAccounts.ContainsKey(userAccountId)) { return(new List <AwardItem>()); } return(UserAccounts[userAccountId].Profiles.SelectMany(up => up.Awards).ToList()); }
public void DeleteProfile(Guid profileId, Guid userAccountId) { if (!UserAccounts.ContainsKey(userAccountId)) { return; } UserAccounts[userAccountId].DeleteProfile(profileId); }
public UserProfile AddNewUserProfileToAccount(Guid userAccountId, Guid clientId, string emailAddress, List <AwardItem> awards = null) { if (!UserAccounts.ContainsKey(userAccountId) || !ClientAccounts.ContainsKey(clientId)) { return(null); } var clientAccount = ClientAccounts[clientId]; var newProfile = new UserProfile().CreateUserProfile(Guid.NewGuid(), emailAddress, clientAccount, awards); UserAccounts[userAccountId].AddProfile(newProfile); return(newProfile); }
public UserAccount UpdateUserAccount(Guid id, string firstName, string lastName, string username, string password = null) { if (!UserAccounts.ContainsKey(id)) { return(null); } var updatedAccount = new UserAccount().CreateAccount(id, firstName, lastName, username, password); var userAccount = UserAccounts[id]; userAccount.UpdateAccount(updatedAccount, password); return(userAccount); }
public UserAccount GetUserAccountById(Guid id) { return(UserAccounts.ContainsKey(id) ? UserAccounts[id] : null); }