コード例 #1
0
        public static void RestartConnection(int seconds)
        {
            if (quotesTableConId != 0 && tableQuotes != null)
            {
                tableQuotes.Close(quotesTableConId);
            }

            if (etsConnection != null)
            {
                etsConnection.Close();
            }

            tableQuotes   = null;
            etsConnection = null;

            // First variant of timing
            //Thread.Sleep(seconds * 1000);

            // Second variant
            DateTime curTime = DateTime.Now;
            DateTime newTime = curTime.AddSeconds(seconds);

            while (newTime <= DateTime.Now)
            {
            }
        }
コード例 #2
0
        // Клиенты
        public Boolean FillClientData()
        {
            AppJournal.Write("DataManager", "Trying open client table");

            tableSettlPair         = new DSSERVERLib.Online();
            clientData             = new ObservableCollection <SettlPair>();
            tableSettlPair.AddRow += TableClientsAddRow;

            lastAddRowTime = DateTime.Now.AddDays(1);

            try
            {
                connectionType = tableSettlPair.Open(DSSERVERLib.ConnectionType.RTSONL_DYNAMIC, "SettlPair", "id, firm_name, settl_pair", "id", null, null, DSSERVERLib.Sort.RTSONL_SORT_EMPTY);
            }
            catch (Exception ex)
            {
                AppJournal.Write("DataManager", "Opening table err: " + ex.ToString());
                MessageBox.Show("Ошибка доступа к таблице Workstation!");
            }

            if (connectionType == 0)
            {
                return(false);
            }
            else
            {
                LoadTimeManagement();
                return(true);
            }
        }
コード例 #3
0
        // Котировки
        private void FillQuotesData()
        {
            AppJournal.Write("Order", "Trying open quotes table");

            tableQuotes         = new DSSERVERLib.Online();
            tableQuotes.AddRow += TableQuotesAddRow;

            try {
                tableQuotes.Open(DSSERVERLib.ConnectionType.RTSONL_DYNAMIC, "Quote", "issue_name, price, moment, firm_name", "id", null, null, DSSERVERLib.Sort.RTSONL_SORT_EMPTY);
            } catch (Exception ex) {
                AppJournal.Write("Order", "Opening table err: " + ex.ToString());
                MessageBox.Show("Ошибка доступа к таблице котировок!");
            }
        }
コード例 #4
0
        public static int GetQuotesConnection()
        {
            if (quotesTableConId == 0)
            {
                tableQuotes               = new DSSERVERLib.Online();
                tableQuotes.AddRow       += TableQuotes_AddRow;
                tableQuotes.Disconnected += TableQuotes_Disconnected;

                try {
                    quotesTableConId = tableQuotes.Open(DSSERVERLib.ConnectionType.RTSONL_DYNAMIC, "Quote", "issue_name, price, firm_name", "id", null, null, DSSERVERLib.Sort.RTSONL_SORT_EMPTY);
                } catch (Exception) { quotesTableConId = 0; }
            }

            return(quotesTableConId);
        }
コード例 #5
0
ファイル: DataManager.cs プロジェクト: assetb/scenaryrobot
        protected int FirmsOpen()
        {
            AppJournal.Write("DataManager", "Trying open firm table");

            tableFirms         = new DSSERVERLib.Online();
            firmData           = new ObservableCollection <Firm>();
            tableFirms.AddRow += TableFirmsAddRows;

            try {
                connectionType = tableFirms.Open(DSSERVERLib.ConnectionType.RTSONL_DYNAMIC, "Firm", "id, name", "name", null, null, DSSERVERLib.Sort.RTSONL_FORWARD);
            } catch (Exception ex) {
                AppJournal.Write("DataManager", "Opening table err: " + ex.ToString());
                MessageBox.Show("Ошибка доступа к таблице клиентов!");
            }

            return(connectionType);
        }
