Esempio n. 1
0
        private void CallbackRefreshTables(AsyncCallbackState callbackState)
        {
            var             data           = (Tuple <IDBProvider, IConnectionInfo>)callbackState.State;
            IDBProvider     dbProvider     = data.Item1;
            IConnectionInfo connectionInfo = data.Item2;

            if (dbProvider.IsConnected)
            {
                dbProvider.Disconnect();
            }

            bool connectResult = dbProvider.Connect(connectionInfo);

            if (connectResult)
            {
                Server   server       = new Server(connectionInfo.ServerName);
                Database database     = new Database(connectionInfo.DatabaseName, server);
                bool     refresResult = dbProvider.Refresh(database, LoadingMode.RecursiveAllLevels);

                if (refresResult)
                {
                    callbackState.InvokeOnUI(delegate(object state)
                    {
                        Database db = (Database)state;

                        PopulateTables(db);
                    }, database);
                }
            }
        }
Esempio n. 2
0
        private void LoadImplementationAssembly()
        {
            string currentDir = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            string implementationFileFullPath = Path.Combine(currentDir, IMPLEMENTATION_ASSEMBLY_FILE_NAME);

            if (!string.IsNullOrEmpty(mock_implementationFileFolder))
            {
                implementationFileFullPath = Path.Combine(mock_implementationFileFolder, IMPLEMENTATION_ASSEMBLY_FILE_NAME);
            }
            //implementationAssembly = AppDomain.CurrentDomain.Load(IMPLEMENTATION_ASSEMBLY_NAME);
            implementationAssembly = Assembly.LoadFrom(implementationFileFullPath);

            if (implementationAssembly == null)
            {
                throw new FileNotFoundException(string.Format("Could not find file for implemetation assembly '{0}'", IMPLEMENTATION_ASSEMBLY_NAME));
            }

            var providerRegisterAttribute =
                this.implementationAssembly.GetCustomAttributes(typeof(DBProviderRegisterAttribute), false).Cast <DBProviderRegisterAttribute>().SingleOrDefault();

            if (providerRegisterAttribute == null)
            {
                throw new TypeLoadException(string.Format("Could not find assembly attribute of type '{0}'!", typeof(DBProviderRegisterAttribute).FullName));
            }

            implementationProvider = (IDBProvider)Activator.CreateInstance(providerRegisterAttribute.Type);
        }
Esempio n. 3
0
        static private void ShowConfigCenter(string serverName, IDBProvider dbHelper, ILoginUser loginUser)
        {
            BaseSet bs = new BaseSet(serverName, dbHelper, loginUser);

            //显示字典管理
            bs.ShowConfigCenter(null);
        }
Esempio n. 4
0
        public FilesKeeperForm()
        {
            InitializeComponent();
            var connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["DefaultConnection"].ConnectionString;

            DataBaseProvider = new SQLiteProvider(connectionString);
        }
Esempio n. 5
0
        private DataBasePool()
        {
            using (RisDAL dal = new RisDAL())
            {
                dataBaseType = dal.DriverClassName;
            }
            //string filePath = Environment.SystemDirectory + "/Oam-provider.xml";
            //if (!File.Exists(filePath))
            //{
            //    throw new OamException("Can't find the configuration file Oam-provider.xml in system directory.");
            //}

            //FileStream stream = new FileStream(filePath, FileMode.Open, FileAccess.Read);
            ////Load the MemoryStream to XmlDocument
            //XmlDocument xmlProvider = new XmlDocument();
            //xmlProvider.Load(stream);

            //XmlNode node = xmlProvider.SelectSingleNode("/Oam-provider/DBProvider");
            //foreach(XmlAttribute x in node.Attributes)
            //{
            //    if(x.Name.Equals("driverClassName"))
            //    {
            //        string dbProviderType = x.Value;
            //        Type type = Type.GetType(dbProviderType);
            //        dbProvider = Activator.CreateInstance(type) as IDBProvider;
            //        break;
            //    }
            //}

            //stream.Close();
            string dbProviderType = "Server.DAO.Oam.Impl." + dataBaseType + "Provider";
            Type   type           = Type.GetType(dbProviderType);

            dbProvider = Activator.CreateInstance(type) as IDBProvider;
        }
