public bool Login(Oficiu oficiu, IObserver client) { bool validate = service.ValidateLogin(oficiu.ID, oficiu.Password); if (validate) { service.AddObserver(client); return(true); } return(false); }
public bool ValidateLogin(string user, string password) { Oficiu oficiu = oficiuRepository.FindOne(user); if (oficiu == null) { return(false); } else { return(oficiu.Password.Equals(password)); } }