コード例 #1
0
        public Identity(UserEntity user)
        {
            if (user == null)
            {
                Login = "******";
                return;
            }

            Id = user.Id;
            Login = user.Login;
            Email = user.Email;
        }
コード例 #2
0
 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);
 }
コード例 #3
0
        /// <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;
        }
コード例 #4
0
 public RoleEntity GetUserRole(UserEntity user)
 {
     return _roleRepository.GetById(user.RoleID).ToBLLRole();
 }
コード例 #5
0
 public void CreateUser(UserEntity user)
 {
     _userRepository.CreateUser(user.ToDALUser());
 }