Exemplo n.º 1
0
        public RealtimeDataManagement()
        {
            InitializeComponent();

            cqgDataManagement = new CQGDataManagement(this);

            MongoDBConnectionAndSetup mongoDBConnectionAndSetup = new MongoDBConnectionAndSetup();
            //mongoDBConnectionAndSetup.connectToMongoDB();
            //mongoDBConnectionAndSetup.createDocument();
            //mongoDBConnectionAndSetup.dropCollection();

            var contextTMLDB = new DataClassesTMLDBDataContext(
                System.Configuration.ConfigurationManager.ConnectionStrings["TMLDBConnectionString"].ConnectionString);
            TMLDBReader TMLDBReader = new TMLDBReader(contextTMLDB);



            bool gotInstrumentList = TMLDBReader.GetTblInstruments(ref cqgDataManagement.instrumentHashTable,
                                                                   ref cqgDataManagement.instrumentList);

            Console.WriteLine(cqgDataManagement.instrumentList[0].description);

            AsyncTaskListener.Updated += AsyncTaskListener_Updated;

            testLoadIn();

            testGetData();

            //mongoDBConnectionAndSetup.createDoc();
            //mongoDBConnectionAndSetup.getDocument();
        }
Exemplo n.º 2
0
        private void rb_DB_CheckedChanged(object sender, EventArgs e)
        {
            var rb = (RadioButton)sender;

            if (!rb.Checked)
            {
                return;
            }

            int tag = int.Parse((string)rb.Tag);

            // Prepare the connection string
            switch (tag)
            {
            case 1:
                // Local DB
                DatabaseName     = "Local";
                ConnectionString = ConnectionStrings.Local;
                break;

            case 2:
                // TMLDB_Copy
                DatabaseName     = "TMLDB_Copy";
                ConnectionString = ConnectionStrings.TMLDB_Copy;
                break;

            case 3:
                // TMLDB
                DatabaseName     = "TMLDB";
                ConnectionString = ConnectionStrings.TMLDB;
                break;

            default:
                throw new ArgumentException();
            }

            // Change DB context
            if (tag != 3)
            {
                Context = new DataClassesTMLDBDataContext(ConnectionString);
            }
            else
            {
                Context = TMLDBReader.Context;
            }

            Context.CommandTimeout = 0;

            LogMessage(string.Format("You selected {0} database", DatabaseName));
        }
Exemplo n.º 3
0
        public FormDB()
        {
            InitializeComponent();

            this.Resize               += FormDB_Resize;
            this.LogMessage           += FormDB_LogMessage;
            this.FormClosed           += FormDB_FormClosed;
            ParsedData.ParseSucceeded += ParsedData_ParseSucceeded;
            ParsedData.ParseFailed    += ParsedData_ParseFailed;
            AsyncTaskListener.Updated += AsyncTaskListener_Updated;

            rb_DB_CheckedChanged(rb_LocalDB, null);
            cb_TestTables_CheckedChanged(null, null);

            var contextTMLDB = new DataClassesTMLDBDataContext(ConnectionStrings.TMLDB);

            TMLDBReader = new TMLDBReader(contextTMLDB);
        }
Exemplo n.º 4
0
 public TMLDBReader(DataClassesTMLDBDataContext contextTMLDB)
 {
     this.Context = contextTMLDB;
     this.IdInstrAndStripNameToExpDate = new Dictionary <Tuple <long, DateTime>, DateTime>();
 }