public static ChiTietSanPhamModel ConvertToChiTietSanPhamModel(SanPham sanPham, int maHang, List<SanPham> danhSachSanPhamLienQuan, List<HinhAnh> danhSachHinhAnh, ThongSoKyThuat thongSoKyThuat, List<BinhLuan> danhSachBinhLuan) { return new ChiTietSanPhamModel() { MaHang = maHang, DanhSachSanPhamLienQuan = danhSachSanPhamLienQuan, MaSanPham = sanPham.MaSanPham, TenSanPham = sanPham.TenSanPham, Gia = (sanPham.Gia == null) ? 0 : float.Parse(sanPham.Gia.ToString()), AnhDaiDien = danhSachHinhAnh.FirstOrDefault(), DanhSachHinhAnh = danhSachHinhAnh, KichThuocManHinh = thongSoKyThuat.KichThuocManHinh, HeDieuHanh = thongSoKyThuat.HeDieuHanh, CPU = thongSoKyThuat.CPU, Camera = thongSoKyThuat.Camera, ThoiLuongPin = thongSoKyThuat.ThoiLuongPin, SoLuongSIM = thongSoKyThuat.SoLuongSIM, BoNhoTrong = thongSoKyThuat.BoNhoTrong, TheNho = thongSoKyThuat.TheNho, KhoiLuong = thongSoKyThuat.KhoiLuong, ChieuDai = thongSoKyThuat.ChieuDai, ChieuRong = thongSoKyThuat.ChieuRong, DoDay = thongSoKyThuat.DoDay, BinhLuanDuocThem = null, DanhSachBinhLuan = danhSachBinhLuan }; }
/// <summary> /// Deprecated Method for adding a new object to the ThongSoKyThuats EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToThongSoKyThuats(ThongSoKyThuat thongSoKyThuat) { base.AddObject("ThongSoKyThuats", thongSoKyThuat); }
/// <summary> /// Create a new ThongSoKyThuat object. /// </summary> /// <param name="maThongSo">Initial value of the MaThongSo property.</param> public static ThongSoKyThuat CreateThongSoKyThuat(global::System.Int32 maThongSo) { ThongSoKyThuat thongSoKyThuat = new ThongSoKyThuat(); thongSoKyThuat.MaThongSo = maThongSo; return thongSoKyThuat; }