Exemple #1
0
        private void InstallVendor(IDBProvider dbInstance, VendorID vendorID,
            Dictionary<VendorID, VendorRec> vendorSetup)
        {
            //create vendor
            var vendorRec = dbInstance._<VendorAccessor>().Vendor(vendorID);
            if (vendorRec == null)
            {
                //user
                UserRec urec = new UserRec()
                {
                    Type = UserType.Vendor,
                    UserName = ((int)vendorID).ToString(),
                    Password = "******",
                    DisplayName = "n/a",
                    ActiveStatus = ActiveStatus.Active,
                    Email = string.Format("{0}@noemail.com", Util.Crypto.GenGuid()), //hack to avoid unique email constraint error
                };
                Entity<UserRec>.Insert(dbInstance.Get, urec);

                //vendor
                vendorRec = vendorSetup[vendorID];
                vendorRec.UserID = urec.ID;
                Entity<VendorRec>.Insert(dbInstance.Get, vendorRec);
            }

            //get vendor userid
            long userID = vendorRec.UserID;

            //get vendor account type list
            List<string> tcl = dbInstance._<AccountAccessor>().AccountTypeCurrencyList(userID);

            //create accounts
            foreach (var c in SP.CurrencyProvider.GetSupportedCurrencyList())
            {
                CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Ordinary);
                CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Fee);

                //specific
                switch (vendorID)
                {
                    case VendorID.System:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Compensation);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.ChargeBack);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TestFunds);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.SDA);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Others);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.SA);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.ChipDumping);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.RecoveredFunds);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Adjustment);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.GoodWill);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.PaymentFee);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.DoubleFundsCorrection);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.PaymentsToInternational);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.CashDesk);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.FraudFunds);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.InactiveAccountFee);
                        break;

                    case VendorID.NetEnt:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.CasinoFPP);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.OddsMatrix:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.CakeNetwork:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Prize);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.RakeBack);
                        break;

                    case VendorID.GutsGames:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        break;

                    case VendorID.Affiliate:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.AffiliateFee);
                        break;

                    case VendorID.ViG:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        break;

                    case VendorID.OnGame:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Prize);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.RakeBack);
                        break;

                    case VendorID.BingoNetwork:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Prize);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.RakeBack);
                        CreateCasinoBonusAccounts(dbInstance, tcl, vendorID, userID, c);
                        break;

                    case VendorID.Microgaming:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        break;

                    case VendorID.IGT:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.MergeNetwork:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        break;

                    case VendorID.CTXM:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.CasinoWallet:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.CasinoFPP);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.CashDesk);
                        CreateCasinoBonusAccounts(dbInstance, tcl, vendorID, userID, c);
                        break;

                    case VendorID.PlaynGO:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.XProGaming:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        break;

                    case VendorID.ENET:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        break;

                    case VendorID.IDM:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        break;

                    case VendorID.EverleafNetwork:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        break;

                    case VendorID.PACasino:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        break;

                    case VendorID.BetSoft:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.GreenTube:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.BuzzSports:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.PAClassic:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        break;

                    case VendorID.CasinoKlas:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        break;

                    case VendorID.Sheriff:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.CasinoSieger:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        break;

                    case VendorID.Norske:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        break;

                    case VendorID.OMI:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.EvolutionGaming:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;
                    case VendorID.ISoftBet:
                        //TODO: Clarify is that correct
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;
                    case VendorID.Ezugi:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;
                    case VendorID.EGB:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;
                    case VendorID.BetGames:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;
                    case VendorID.GTS:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.Vivo:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.OneXTwoGaming:
                        //TODO: Clarify is that correct
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.Lega:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.EGT:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.BetConstruct:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.BonusGranted);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.BonusCashout);
                        break;
                    case VendorID.Yggdrasil:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Bonus);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.TransferCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.Misc);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        break;

                    case VendorID.Bank:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.SDAdeposit);
                        goto case VendorID.PaymentTrust;
                    case VendorID.PaymentTrust:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WithdrawalCorrection);
                        goto default;
                    case VendorID.NYXGaming:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        goto default;
                    case VendorID.BallyGaming:
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.WalletCorrections);
                        goto default;

                    default: //other payment vendors
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.DepositCorrections);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.DepositCorrectionsNoFee);
                        CreateVendorAccount(dbInstance, tcl, vendorID, userID, c, AccountType.PaymentFee);
                        break;
                }
            }
        }