public virtual CrystalDecisions.CrystalReports.Engine.ReportDocument CreateReport() { HoaDonNhapp rpt = new HoaDonNhapp(); rpt.Site = this.Site; return(rpt); }
public void ThanhToanNhap() { NhapNguyenLieuDTO nhapnl = new NhapNguyenLieuDTO(); nhapnl.MaNcc = MaNhaCc; nhapnl.TenDn = TenDn ?? "admin"; nhapnl.NgayNhap = dtpngaynhap.Value.ToString(); nhapnl.TongTien = txttongtien.Text; bool t = nhapnl_bus.NhapNl_Insert(nhapnl); for (int i = 0; i < datanlnhap.Rows.Count - 1; i++) { CtNhapNguyenLieuDTO ctnhapnl = new CtNhapNguyenLieuDTO(); ctnhapnl.MaNl = datanlnhap.Rows[i].Cells[0].Value.ToString(); ctnhapnl.SoLuong = datanlnhap.Rows[i].Cells[4].Value.ToString(); ctnhapnl.DonViTinh = datanlnhap.Rows[i].Cells[2].Value.ToString(); ctnhapnl.HSd = datanlnhap.Rows[i].Cells[3].Value.ToString(); ctnhapnl.DonGia = datanlnhap.Rows[i].Cells[5].Value.ToString(); ctnhapnl_bus.CtNhapNl_Insert(ctnhapnl); //CtNguyenLieuDTO ctnl = new CtNguyenLieuDTO(); //ctnl.MaNl = datanlnhap.Rows[i].Cells[0].Value.ToString(); //ctnl.DVt = datanlnhap.Rows[i].Cells[2].Value.ToString(); //ctnl.HSd = datanlnhap.Rows[i].Cells[3].Value.ToString(); //ctnl.TonKho = datanlnhap.Rows[i].Cells[4].Value.ToString(); //ctnhapnl_bus.CtNhapNl_InsertNl(ctnl); } CtNhapNl_InsertNl(); HoaDonNhap hdn = new HoaDonNhap(TenDn, Quyen); HoaDonNhapp hdnp = new HoaDonNhapp(); hdn.crvhoadonnhap.ReportSource = hdnp; this.Hide(); hdn.ShowDialog(); }