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) { } }
// Клиенты 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); } }
// Котировки 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("Ошибка доступа к таблице котировок!"); } }
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); }
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); }
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); }
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); }
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); }
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); }
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("Ошибка доступа к таблице котировок!"); } }