private void timer1_Tick(object sender, EventArgs e)
        {
            dttable1 = TestToConnectMySQLServer.FillData(sql1, connection);
            dttable2 = TestToConnectMySQLServer.FillData(sql2, connection);
            dttable3 = TestToConnectMySQLServer.FillData(sql3, connection);
            dttable4 = TestToConnectMySQLServer.FillData(sql4, connection);

            GenerateTable(comboBox1.Text);


            textBox1.Text = ("Last Refresh: " + DateTime.Now.ToLongTimeString());
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            comboBox2.Text = "5 min";
            comboBox3.Text = "3";

            textBox1.Text = ("Last Refresh: " + DateTime.Now.ToLongTimeString());

            dttable1 = TestToConnectMySQLServer.FillData(sql1, connection);
            dttable2 = TestToConnectMySQLServer.FillData(sql2, connection);
            dttable3 = TestToConnectMySQLServer.FillData(sql3, connection);
            dttable4 = TestToConnectMySQLServer.FillData(sql4, connection);

            timer1.Enabled = true;

            comboBox1.SelectedItem = "2-Shift";
        }
        private void button3_Click(object sender, EventArgs e)
        {
            dttable1 = TestToConnectMySQLServer.FillData(sql1, connection);
            dttable2 = TestToConnectMySQLServer.FillData(sql2, connection);
            dttable3 = TestToConnectMySQLServer.FillData(sql3, connection);
            dttable4 = TestToConnectMySQLServer.FillData(sql4, connection);

            DataTable dtReturn  = Pivot.GetFixedPivotTable(dttable2, "Date", "Line", "SA_SN", "0", "Count", columnHeaderInput);
            DataTable dtReturn2 = Pivot.GetFixedPivotTable(dttable3, "Date", "Line", "SA_SN", "0", "Count", columnHeaderInput);

            dataGridView1.DataSource = dttable1.DefaultView;
            dataGridView2.DataSource = dtReturn.DefaultView;
            dataGridView3.DataSource = dtReturn2.DefaultView;
            dataGridView4.DataSource = dttable4.DefaultView;

            Pivot.GetDivisionCellFormat(dataGridView2, dataGridView3, rejectHighlightQty);

            dataGridView3.DataSource = null;

            dataGridView3.DataSource = Pivot.GetPercentagePivotTable(dtReturn2, "Total").DefaultView;

            textBox1.Text = ("Last Refresh: " + DateTime.Now.ToLongTimeString());
        }