Пример #1
0
 public itemGioHang(int iMaSP, int sl)
 {
     using (QuanLyBanHangEntities db = new QuanLyBanHangEntities())
     {
         this.MaSP = iMaSP;
         SanPham sp = db.SanPhams.Single(n => n.MaSP == iMaSP);
         this.TenSP     = sp.TenSP;
         this.DonGia    = sp.DonGia.Value;
         this.HinhAnh   = sp.HinhAnh;
         this.SoLuong   = sl;
         this.ThanhTien = DonGia * SoLuong;
     }
 }
Пример #2
0
 public ItemGioHang(int iMaSP, int Sl)
 {
     using (QuanLyBanHangEntities db = new QuanLyBanHangEntities())
     {
         //Truy xuất những trường cần
         this.MaSP = iMaSP;
         SanPham sp = db.SanPhams.Single(n => n.MaSP == iMaSP);
         this.TenSP     = sp.TenSP;
         this.HinhAnh   = sp.HinhAnh;
         this.DonGia    = sp.DonGia.Value;
         this.SoLuong   = Sl;
         this.ThanhTien = DonGia * SoLuong;
     }
 }