Exemplo n.º 1
0
        private void button3_Click(object sender, EventArgs e)
        {
            if ((rbUser.Checked == false) && (rbInvoice.Checked == false))
            {
                Interaction.MsgBox("Please select report by Customer or Invoice No", MsgBoxStyle.Information, "Select Report");
                return;
            }

            if (rbUser.Checked == true)
            {
                string input = Microsoft.VisualBasic.Interaction.InputBox("Customer ID", "Customer ID", "");



                try
                {
                    SQLConn.sqL = "SELECT * FROM customer WHERE CusID=" + input + " ORDER BY CusID Limit 1 ";
                    SQLConn.ConnDB();
                    SQLConn.cmd = new MySqlCommand(SQLConn.sqL, SQLConn.conn);
                    SQLConn.dr  = SQLConn.cmd.ExecuteReader();

                    while (SQLConn.dr.Read() == true)
                    {
                        frmReportDailSalesByCustomer R = new frmReportDailSalesByCustomer(DateTimePicker1.Value, dateTimePicker2.Value, input, SQLConn.dr["Firstname"].ToString(), SQLConn.dr["DuePayment"].ToString());
                        R.Show();
                    }
                }
                catch (Exception ex)
                {
                    //Interaction.MsgBox(ex.ToString());
                }
                finally
                {
                    SQLConn.cmd.Dispose();
                    SQLConn.conn.Close();
                }
            }
            else
            {
                frmReportDailSalesByInvoice R = new frmReportDailSalesByInvoice(DateTimePicker1.Value, dateTimePicker2.Value);
                R.Show();
            }
        }
        private void button3_Click(object sender, EventArgs e)
        {
            if ((rbUser.Checked == false) && (rbInvoice.Checked == false))
            {
                Interaction.MsgBox("Please select report by User or Invoice No", MsgBoxStyle.Information, "Select Report");
                return;
            }


            if (rbUser.Checked == true)
            {
                frmReportDailSalesByUser R = new frmReportDailSalesByUser(DateTimePicker1.Value);
                R.Show();
            }
            else
            {
                frmReportDailSalesByInvoice R = new frmReportDailSalesByInvoice(DateTimePicker1.Value);
                R.Show();
            }
        }