public Employee RetrieveEmployeeByEmail(string email) { Employee _employee = null; try { _employee = EmployeeAccessor.RetrieveEmployeeWithEmail(email); } catch (Exception ex) { throw ex; } return(_employee); }
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); }