示例#1
0
        public DataTable showbill(TONGHOP_DTO th)
        {
            string         sql = "SELECT HD.MAHD, TENNHAHANG, TENKH,HOTEN, TIMEIN, NGAY,THANG,NAM,TONGTIEN, DIACHI.DIACHI, GIAMGIA, TENMON, SL, DONGIA  FROM CTHD, HD, KHACHHANG, NHANVIEN, DIACHI, MENU WHERE HD.MAHD = CTHD.MAHD AND HD.MAHD = '" + th.Mahd + "' AND CTHD.MAMON = MENU.MAMON AND HD.MADC = DIACHI.MADC AND HD.MAKH = KHACHHANG.MAHANG AND HD.MANV = NHANVIEN.MANV";
            SqlDataAdapter da  = new SqlDataAdapter(sql, conn);
            DataTable      dt  = new DataTable();

            da.Fill(dt);
            return(dt);
        }
        private void formInBill_Load(object sender, EventArgs e)
        {
            dto = new TONGHOP_DTO(mahd);
            ReportDataSource reportDataSource = new ReportDataSource("DataSet1", bus.hienThiBill(dto));

            reportViewer1.LocalReport.ReportPath = @"C:\Users\HieuNhan\source\repos\quanLyNhaHangBuffer\quanLyNhaHangBuffer\bill.rdlc";
            reportViewer1.LocalReport.DataSources.Clear();
            reportViewer1.LocalReport.DataSources.Add(reportDataSource);
            reportViewer1.RefreshReport();
            this.reportViewer1.RefreshReport();
        }
 public DataTable hienThiBill(TONGHOP_DTO th)
 {
     return(dao.showbill(th));
 }