Пример #1
0
 public ItemGioHang(int id_sp, int sl)
 {
     using (DuAnCuoiKhoaEntities db = new DuAnCuoiKhoaEntities())
     {
         this.ID_SanPham = id_sp;
         SanPham sp = db.SanPhams.Single(x => x.ID_SanPham == id_sp);
         this.TenSanPham = sp.TenSanPham;
         this.HinhAnh    = sp.Avatar;
         this.DonGia     = sp.GiaGoc.Value;
         this.SoLuong    = sl;
         this.ThanhTien  = DonGia * SoLuong;
     }
 }