Example #1
0
        public static UserAccount Authenticate(string email, string password, UserAccountTypes userTypes)
        {
            IUserAccountDAL userAccountDB;

            switch (userTypes)
            {
            case UserAccountTypes.Employee:
                userAccountDB = new EmployeeUserAccountDAL(_connectionString);
                break;

            case UserAccountTypes.Customer:
                userAccountDB = new CustomerUserAccountDAL(_connectionString);
                break;

            default:
                return(null);
            }
            return(userAccountDB.Authenticate(email, password));
        }