Esempio n. 6
0
        public bool ShowLogin(string command, IVerify defaultVerify, bool allowThirdVerify, DelegateBusinessVerify businessVerify)
        {
            frmLogin loginWindow = new frmLogin(defaultVerify, allowThirdVerify, businessVerify);

            //login.TopMost = true;

            if (string.IsNullOrEmpty(_title) == false)
            {
                loginWindow.Text = _title;
            }

            loginWindow.ShowDialog();

            if (loginWindow.DBProvider == null)
            {
                return(false);
            }

            _dbHelper   = loginWindow.DBProvider;
            _loginUser  = loginWindow.LoginUser;
            _serverName = loginWindow.ServerName;


            return(true);
        }
Esempio n. 7
0
 public TaskRepository(IDBProvider dbProvider)
 {
     connectionString = System.Configuration.ConfigurationManager
                        .ConnectionStrings["TaskDB"].ConnectionString;
     _dbProvider = dbProvider;
     _dbProvider.DeployOrUpdateDB(connectionString);
 }
Esempio n. 8
0
        internal BaseRepository(IDBProvider <IMongoDatabase> databaseProvider)
        {
            Ensure.Any.IsNotNull(databaseProvider, nameof(databaseProvider));

            _databaseProvider = databaseProvider;
            _collectionLocal  = new Lazy <IMongoCollection <T> >(() => GetCollection(), true);
        }
Esempio n. 9
0
 public MetricsLogger(IDBProvider dbProvider)
 {
     _provider      = dbProvider;
     _writeApi      = dbProvider.GetWriteApi();
     _writeApiAsync = dbProvider.GetWriteApiAsync();
     _tasks         = new List <Task>();
 }
Esempio n. 10
0
        //private static object _sync = new object();

        public ConnectionScope(bool tx = true, string connStringOverride = null, int?timeoutOverride = null)
        {
            _provider           = DBService.DefaultProvider;
            _connStringOverride = connStringOverride;
            TimeoutOverride     = timeoutOverride;
            IsTransactional     = tx;
        }
Esempio n. 11
0
        public frmMainConfig(string serverName, IDBProvider dbHelper, ILoginUser loginUser)
        {
            InitializeComponent();

            _serverName = serverName;
            _dbHelper   = dbHelper;
            _loginUser  = loginUser;
        }
Esempio n. 12
0
 private static void DatabaseInitialize(IDBProvider dbContext)
 {
     dbContext.CreateTable <Word>();
     //dbContext.Insert(new Word() { Key = "Attribute", PrefixKey = "A", Type = Common.Enums.WordType.Adjective, Description = "Özellik", Id = Guid.NewGuid().ToString() });
     //dbContext.Insert(new Word() { Key = "Beta", PrefixKey = "B", Type = Common.Enums.WordType.Verb, Description = "Test", Id = Guid.NewGuid().ToString() });
     //dbContext.Insert(new Word() { Key = "Case", PrefixKey = "C", Type = Common.Enums.WordType.Noun, Description = "Şart", Id = Guid.NewGuid().ToString() });
     //dbContext.Insert(new Word() { Key = "Akinon", PrefixKey = "A", Type = Common.Enums.WordType.Adverb, Description = "Şirket", Id = Guid.NewGuid().ToString() });
 }
Esempio n. 13
0
        public MainWindow()
        {
            InitializeComponent();

            _dbProvider = new DBProvider();

            loginBtn.Click += LoginBtn_Click;
        }
Esempio n. 14
0
        //private:
        IEnumerable <IDataRow> YieldData(int[] indices)
        {
            IDBProvider dp = m_tblManager.GetDataProvider(m_tableID);

            foreach (int ndx in indices)
            {
                yield return(dp.Get(ndx));
            }
        }
Esempio n. 15
0
        public DBProvider(DBProvider srcData, Predicate <IDataRow> filter,
                          AggregationMode_t mode = AggregationMode_t.Rejected)
        {
            Assert(srcData != null);
            Assert(filter != null);

            m_src    = srcData;
            m_mapper = new ProviderMapper <IDataRow>(srcData, filter, mode);
        }
Esempio n. 16
0
        public UploadFileForm(IDBProvider dBProvider)
        {
            _DBProvider = dBProvider;

            InitializeComponent();
            ErrorProvider.SetIconPadding(PathTextBox, -20);
            ErrorProvider.SetIconPadding(NameTextBox, -20);
            BackgroundUploader.DoWork += BackgroundUploader_DoWork;
        }
