public bool Login(Oficiu oficiu, IObserver client)
        {
            bool validate = service.ValidateLogin(oficiu.ID, oficiu.Password);

            if (validate)
            {
                service.AddObserver(client);
                return(true);
            }
            return(false);
        }
예제 #2
0
        public bool ValidateLogin(string user, string password)
        {
            Oficiu oficiu = oficiuRepository.FindOne(user);

            if (oficiu == null)
            {
                return(false);
            }
            else
            {
                return(oficiu.Password.Equals(password));
            }
        }