コード例 #1
0
 public ItemGioHang(int iMaSP, int sl)
 {
     using (QuanLiBanHang1Entities db = new QuanLiBanHang1Entities())
     {
         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;
     }
 }