Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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
     };
 }
Exemplo n.º 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 };
        }
Exemplo n.º 5
0
 private static bool PerformValidation(User user, RequestBase req)
 {
     return (user.Email == req.Login && user.Password == UserAssembler.GetHashedPassword(req.Password));
 }