Ejemplo n.º 1
0
        public bool kiemTraHoaDonBan(String maban)
        {
            try
            {
                HoaDon hoadon = bus_hoaDon.layHoaDonTheoMaBan(maban);
                List <ChiTietHoaDon> chitiet = bus_hoaDon.layChiTietHoaDon(hoadon.MaHoaDon);

                if (chitiet != null)
                {
                    return(true);
                }
                return(false);
            }
            catch (Exception)
            {
                return(false);
            }
        }
Ejemplo n.º 2
0
        public void hienThiBan(String ban)
        {
            try{
                HoaDon hoadon = bus_hoaDon.layHoaDonTheoMaBan(ban);
                List <ChiTietHoaDon> chitiet = bus_hoaDon.layChiTietHoaDon(hoadon.MaHoaDon);
                listhienthihoadon.Clear();

                //gridSelectMenu.DataSource = chitiet;
                myListHoaDon = chitiet;

                for (int i = 0; i <= myListHoaDon.Count - 1; i++)
                {
                    String tenSanpham = bus_sanPham.laySanPhanTheoMa(myListHoaDon[i].MaSanPham).TenSanPham;
                    float  gia        = (float)bus_sanPham.laySanPhanTheoMa(myListHoaDon[i].MaSanPham).GiaSanPham;

                    int   soLuong   = (int)bus_chiTietHoaDon.laySanPhanTheoMa(myListHoaDon[i].MaChiTietHoaDon).SoLuong;
                    float thanhTien = (float)(soLuong * gia);
                    listhienthihoadon.Add(new LISTHOADON(tenSanpham, gia, soLuong, thanhTien));
                }
                hienthitest(listhienthihoadon);
            }
            catch (Exception)
            {
            }
        }