Exemple #1
0
        private void button1_Click(object sender, EventArgs e)
        {
            if (conn == null)
            {
                try
                {
                    conn = ConnectionPool.GetConnection();
                }
                catch (Exception ex)
                {
                    errorLabel.Text = ex.Message;
                }
            }
            object result = (object)conn.k("select from trade");

            c.Flip table = (c.Flip)result;

            QueryView.Columns.Clear();//Clear columns first to allow clean population of table
            foreach (string colName in table.getColumns())
            {
                QueryView.Columns.Add(colName, colName); //Add the columns to the Queryview
            }

            QueryView.Rows.Add(table.getNoRow());

            for (int row = 0; row < table.getNoRow(); row++)
            {
                for (int col = 0; col < (table.getColumns().Length); col++)
                {
                    QueryView[col, row].Value = c.at(table.y[col], row); //Populate each cell of the Queryview with its associated value
                }
            }
            ConnectionPool.ReturnConnection(conn);
        }
Exemple #2
0
        private void SetAxis(c.Flip details)
        {
            double min = 1000;
            double max = 0;

            for (int i = 0; i < details.getNoRow(); i++)
            {
                for (int j = 3; j < (details.getNoColumns()) - 1; j++)
                {
                    double minVal = (double)c.at(details.y[j], i);
                    double maxVal = (double)c.at(details.y[j], i);

                    if (minVal < min)
                    {
                        min = minVal;
                    }
                    if (maxVal > max)
                    {
                        max = maxVal;
                    }
                }
            }
            reportChart.ChartAreas[0].AxisY.Minimum      = min - 0.0025;
            reportChart.ChartAreas[0].AxisY.Maximum      = max + 0.0025;
            reportChart.ChartAreas[0].AxisX.IntervalType = DateTimeIntervalType.Minutes;
        }
Exemple #3
0
        private void button1_Click(object sender, EventArgs e)
        {
            try
            {
                if (conn == null)
                {
                    conn = ConnectionPool.GetConnection();
                }

                String query = BuildQuery();

                try
                {
                    object result = null;
                    result = (object)conn.k(query);

                    c.Flip table = (c.Flip)result;

                    QueryView.Columns.Clear();
                    foreach (string colName in table.getColumns())
                    {
                        QueryView.Columns.Add(colName, colName);
                    }

                    QueryView.Rows.Add(table.getNoRow());

                    for (int row = 0; row < table.getNoRow(); row++)
                    {
                        for (int col = 0; col < (table.getColumns().Length); col++)
                        {
                            QueryView[col, row].Value = c.at(table.y[col], row);
                        }
                    }
                    errorLabel.Text      = "";
                    QueryView.CellClick += (QueryView_CellClick);
                }
                catch (Exception ex)
                {
                    errorLabel.Text = "ERROR:" + ex.Message;
                }
                ConnectionPool.ReturnConnection(conn);
            }
            catch (Exception ex)
            {
                errorLabel.Text = "Unexpected error: " + ex.Message;
            }
        }
Exemple #4
0
        private void PopulateGrid(c.Flip table)
        {
            resultsGridView.Columns.Clear();
            foreach (string colName in table.getColumns())
            {
                resultsGridView.Columns.Add(colName, colName);
            }

            resultsGridView.Rows.Add(table.getNoRow());

            for (int row = 0; row < table.getNoRow(); row++)
            {
                for (int col = 0; col < (table.getColumns().Length); col++)
                {
                    resultsGridView[col, row].Value = c.at(table.y[col], row);
                }
            }
        }
Exemple #5
0
 private void PopulateChart(c.Flip details)
 {
     for (int i = 0; i < details.getNoRow(); i++)
     {
         reportChart.Series["vwap"].Points.AddXY((c.at(details.y[0], i)).ToString(), (double)c.at(details.y[3], i));
         reportChart.Series["avg"].Points.AddXY((c.at(details.y[0], i)).ToString(), (double)c.at(details.y[4], i));
         reportChart.Series["dailyAvg"].Points.AddXY((c.at(details.y[0], i)).ToString(), dAvg);
         reportChart.Series["dailyVwap"].Points.AddXY((c.at(details.y[0], i)).ToString(), dVwap);
     }
 }