private void button3_Click(object sender, EventArgs e)
        {
            Rahayu_Program.Report.ReportForm reportForm = new Rahayu_Program.Report.ReportForm(main);
            reportForm.MdiParent   = main;
            reportForm.WindowState = FormWindowState.Maximized;

            DataTable dt = main.ExecuteQuery("SELECT DISTINCT mb.barangID, mb.namaBarang, mb.stock, mb.sellPrice, mb.nomorRak FROM MsBarang mb, StationerySalesHeader ssh, StationerySalesDetail ssd WHERE mb.barangID = ssd.barangID AND ssh.stationerySalesID = ssd.stationerySalesID AND ssh.salesTime > '" + awal.ToString("yyyy-MM-dd HH:mm:ss") + "' AND ssh.salesTime < '" + akhir.ToString("yyyy-MM-dd HH:mm:ss") + "' ORDER BY ssd.barangID");

            if (dt == null)
            {
                MessageBox.Show("ERROR PRINT REPORT (LAPORAN GROUP DI CLOSING FORM STATIONERY)");
                this.Dispose();
            }
            else
            {
                if (dt.Rows.Count > 0)
                {
                    Rahayu_Program.Report.Stationery.LaporanRekapAkhir laporan = new Rahayu_Program.Report.Stationery.LaporanRekapAkhir();
                    laporan.SetDataSource(dt);

                    reportForm.GetCrystalReportViewer().ReportSource = laporan;
                    reportForm.GetCrystalReportViewer().Refresh();

                    reportForm.Show();
                }
                else
                {
                    MessageBox.Show("DATA TIDAK ADA (LAPORAN MsBARANG DI CLOSING FORM STATIONERY)");
                }
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            Rahayu_Program.Report.ReportForm reportForm = new Rahayu_Program.Report.ReportForm(main);
            reportForm.MdiParent   = main;
            reportForm.WindowState = FormWindowState.Maximized;

            DataTable dt;

            dt = main.ExecuteQuery("SELECT barangID, namaBarang, nomorRak, sellPrice FROM MsBarang WHERE batasStock = 0");

            if (dt == null)
            {
                MessageBox.Show("OPEN REPORT ERROR (PRINT STOCK HABIS STATIONERY)");
                this.Dispose();
            }
            else
            {
                if (dt.Rows.Count > 0)
                {
                    Rahayu_Program.Report.Stationery.LaporanRekapAwal laporan = new Rahayu_Program.Report.Stationery.LaporanRekapAwal();
                    laporan.SetDataSource(dt);

                    reportForm.GetCrystalReportViewer().ReportSource = laporan;
                    reportForm.GetCrystalReportViewer().Refresh();

                    reportForm.Show();
                }
                else
                {
                    MessageBox.Show("DATA TIDAK ADA");
                }
            }
        }
        private void button2_Click(object sender, EventArgs e)
        {
            Rahayu_Program.Report.ReportForm reportForm = new Rahayu_Program.Report.ReportForm(main);
            reportForm.MdiParent   = main;
            reportForm.WindowState = FormWindowState.Maximized;

            DataTable dt = main.ExecuteQuery("SELECT DISTINCT srsh.nomorRak, srsd.barangID, mb.namaBarang, srsd.stockAsli AS stockKomputer, srsd.selisih, srsd.stockHitung FROM MsBarang mb, StationeryRekapStockHeader srsh, StationeryRekapStockDetail srsd WHERE mb.barangID = srsd.barangID AND srsh.rekapStockID = srsd.rekapStockID AND NOT srsd.selisih = 0 AND srsh.rekapTime > '" + awal.ToString("yyyy-MM-dd HH:mm:ss") + "' AND srsh.rekapTime < '" + akhir.ToString("yyyy-MM-dd HH:mm:ss") + "' ORDER BY srsh.nomorRak, srsd.barangID");

            if (dt == null)
            {
                MessageBox.Show("OPEN REPORT ERROR (PRINT REKAP STOCK INPUT STATIONERY)");
                this.Dispose();
            }
            else
            {
                if (dt.Rows.Count > 0)
                {
                    Rahayu_Program.Report.Stationery.LaporanBedaStock laporan = new Rahayu_Program.Report.Stationery.LaporanBedaStock();
                    laporan.SetDataSource(dt);

                    reportForm.GetCrystalReportViewer().ReportSource = laporan;
                    reportForm.GetCrystalReportViewer().Refresh();

                    reportForm.Show();
                }
                else
                {
                    MessageBox.Show("DATA TIDAK ADA");
                }
            }
        }
Example #4
0
        private void button1_Click(object sender, EventArgs e)
        {
            Rahayu_Program.Report.ReportForm reportForm = new Rahayu_Program.Report.ReportForm(main);
            reportForm.MdiParent   = main;
            reportForm.WindowState = FormWindowState.Maximized;


            dt = main.ExecuteQuery("SELECT barangID, namaBarang, stock, batasStock, b.supplierName, b.contactPerson, b.address, b.phone1, b.phone2, b.phone3 FROM MsBarang a, MsSupplier b WHERE stock < batasStock");

            if (dt == null)
            {
                MessageBox.Show("OPEN REPORT ERROR (PRINT STOCK HABIS STATIONERY)");
                this.Dispose();
            }
            else
            {
                if (dt.Rows.Count > 0)
                {
                    Rahayu_Program.Report.Stationery.LaporanHabisStock laporan = new Rahayu_Program.Report.Stationery.LaporanHabisStock();
                    laporan.SetDataSource(dt);

                    reportForm.GetCrystalReportViewer().ReportSource = laporan;
                    reportForm.GetCrystalReportViewer().Refresh();

                    reportForm.Show();
                }
                else
                {
                    MessageBox.Show("DATA TIDAK ADA");
                }
            }
        }