//button for generating random charts - for testing purposes private void button1_Click(object sender, EventArgs e) { List<Bet> tmpBets = new List<Bet>(); double previous = 0; for (int i = 0; i < r.Next(1000, 100000); i++) { int tmp = r.Next(0, 10); if (tmp % 2 == 0) { previous -= tmp; } else previous += tmp; tmpBets.Add(new Bet { Id = i, Profit = (decimal)previous }); } Graph g = new Graph(tmpBets.ToArray()); g.Show(); }
private void btnGraphProfitTime_Click(object sender, EventArgs e) { Graph g = new Graph(sqlite_helper.GetBetForCharts(CurrentSite.Name, OpenTime, OpenTime.AddYears(1))); g.Show(); }
private void btnChartBetID_Click(object sender, EventArgs e) { Custom_Chart tmp = new Custom_Chart(); if (tmp.ShowDialog() == System.Windows.Forms.DialogResult.OK) { if (tmp.ChartType == 1) { Graph g = new Graph(sqlite_helper.GetBetForCharts(CurrentSite.Name, tmp.StartID)); g.Show(); } else { Graph g = new Graph(sqlite_helper.GetBetForCharts(CurrentSite.Name, tmp.StartDate , tmp.EndDate)); g.Show(); } } }
private void btnGraphProfitBets_Click(object sender, EventArgs e) { bool created = false; if (LiveGraph != null) { if (LiveGraph.IsDisposed) { LiveGraph = new Graph(sqlite_helper.GetBetForCharts(CurrentSite.Name, OpenTime, DateTime.Now.AddYears(1))); LiveGraph.Show(); created = true; } } else { LiveGraph = new Graph(sqlite_helper.GetBetForCharts(CurrentSite.Name, OpenTime, DateTime.Now.AddYears(1))); LiveGraph.Show(); created = true; } if (!created) MessageBox.Show("Live chart is already open. Please close the current live chart window before opening a new one."); //currentprofitbet(); }
private void btnChartAllTimeProfitTime_Click(object sender, EventArgs e) { Graph g = new Graph(sqlite_helper.GetBetForCharts(CurrentSite.Name)); g.Show(); }