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