예제 #1
0
 internal void UpdateEntity(User user, UserDTO userDto)
 {
     user.Address = userDto.Address;
     user.Email = userDto.Email;
     user.Name = userDto.Name;
     user.Phone = userDto.Phone;
     user.Rights = userDto.Rights;
 }
예제 #2
0
 internal void UpdateEntityUserLevel(User user, UserDTO userDto)
 {
     if (userDto.Address != null)
         user.Address = userDto.Address;
     if (userDto.Name != null)
         user.Name = userDto.Name;
     if (userDto.Password != null)
         user.Password = GetHashedPassword(userDto.Password);
     if (userDto.Phone >= 0)
         user.Phone = userDto.Phone;
 }
예제 #3
0
 public UserDTO ToSimpleDto(User user)
 {
     return new UserDTO
     {
         Email = user.Email,
         Name = user.Name,
         Address = user.Address,
         Phone = user.Phone,
         Rights = user.Rights,
         UserID = user.UserID,
         Password = string.Empty
     };
 }
예제 #4
0
        public void Initialize()
        {
            db = new PizzaUnitOfWork();
            admin = db.Users.Find("Admin");
            emp = db.Users.Find("Employee");
            customer = db.Users.Find("Customer");
            admin.Password = "******";
            emp.Password = "******";
            customer.Password = "******";

            adminRequest = new EmptyRequest { Login = admin.Email, Password = admin.Password };
            empRequest = new EmptyRequest { Login = emp.Email, Password = emp.Password };
            customerRequest = new EmptyRequest { Login = customer.Email, Password = customer.Password };
        }
예제 #5
0
 private static bool PerformValidation(User user, RequestBase req)
 {
     return (user.Email == req.Login && user.Password == UserAssembler.GetHashedPassword(req.Password));
 }