protected void cbpViewReport_Callback(object sender, CallbackEventArgsBase e) { int IDPhieuGiaoHang = int.Parse(e.Parameter); var PhieuGiaoHang = DBDataProvider.GetPhieuGiaoHang(IDPhieuGiaoHang); oCusExport = new oReportGiaoHang(); oCusExport.MaKhachHang = PhieuGiaoHang.khKhachHang.MaKhachHang; oCusExport.TenKhachHang = PhieuGiaoHang.khKhachHang.HoTen; oCusExport.DienThoai = PhieuGiaoHang.DienThoai; oCusExport.DiaChiGiaoHang = PhieuGiaoHang.DiaChiGiaoHang; oCusExport.TenNhanVien = PhieuGiaoHang.nvNhanVien.HoTen; oCusExport.GhiChuGiaoHang = PhieuGiaoHang.GhiChuGiaoHang; oCusExport.NgayGiao = Formats.ConvertToVNDateString(PhieuGiaoHang.NgayGiao.ToString()); oCusExport.NgayTao = Formats.ConvertToVNDateString(PhieuGiaoHang.NgayTao.ToString()); oCusExport.TongSoLuong = Convert.ToInt32(PhieuGiaoHang.TongSoLuong); oCusExport.TongTien = Convert.ToDouble(PhieuGiaoHang.TongTien); oCusExport.ThanhToan = Convert.ToDouble(PhieuGiaoHang.ThanhToan); oCusExport.CongNoHienTai = Convert.ToDouble(PhieuGiaoHang.CongNoHienTai); oCusExport.SoHoaDon = PhieuGiaoHang.SoHoaDon; oCusExport.GiamGia = Convert.ToDouble(PhieuGiaoHang.GiamGia); oCusExport.SoDonHangTrongNam = PhieuGiaoHang.SoDonHangTrongNam.ToString(); oCusExport.TieuDePhieu = "PHIẾU BÁN HÀNG " + PhieuGiaoHang.STTDonHang; string TrangThai = ""; switch (PhieuGiaoHang.TrangThai) { case 0: TrangThai = "(Đã đặt)"; break; case 1: TrangThai = "(Kiêm phiếu xuất kho)"; break; case 3: TrangThai = "(Kiêm phiếu xuất kho)"; break; default: TrangThai = "(Đã hủy)"; break; } oCusExport.TrangThaiPhieu = TrangThai; oCusExport.listProduct = new List <oProduct>(); List <ghPhieuGiaoHangChiTiet> ListHang = DBDataProvider.ListChiTietGiaoHang(IDPhieuGiaoHang); int i = 1; foreach (var Hang in ListHang) { oProduct prod = new oProduct(); prod.STT = i++; prod.MaHang = Hang.hhHangHoa.MaHang; prod.TenHang = Hang.hhHangHoa.TenHangHoa; prod.TenDonViTinh = Hang.hhHangHoa.hhDonViTinh.TenDonViTinh; prod.SoLuong = Convert.ToInt32(Hang.SoLuong); prod.DonGia = Convert.ToDouble(Hang.GiaBan); prod.ThanhTien = Convert.ToDouble(Hang.ThanhTien); oCusExport.listProduct.Add(prod); } }
private void CreateReportReview_Save(int IDPhieu) { hdfViewReport["view"] = 1; var PhieuGiaoHang = DBDataProvider.GetPhieuGiaoHang(IDPhieu); oCusExport = new oReportGiaoHang(); oCusExport.MaKhachHang = PhieuGiaoHang.khKhachHang.MaKhachHang; oCusExport.TenKhachHang = PhieuGiaoHang.khKhachHang.HoTen; oCusExport.DienThoai = PhieuGiaoHang.DienThoai; oCusExport.DiaChiGiaoHang = PhieuGiaoHang.DiaChiGiaoHang; oCusExport.TenNhanVien = PhieuGiaoHang.nvNhanVien.HoTen; oCusExport.GhiChuGiaoHang = PhieuGiaoHang.GhiChuGiaoHang; oCusExport.NgayGiao = Formats.ConvertToVNDateString(PhieuGiaoHang.NgayGiao.ToString()); oCusExport.NgayTao = Formats.ConvertToVNDateString(PhieuGiaoHang.NgayTao.ToString()); oCusExport.TongSoLuong = Convert.ToInt32(PhieuGiaoHang.TongSoLuong); oCusExport.TongTien = Convert.ToDouble(PhieuGiaoHang.TongTien); oCusExport.ThanhToan = Convert.ToDouble(PhieuGiaoHang.ThanhToan); oCusExport.CongNoHienTai = Convert.ToDouble(PhieuGiaoHang.CongNoHienTai); oCusExport.SoHoaDon = PhieuGiaoHang.SoHoaDon; oCusExport.GiamGia = Convert.ToDouble(PhieuGiaoHang.GiamGia); oCusExport.SoDonHangTrongNam = PhieuGiaoHang.SoDonHangTrongNam.ToString(); oCusExport.TieuDePhieu = "PHIẾU BÁN HÀNG " + PhieuGiaoHang.STTDonHang; string TrangThai = ""; switch (PhieuGiaoHang.TrangThai) { case 0: TrangThai = "(Đã đặt)"; break; case 1: TrangThai = "(Kiêm phiếu xuất kho)"; break; case 3: TrangThai = "(Kiêm phiếu xuất kho)"; break; default: TrangThai = "(Đã hủy)"; break; } oCusExport.TrangThaiPhieu = TrangThai; oCusExport.listProduct = new List <oProduct>(); List <ghPhieuGiaoHangChiTiet> ListHang = DBDataProvider.ListChiTietGiaoHang(IDPhieu); int i = 1; foreach (var Hang in ListHang) { oProduct prod = new oProduct(); prod.STT = i++; prod.MaHang = Hang.hhHangHoa.MaHang; prod.TenHang = Hang.hhHangHoa.TenHangHoa; prod.TenDonViTinh = Hang.hhHangHoa.hhDonViTinh.TenDonViTinh; prod.SoLuong = Convert.ToInt32(Hang.SoLuong); prod.DonGia = Convert.ToDouble(Hang.GiaBan); prod.ThanhTien = Convert.ToDouble(Hang.ThanhTien); oCusExport.listProduct.Add(prod); } cbpInfoImport.JSProperties["cp_rpView"] = true; }