Example #1
0
        public static string GetCode(string email, UserAccountTypes userType)
        {
            IUserAccountDAL userAccountDB;

            switch (userType)
            {
            case UserAccountTypes.Employee:
                userAccountDB = new EmployeeUserAccountDAL(connectionstring);
                break;

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

            default:
                throw new Exception("usertype is not valid");
            }
            return(userAccountDB.GetCode(email));
        }