示例#1
0
 public ItemGioHang(string maSP, int soLuongSP)
 {
     using (CarShopEntities db = new CarShopEntities())
     {
         this.MaSP = maSP;
         SanPham sp = db.SanPhams.Single(x => x.MaSP == maSP);
         this.TenSP     = sp.TenSP;
         this.DonGia    = sp.DonGia.Value;
         this.URLAnh    = sp.URLAnh;
         this.SoLuong   = soLuongSP;
         this.ThanhTien = this.SoLuong * this.DonGia;
     }
 }