예제 #1
0
 public ItemGioHang(int iMaSP, int sl)
 {
     using (QuanLyBanHangEntities db = new QuanLyBanHangEntities())
     {
         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 = SoLuong * DonGia;
     }
 }
예제 #2
0
 public itemGioHang(int iMaSP)
 {
     using (QuanLyBanHangEntities db = new QuanLyBanHangEntities())
     {
         SanPham sp = db.SanPham.Single(n => n.MaSP == iMaSP);
         this.MaSP      = iMaSP;
         this.TenSP     = sp.TenSP;
         this.DonGia    = sp.DonGia.Value;
         this.HinhAnh   = sp.HinhAnh;
         this.SoLuong   = 1;
         this.ThanhTien = this.DonGia * this.SoLuong;
     }
 }
예제 #3
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.HinhAnh   = sp.HinhAnh;
         this.DonGia    = sp.DonGia.Value;
         this.SoLuong   = sl;
         this.ThanhTien = DonGia * SoLuong;
     }
 }
예제 #4
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.NguoiBan  = sp.ThanhVien.TaiKhoan;
         this.DonGia    = sp.DonGia.Value;
         this.HinhAnh   = sp.HinhAnh;
         this.SoLuong   = sl;
         this.ThanhTien = DonGia * SoLuong;
     }
 }