Esempio n. 17
0
        void LoadData()
        {
            IDBProvider dp = m_tblManager.GetDataProvider(m_tableID);

            for (int ndx = 0; ndx < dp.Count; ++ndx)
            {
                m_dataIndices.Add((dp.Get(ndx) as IDataRow).ID, ndx);
            }
        }
Esempio n. 18
0
 private DataBasePool()
 {
     //KodakDAL dataAccess = new KodakDAL();
     using (var dataAccess = new RisDAL())
     {
         string dbProviderType = "Server.DAO.QualityControl.Impl." + dataAccess.DriverClassName + "Provider";
         Type   type           = Type.GetType(dbProviderType);
         dbProvider = Activator.CreateInstance(type) as IDBProvider;
     }
 }
Esempio n. 19
0
 private DataBasePool()
 {
     using (RisDAL dataAccess = new RisDAL())
     {
         dataBaseType = dataAccess.DriverClassName;
         string dbProviderType = "Server.DAO.Templates.Impl." + dataAccess.DriverClassName + "Provider";
         Type   type           = Type.GetType(dbProviderType);
         dbProvider = Activator.CreateInstance(type) as IDBProvider;
     }
 }
Esempio n. 20
0
        public BoxesWindow()
        {
            InitializeComponent();

            _dbProvider = new DBProvider();

            uiAddBoxBtn.Click += UiAddBoxBtn_Click;

            Refresh();
        }
Esempio n. 21
0
        static void Main(string[] args)
        {
            CommandLine.Parser.Default.ParseArguments <Options>(args)
            .WithParsed(o =>
            {
                IDBProvider provider = default(IDBProvider);

                if (!string.IsNullOrEmpty(o.SQLite))
                {
                    Helpers.Log($"Using SQLite database provider at {o.SQLite}", ConsoleColor.Green);

                    provider = new Sqlite(o.SQLite, o.EmptySQLite);
                }

                if (!string.IsNullOrEmpty(o.Mongo))
                {
                    Helpers.Log($"Using Mongo with connection string: {o.Mongo}", ConsoleColor.Green);

                    provider = new Mongo(o.Mongo);
                }

                if (provider == default(IDBProvider))
                {
                    Helpers.Log("No DB provider specified! See --help", ConsoleColor.Red);

                    return;
                }

                var rp = new RemoteProvider(provider);

                if (!string.IsNullOrEmpty(o.GenKey))
                {
                    var dateEnd = DateParser.Parse(o.GenKey);

                    if (dateEnd == default(DateTime) || DateTime.Now > dateEnd)
                    {
                        Helpers.Log($"{o.GenKey} is not a valid time duration", ConsoleColor.Red);

                        return;
                    }

                    var duration = dateEnd - DateTime.Now;

                    rp.GenerateKey(duration);
                }
                else
                {
                    rp.Start(o.Port);

                    Helpers.Log($"Server listening on port {o.Port}", ConsoleColor.Green);

                    Process.GetCurrentProcess().WaitForExit();
                }
            });
        }
        public RemoteProvider(IDBProvider db)
        {
            var socket = new NLCSocket(true, Helpers.GenerateSelfSignedCert("nalp", "localhost"));

            DB = db;

            server = new Server <SharedClass>(socket);
            server.OnServerClientConnected    += (x, y) => Helpers.Log($"NLC: Client {y.Client} connected!", ConsoleColor.Green);
            server.OnServerClientDisconnected += (x, y) => Helpers.Log($"NLC: Client {y.Client} disconnected!", ConsoleColor.Yellow);
            server.OnServerExceptionOccurred  += (x, y) => Helpers.Log($"NLC: Exception Occured! {y.Exception}", ConsoleColor.Red);
        }
Esempio n. 23
0
        void UnregisterHandlers()
        {
            IDBProvider dp = m_tblManager.GetDataProvider(m_tableID);

            dp.DatumInserted  -= DataProvider_DatumInserted;
            dp.DatumDeleted   -= DataProvider_DatumDeleted;
            dp.DatumReplaced  -= DataProvider_DatumReplaced;
            dp.DatumDeleting  -= DataProvider_DatumDeleting;
            dp.DataDeleting   -= DataProvider_DataDeleting;
            dp.DatumReplacing -= DataProvider_DatumReplacing;
            dp.SourceCleared  -= DataProvider_SourceCleared;
        }
