Пример #1
0
        private void ColorChart_Load(object sender, EventArgs e)
        {
            LottoChartDisplay();
            string data = Parsing.ReturnDate();

            string connection = ConfigurationManager.ConnectionStrings["SQLConStr"].ConnectionString;

            table = new DataTable();
            table.Columns.Add("회차");
            table.Columns.Add("담청번호");
            table.Columns.Add("보너스");
            table.Columns.Add("당첨일자");

            using (SqlConnection conn = new SqlConnection(connection))
            {
                conn.Open();

                SqlCommand cmd = new SqlCommand();
                cmd.Connection  = conn;
                cmd.CommandType = CommandType.StoredProcedure;
                cmd.CommandText = "SelectLotto";

                var reader = cmd.ExecuteReader();

                while (reader.Read())
                {
                    DataRow row = table.NewRow();
                    row["회차"]   = reader["turn"];
                    row["담청번호"] = reader["first_win"] + " , " + reader["second_win"] + " , " + reader["third_win"] + " , " + reader["fourth_win"] + " , " + reader["fifth_win"] + " , " + reader["sixth_win"];
                    row["보너스"]  = reader["bonus"];
                    row["당첨일자"] = data;
                    table.Rows.Add(row);
                }

                conn.Close();
                this.dataGridView1.DataSource = table;
            }
        }
Пример #2
0
        private void LottoChartDisplay()
        {
            int Max = Parsing.ReturnMax();

            parents = (Parents)Owner;

            for (int i = 1; i < Max + 1; i++)
            {
                cbb_Start.Items.Add(i);
                cbb_End.Items.Add(i);
            }
            cbb_End.Text = Max.ToString();


            Charting(parents);
            lottoChart.Titles.Add("색 상 별 통 계");
            lottoChart.Series[0].MarkerStyle          = System.Windows.Forms.DataVisualization.Charting.MarkerStyle.Circle;
            lottoChart.Series[0].Points[0].LegendText = "1 - 10번";
            lottoChart.Series[0].Points[1].LegendText = "11 - 20번";
            lottoChart.Series[0].Points[2].LegendText = "21 - 30번";
            lottoChart.Series[0].Points[3].LegendText = "31 - 40번";
            lottoChart.Series[0].Points[4].LegendText = "41 - 45번";
        }