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; } }
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; } }
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; } }
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; } }