public SanPham(int maSanPham, string tenSanPham, Loai_San_Pham loaiSanPham, int gia, HangSanXuat hangSanXuatSanPham, int soLuongTonKho, bool coKhuyenMai, string hinhAnh) { this.TenSanPham = tenSanPham; this.LoaiSanPham = loaiSanPham; this.Gia = gia; this.HangSanXuatSanPham = hangSanXuatSanPham; SoLuongTonKho1 = soLuongTonKho; this.CoKhuyenMai = coKhuyenMai; this.DuongDanHinhAnh = hinhAnh; string kiTuDau = ""; if (loaiSanPham == Loai_San_Pham.DIEN_THOAI) { kiTuDau = "D"; } else { kiTuDau = "L"; } this.MaSanPham = kiTuDau + maSanPham.ToString(); }
public SanPham(string maSanPham, string tenSanPham, Loai_San_Pham loaiSanPham, int gia, HangSanXuat hangSanXuatSanPham, int soLuongTonKho, bool coKhuyenMai, string hinhAnh) { this.MaSanPham = maSanPham; this.TenSanPham = tenSanPham; this.LoaiSanPham = loaiSanPham; this.Gia = gia; this.HangSanXuatSanPham = hangSanXuatSanPham; SoLuongTonKho1 = soLuongTonKho; this.CoKhuyenMai = coKhuyenMai; this.DuongDanHinhAnh = hinhAnh; }