示例#1
0
        private static Company.CompanyBase GetCompany(CompanyType companyType)
        {
            #region 实例化
            Company.CompanyBase company = null;
            switch (companyType)
            {
            case CompanyType.支付宝:
                company = new Company.Alipay.AlipayCompany();
                break;

            case CompanyType.财付通:
                company = new Company.Tenpay.TenpayCompany();
                break;

            case CompanyType.银联托管:
                company = new Business.OnlinePay.Company.ChinaPay.ChinaPayCompany();
                break;

            case CompanyType.快钱:
                company = new Business.OnlinePay.Company.Bill99.Bill99Company();
                break;

            case CompanyType.连连:
                company = new Business.OnlinePay.Company.Lianlian.LianlianCompany();
                break;

            case CompanyType.汇付天下:
                company = new Business.OnlinePay.Company.Chinapnr.ChinapnrCompany();
                break;
                //case CompanyType.UMPayBank:
                //    company = new Company.UMpay.UMCompanyBank();
                //    break;
                throw new Exception("错误的CompanyType");
            }

            if (company == null)
            {
                throw new Exception("实例化company错误");
            }
            return(company);

            #endregion
        }
示例#2
0
        private static Company.CompanyBase GetCompany(CompanyType companyType)
        {
            #region 实例化
            Company.CompanyBase company = null;
            switch (companyType)
            {
                case CompanyType.支付宝:
                    company = new Company.Alipay.AlipayCompany();
                    break;
                case CompanyType.财付通:
                    company = new Company.Tenpay.TenpayCompany();
                    break;
                case CompanyType.银联托管:
                    company = new Business.OnlinePay.Company.ChinaPay.ChinaPayCompany();
                    break;
                case CompanyType.快钱:
                    company = new Business.OnlinePay.Company.Bill99.Bill99Company();
                    break;
                case CompanyType.连连:
                    company = new Business.OnlinePay.Company.Lianlian.LianlianCompany();
                    break;
                case CompanyType.汇付天下:
                    company = new Business.OnlinePay.Company.Chinapnr.ChinapnrCompany();
                    break;
                //case CompanyType.UMPayBank:
                //    company = new Company.UMpay.UMCompanyBank();
                //    break;
                    throw new Exception("错误的CompanyType");
            }

            if (company == null)
                throw new Exception("实例化company错误");
            return company;

            #endregion
        }