@Override
    public boolean login(String name, char[] password) {
        
        CustomerInfo customerInfo;
        try {
            customerInfo = ViewController.getInstance().getCustomerInfoJpaController().findCustomerInfoByEmailAddress(name);
            if (!Arrays.equals(customerInfo.getMasterPassword().toCharArray(), password)) {
                return false;
            }
            ViewController.getInstance().login(customerInfo);
            return true;
        } catch (Exception e) {
            e.printStackTrace();
            try {
                customerInfo = ViewController.getInstance().getCustomerInfoJpaController().findCustomerInfoByPhoneNumber(name);
                if (!Arrays.equals(customerInfo.getMasterPassword().toCharArray(), password)) {
                    return false;
                }
                ViewController.getInstance().login(customerInfo);
                return true;
            } catch (Exception ee) {
                ee.printStackTrace();
                return false;
            }
        }
    }