Exemplo n.º 1
0
        private void frmThongKeDoanhThu_Load(object sender, EventArgs e)
        {
            DataTable   dt = new DataTable();
            classKetNoi kn = new classKetNoi();

            dt = kn.laybang("SELECT DONHANG.MaHD, KHACHHANG.TenKH, KHACHHANG.MaKH, KHACHHANG.SoDT, SANPHAM.TenSP, SANPHAM.DonVi, SANPHAM.DonGia, CTHD.SoLuong, SANPHAM.SoLuong AS SoLuongTrongKho, SANPHAM.GiaGoc,  CTHD.SoLuong * SANPHAM.DonGia AS ThanhTien, CTHD.SoLuong * SANPHAM.GiaGoc AS TienChi, (SANPHAM.DonGia - SANPHAM.GiaGoc) * CTHD.SoLuong AS TienLoi FROM DONHANG INNER JOIN CTHD ON DONHANG.MaHD = CTHD.MaHD INNER JOIN KHACHHANG ON DONHANG.MaKH = KHACHHANG.MaKH INNER JOIN SANPHAM ON CTHD.MaSP = SANPHAM.MaSP");
            rpTongDoanhThu RP = new rpTongDoanhThu();

            RP.SetDataSource(dt);
            crystalReportViewer1.ReportSource = RP;
        }
Exemplo n.º 2
0
        private void FrmRP_Load(object sender, EventArgs e)
        {
            DataTable   dt = new DataTable();
            classKetNoi kn = new classKetNoi();

            dt = kn.laybang("SELECT DONHANG.MaHD, KHACHHANG.TenKH, KHACHHANG.MaKH, KHACHHANG.SoDT, SANPHAM.TenSP, SANPHAM.DonVi, SANPHAM.DonGia, CTHD.SoLuong, CTHD.SoLuong * SANPHAM.DonGia AS ThanhTien, DONHANG.NgayLap FROM DONHANG INNER JOIN CTHD ON DONHANG.MaHD = CTHD.MaHD INNER JOIN KHACHHANG ON DONHANG.MaKH = KHACHHANG.MaKH INNER JOIN SANPHAM ON CTHD.MaSP = SANPHAM.MaSP where DONHANG.MaHD='" + MaHD + "'");
            InHD RP = new InHD();

            RP.SetDataSource(dt);
            crystalReportViewer1.ReportSource = RP;
        }