Esempio n. 24
0
 /// <summary>
 /// 設定DB連線方式
 /// </summary>
 /// <param name="DBProvider"></param>
 /// <param name="ConnectionString"></param>
 /// <param name="Logger"></param>
 /// <param name="DefaultTimeout"></param>
 protected DBConnector(IDBProvider pDBProvider, string pConnectionString, ILog pLogger, int?pDefaultTimeout)
 {
     this.RESPONSE_MSG = new RESPONSE_MSG();
     if (pDBProvider == null)
     {
         throw new ArgumentNullException("DBProvider");
     }
     this.dbProvider       = pDBProvider;
     this.connectionString = pConnectionString;
     this.defaultTimeout   = pDefaultTimeout;
     this.logger           = pLogger;
 }
Esempio n. 25
0
        public SaveFileForm(IDBProvider dBProvider, FileModel saveFile)
        {
            InitializeComponent();

            _DBProvider = dBProvider;
            _FileToSave = saveFile;

            ErrorProvider.SetIconPadding(PathTextBox, -20);
            ErrorProvider.SetIconPadding(NameTextBox, -20);
            NameTextBox.Text           = _FileToSave.Name;
            NameTextBox.TextChanged   += NameTextBox_TextChanged;
            BackgroundUploader.DoWork += BackgroundUploader_DoWork;
        }
Esempio n. 26
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposedValue)
            {
                if (disposing)
                {
                    _idbProvider.Dispose();
                    _idbProvider = null;
                }

                disposedValue = true;
            }
        }
Esempio n. 27
0
        static public IDBQuery GetLocalDBHelper(string dbServerAlias, IDBQuery dbSys, ref string strErr)
        {
            strErr = "";

            if (string.IsNullOrEmpty(dbServerAlias))
            {
                return(dbSys);
            }

            if (_sm == null)
            {
                _sm = new ServerManager();
                _sm.LoadFromFile();
            }

            ServerInfo si = _sm.FindAlias(dbServerAlias);


            if (si == null)
            {
                strErr = "未找到对应的服务器配置信息。";
                return(null);
            }

            if (string.IsNullOrEmpty(si.ServerDriverFile))
            {
                strErr = "未配置数据访问程序集。";
                return(null);
            }

            IDBProvider dbProvider = ServerEnum.GetDBProvider(si.ServerDriverFile);

            if (dbProvider == null)
            {
                strErr = "数据访问实例 [" + si.ServerDriverFile + "] 创建失败。";
                return(null);
            }


            dbProvider.Init(si.ServerIP, si.ServerPort, si.ServerInstance, si.GrantAccount, si.GrantPwd);

            IDbConnection dc = dbProvider.Open(ref strErr);

            if (dc == null)
            {
                strErr = "数据服务访问失败:" + strErr;
                return(null);
            }

            return(dbProvider);
        }
Esempio n. 28
0
        private void butVerify_Click(object sender, EventArgs e)
        {
            try
            {
                if (string.IsNullOrEmpty(txtAssembly.Text))
                {
                    MessageBox.Show("未指定对应的服务驱动文件,不能进行验证。", "提示");
                    return;
                }
                string modulePath = System.Windows.Forms.Application.StartupPath + @"\" + txtAssembly.Text;

                IDBProvider dbProvide = null;
                if (File.Exists(modulePath) == true)
                {
                    FileInfo fi = new FileInfo(modulePath);

                    string   assemblyName = fi.Name.Replace(fi.Extension, "");
                    string[] tmp          = ("..." + assemblyName).Split('.');
                    string   objName      = tmp[tmp.Length - 1];

                    dbProvide = (IDBProvider)Assembly.LoadFile(modulePath).CreateInstance(assemblyName + "." + objName);
                }

                if (dbProvide != null)
                {
                    dbProvide.Init(txtIp.Text, int.Parse(txtPort.Text), txtInstance.Text, txtUserAccount.Text, txtUserPwd.Text);

                    string        strError = "";
                    IDbConnection dc       = dbProvide.Open(ref strError);

                    if (dc == null)
                    {
                        MessageBox.Show("验证失败:" + strError, "提示");
                    }
                    else
                    {
                        MessageBox.Show("验证成功。", "提示");
                    }

                    return;
                }
                else
                {
                    MessageBox.Show("数据访问实例创建失败。", "提示");
                }
            }
            catch (Exception ex)
            {
                MsgBox.ShowException(ex, this);
            }
        }
 public bool SaveNote(Note note)
 {
     try
     {
         IDBProvider dbProvider = ProviderFactory.CreateNewDBProvider();
         dbProvider.SaveNote(note);
     }
     catch (Exception ex)
     {
         Console.WriteLine(@"There is an error:" + ex.Message);
         return(false);
     }
     return(true);
 }
 public bool AddNewUser(User user)
 {
     try
     {
         IDBProvider dbProvider = ProviderFactory.CreateNewDBProvider();
         dbProvider.AddUser(user);
     }
     catch (Exception ex)
     {
         Console.WriteLine(@"There is an error:" + ex.Message);
         return(false);
     }
     return(true);
 }
