Esempio n. 1
0
        public Employee RetrieveEmployeeByEmail(string email)
        {
            Employee _employee = null;

            try
            {
                _employee = EmployeeAccessor.RetrieveEmployeeWithEmail(email);
            }
            catch (Exception ex)
            {
                throw ex;
            }

            return(_employee);
        }
Esempio n. 2
0
        public Employee AuthenticateEmpLogin(string email, string password)
        {
            Employee _employee = null;

            try
            {
                if (1 == EmployeeAccessor.VerifyEmpLoginInfo(email, password))
                {
                    password = null;

                    _employee = EmployeeAccessor.RetrieveEmployeeWithEmail(email);
                }
                else
                {
                    throw new ApplicationException("An error has occurred.");
                }
            }
            catch (Exception)
            {
                throw new ApplicationException("Incorrect email or password.");
            }

            return(_employee);
        }