Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- namespace TeamMVC1.Models
- {
- public class GioHang
- {
- webbansachEntities db = new webbansachEntities();
- public int iMaSach { get; set; }
- public string sTenSach { get; set; }
- public string sHinhAnh { get; set; }
- public double dDonGia { get; set; }
- public int iSoLuong { get; set; }
- public double dThanhTien
- {
- get { return iSoLuong * dDonGia; }
- }
- //Hàm tạo giỏ hàng
- public GioHang(int MaSach )
- {
- iMaSach = MaSach;
- SACH sach = db.SACHes.SingleOrDefault(n => n.MaSach == iMaSach);
- sTenSach = sach.TenSach;
- sHinhAnh = sach.AnhBia;
- dDonGia = double.Parse(sach.GiaBan.ToString());
- iSoLuong = 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement