public void UpdateUser(string userId, string firstName, string lastName, string email, string role, string roleEntityValue) { string userName = firstName.ToLower() + "." + lastName.ToLower(); AccountProfile profile; if (!string.IsNullOrEmpty(userId)) { profile = new AccountProfile(UserEntitiesDataFactory.GetUser(Guid.Parse(userId)).UserName); UserEntitiesDataFactory.UpdateUser(userId, email); UserEntitiesDataFactory.UpdateRole(userId, role); } else { if (UserEntitiesDataFactory.IsUserExits(userName)) { userName = UserEntitiesDataFactory.GetUsername(userName); } userId = UserEntitiesDataFactory.CreateUserWithRoles(userName, email, role).ToString(); profile = new AccountProfile(userName); } profile.FirstName = firstName; profile.LastName = lastName; profile.RoleEntityValue = roleEntityValue; }
public UserModel(Guid userId) { user = Membership.GetUser(userId); profile = new AccountProfile(UserName); }