コード例 #6
0
ファイル: Connections.cs プロジェクト: assetb/scenaryrobot
        public static int GetQuotesConnection()
        {
            if (quotesTableCon == 0)
            {
                quotesTable = new DSSERVERLib.Online();

                quotesTable.AddRow += Tables.QuotesAddRows;

                try {
                    quotesTableCon = quotesTable.Open(DSSERVERLib.ConnectionType.RTSONL_DYNAMIC, "Quote", "issue_name, price, firm_name, moment", "id", null, null, DSSERVERLib.Sort.RTSONL_SORT_EMPTY);
                } catch (Exception ex) {
                    MessageBox.Show("Ошибка подключения к таблице котировок: " + ex.ToString());

                    quotesTableCon = 0;
                }
            }

            return(quotesTableCon);
        }
コード例 #7
0
        public int IssuesOpen()
        {
            AppJournal.Write("DataManager", "Trying open issue table");

            tableIssues         = new DSSERVERLib.Online();
            issueData           = new ObservableCollection <Issue>();
            tableIssues.AddRow += TableIssuesAddRow;

            try
            {
                connectionType = tableIssues.Open(DSSERVERLib.ConnectionType.RTSONL_DYNAMIC, "Issue", "id, name, nominal", "id", null, null, DSSERVERLib.Sort.RTSONL_BACKWARD);
            }
            catch (Exception ex)
            {
                AppJournal.Write("DataManager", "Open table err: " + ex.ToString());
                MessageBox.Show("Ошибка доступа к таблице инструментов!");
            }

            return(connectionType);
        }
コード例 #8
0
ファイル: Connections.cs プロジェクト: assetb/scenaryrobot
        public static int GetLotsConnection()
        {
            if (lotsTableCon == 0)
            {
                lotsTable = new DSSERVERLib.Online();

                lotsTable.AddRow += Tables.LotsAddRows;
                lotsTable.Error  += LotsTable_Error;

                try {
                    lotsTableCon = lotsTable.Open(DSSERVERLib.ConnectionType.RTSONL_DYNAMIC, "Issue", "id, name, nominal", "id", null, null, DSSERVERLib.Sort.RTSONL_BACKWARD);
                } catch (Exception ex) {
                    MessageBox.Show("Ошибка подключения к таблице лотов: " + ex.ToString());

                    lotsTableCon = 0;
                }
            }

            return(lotsTableCon);
        }
コード例 #9
0
        public int QuotesConnection()
        {
            if (tableQuotes == null)
            {
                tableQuotes               = new DSSERVERLib.Online();
                tableQuotes.AddRow       += TableQuotesAddRow;
                tableQuotes.Disconnected += TableQuotes_Disconnected;
                tableQuotes.Synchronized += TableQuotes_Synchronized;
            }

            try {
                if (isConnectionTable == 0 && isLogin == true && isNetIntegrity == true)
                {
                    isConnectionTable = tableQuotes.Open(DSSERVERLib.ConnectionType.RTSONL_DYNAMIC, "Quote", "issue_name, price, firm_name, moment", "id", null, null, DSSERVERLib.Sort.RTSONL_SORT_EMPTY);
                }
            } catch (Exception ex) {
                message = ex.Message;
            }

            return(isConnectionTable);
        }
コード例 #10
0
ファイル: QuotesChecking.cs プロジェクト: assetb/scenaryrobot
        public QuotesChecking(List <ProcessedLot> plots)
        {
            this.Plots = plots;

            grant = new Boolean[plots.Count];
            for (int g = 0; g < plots.Count; g++)
            {
                grant[g] = false;
            }
            sended = new Boolean[plots.Count];
            for (int s = 0; s < plots.Count; s++)
            {
                sended[s] = false;
            }
            curPrice = new decimal[plots.Count];

            // Table quotes connection
            tableQuotes         = new DSSERVERLib.Online();
            tableQuotes.AddRow += TableQuotesAddRow;

            try {
                tableQuotes.Open(DSSERVERLib.ConnectionType.RTSONL_DYNAMIC, "Quote", "issue_name, price, firm_name", "id", null, null, DSSERVERLib.Sort.RTSONL_SORT_EMPTY);
            } catch { MessageBox.Show("Ошибка доступа к таблице котировок!"); }
        }