private void gridView1_CustomRowCellEditForEditing(object sender, DevExpress.XtraGrid.Views.Grid.CustomRowCellEditEventArgs e) { if (e.RowHandle >= 0) { gridControl2.DataSource = cthdxbus.DanhSachChiTietHoaDonXuat(gridView1.GetRowCellValue(e.RowHandle, "MaHDX").ToString()); txtMHDX.Text = gridView1.GetRowCellValue(e.RowHandle, "MaHDX").ToString(); txtMKH.Text = gridView1.GetRowCellValue(e.RowHandle, "MaKH").ToString(); txtMNV.Text = gridView1.GetRowCellValue(e.RowHandle, "MaNV").ToString(); txtTT.Text = gridView1.GetRowCellValue(e.RowHandle, "TongTien").ToString(); txtMCTHDX.Text = gridView1.GetRowCellValue(e.RowHandle, "MaHDX").ToString(); HamThanhTienA(); txtThanhTien.Text = ""; txtSL.Text = ""; txtMSP.Text = ""; txtGB.Text = ""; bthIHD.Enabled = true; } }
private void frmHoaDonBanHang_Load(object sender, EventArgs e) { ReportDocument rp = new ReportDocument(); rp.Load(@"C:\Users\Ron\Desktop\Tốt Nghiệp\CHTapHoa\CHTapHoa\Reports\HoaDonBanHang.rpt"); List <HoaDonXuatDTO> dsHDX = new List <HoaDonXuatDTO>(); HoaDonXuatDTO hdx = _hdxBus.LayHDTheoMa(MaHD); dsHDX.Add(hdx); rp.SetDataSource(dsHDX); List <CTHDXuatDTO> dsSanPham = _cthdxBus.DanhSachChiTietHoaDonXuat(MaHD); rp.Subreports[0].SetDataSource(dsSanPham); crystalReportViewer1.ReportSource = rp; this.crystalReportViewer1.Show(); this.crystalReportViewer1.Refresh(); }