Esempio n. 31
0
 private void CreateCasinoBonusAccounts(IDBProvider dbInstance,
     List<string> typeCurrencyList, VendorID vendorOwnerID, long userID, string currency)
 {
     CreateVendorAccount(dbInstance, typeCurrencyList, vendorOwnerID, userID, currency, AccountType.BonusGranted);
     CreateVendorAccount(dbInstance, typeCurrencyList, vendorOwnerID, userID, currency, AccountType.BonusWagered);
     CreateVendorAccount(dbInstance, typeCurrencyList, vendorOwnerID, userID, currency, AccountType.BonusCashout);
     CreateVendorAccount(dbInstance, typeCurrencyList, vendorOwnerID, userID, currency, AccountType.BonusForfeitedBonus);
     CreateVendorAccount(dbInstance, typeCurrencyList, vendorOwnerID, userID, currency, AccountType.BonusForfeitedDeposit);
     CreateVendorAccount(dbInstance, typeCurrencyList, vendorOwnerID, userID, currency, AccountType.BonusForfeitedWins);
     CreateVendorAccount(dbInstance, typeCurrencyList, vendorOwnerID, userID, currency, AccountType.BonusExpiredBonus);
     CreateVendorAccount(dbInstance, typeCurrencyList, vendorOwnerID, userID, currency, AccountType.BonusExpiredDeposit);
     CreateVendorAccount(dbInstance, typeCurrencyList, vendorOwnerID, userID, currency, AccountType.BonusExpiredWins);
     CreateVendorAccount(dbInstance, typeCurrencyList, vendorOwnerID, userID, currency, AccountType.BonusExceededMaxWins);
 }
Esempio n. 32
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;
                }
            }
        }
Esempio n. 33
0
 private void CreateVendorAccount(IDBProvider dbInstance,
     List<string> typeCurrencyList, VendorID vendorOwnerID, long userID, string currency, AccountType newType)
 {
     if (!typeCurrencyList.Contains(string.Format("{0}_{1}", (int)newType, currency)))
     {
         Entity<AccountRec>.Insert(dbInstance.Get,
             new AccountRec()
             {
                 Type = newType,
                 UserID = userID,
                 Balance = 0,
                 Currency = currency,
                 VendorID = VendorID.System,
                 VendorOwnerID = vendorOwnerID,
                 ActiveStatus = ActiveStatus.Active
             });
     }
 }
Esempio n. 34
0
 public DBConnection(IDBProvider dbProvider, string ConnectionString)
 {
     this.CommandTimeout = 30;
     this._dbProvider = dbProvider;
     _conn = (System.Data.IDbConnection)_dbProvider.CreateConnection(ConnectionString);
 }
 /// <summary>
 /// Gets database  transaction associated with the given connection string. This is the actual database transaction that is to be
 /// shared for all communication with this database.
 /// </summary>
 internal IDbTransaction GetDbTransaction(string connectionString, IDBProvider dbProvider)
 {
     // if this in not the real transaction, forward the call to real transaction
     if (this.realGlobalTransaction == null)
     {
         if (!this.openTransactions.ContainsKey(connectionString))
         {
             IDbConnection connection = dbProvider.CreateConnection(connectionString);
             connection.Open();
             this.openTransactions.Add(connectionString, connection.BeginTransaction());
         }
         return this.openTransactions[connectionString];
     }
     else
     {
         return this.realGlobalTransaction.GetDbTransaction(connectionString, dbProvider);
     }
 }