Esempio n. 1
0
        protected void cbpViewReport_Callback(object sender, CallbackEventArgsBase e)
        {
            int IDPhieuTraHang = int.Parse(e.Parameter);
            var PhieuTraHang   = DBDataProvider.GetPhieuTraHang_DaiLy(IDPhieuTraHang);

            oReturnNodeReport                = new oReportGiaoHang();
            oReturnNodeReport.MaKhachHang    = PhieuTraHang.khKhachHang.MaKhachHang;
            oReturnNodeReport.TenKhachHang   = PhieuTraHang.khKhachHang.HoTen;
            oReturnNodeReport.DienThoai      = PhieuTraHang.khKhachHang.DienThoai;
            oReturnNodeReport.DiaChiGiaoHang = PhieuTraHang.khKhachHang.DiaChi;
            oReturnNodeReport.TenNhanVien    = PhieuTraHang.nvNhanVien.HoTen;
            oReturnNodeReport.GhiChuGiaoHang = PhieuTraHang.GhiChu;
            oReturnNodeReport.NgayGiao       = Formats.ConvertToVNDateString(PhieuTraHang.NgayTra.ToString());
            oReturnNodeReport.NgayTao        = Formats.ConvertToVNDateString(PhieuTraHang.NgayNhap.ToString());
            oReturnNodeReport.TongTien       = Convert.ToDouble(PhieuTraHang.TongTienHang);
            oReturnNodeReport.TieuDePhieu    = "PHIẾU TRẢ HÀNG " + PhieuTraHang.STTDonHang;

            oReturnNodeReport.listProduct = new List <oProduct>();
            List <kPhieuTraHangChiTiet> ListHang = DBDataProvider.ListChiTietTraHang_DaiLy(IDPhieuTraHang);
            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.TienTra);
                prod.ThanhTien    = Convert.ToDouble(Hang.ThanhTien);
                oReturnNodeReport.listProduct.Add(prod);
            }
        }
        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);
            }
        }
Esempio n. 3
0
        private void CreateReportReview()
        {
            hdfViewReport["view"] = 1;
            oCusExport            = new oReportGiaoHang();
            var KH = DBDataProvider.DB.khKhachHangs.Where(x => x.IDKhachHang == Convert.ToInt32(ccbNhaCungCap.Value.ToString())).FirstOrDefault();

            oCusExport.MaKhachHang       = KH.MaKhachHang;
            oCusExport.TenKhachHang      = KH.HoTen;
            oCusExport.DienThoai         = KH.DienThoai;
            oCusExport.DiaChiGiaoHang    = KH.DiaChi;
            oCusExport.TenNhanVien       = Formats.NameUser();
            oCusExport.GhiChuGiaoHang    = memoGhiChu.Text;
            oCusExport.NgayGiao          = Formats.ConvertToVNDateString(dateNgayNhap.Text);
            oCusExport.NgayTao           = Formats.ConvertToVNDateString(DateTime.Now.ToString());
            oCusExport.GiamGia           = Convert.ToDouble(spGiamGia.Number);
            oCusExport.CongNoHienTai     = Convert.ToDouble(KH.CongNo);
            oCusExport.SoDonHangTrongNam = ".....";
            oCusExport.TieuDePhieu       = "PHIẾU BÁN HÀNG ";
            oCusExport.TrangThaiPhieu    = "(Xem trước)";
            oCusExport.listProduct       = new List <oProduct>();
            oCusExport.ThanhToan         = Convert.ToDouble(spKhachHangThoan.Number);// khách thanh toán
            int    i        = 1;
            double TongTien = 0;

            foreach (var Hang in listReceiptProducts)
            {
                TongTien += Hang.ThanhTien;
                oProduct prod = new oProduct();
                prod.STT          = i++;
                prod.MaHang       = Hang.MaHang;
                prod.TenHang      = Hang.TenHangHoa;
                prod.TenDonViTinh = Hang.TenDonViTinh;
                prod.SoLuong      = Convert.ToInt32(Hang.SoLuong);
                prod.DonGia       = Convert.ToDouble(Hang.GiaBan);
                prod.ThanhTien    = Convert.ToDouble(Hang.ThanhTien);
                oCusExport.listProduct.Add(prod);
            }
            oCusExport.TongTien = TongTien;
            cbpInfoImport.JSProperties["cp_rpView"] = true;
        }
        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;
        }