public Identity(UserEntity user) { if (user == null) { Login = "******"; return; } Id = user.Id; Login = user.Login; Email = user.Email; }
public void Post(User value) { var temp = users.GetById(value.Id); var userForUpdate = new UserEntity() { Id = temp.Id, Email = (value.Email != null ? value.Email : temp.Email), Login = (value.Login != null ? value.Login : temp.Login), Password = (value.Password != null ? value.Password : temp.Password), Photo = (value.Photo != null ? value.Photo : temp.Photo) }; users.Edit(userForUpdate); }
/// <summary> /// create new user /// </summary> /// <returns>null if user exist</returns> public static UserEntity CreateUser(string login, string email, string password, string Photo) { var users = (IUserService)System.Web.Mvc.DependencyResolver.Current.GetService(typeof(IUserService)); UserEntity membershipUser = null; if (null == FindUser(login, email)) { UserEntity user = new UserEntity() { Login = login, Email = email, Password = Crypto.HashPassword(password), Photo = Photo }; users.Add(user); membershipUser = user; } return membershipUser; }
public RoleEntity GetUserRole(UserEntity user) { return _roleRepository.GetById(user.RoleID).ToBLLRole(); }
public void CreateUser(UserEntity user) { _userRepository.CreateUser(user.ToDALUser()); }