public RecentViewItem(RecentViewItem item) { _pro_bianhao = item.Pro_bianhao; _ProductID = item.ProductID; _ProductName = item.ProductName; _PicUrl = item.PicUrl; }
/// <summary> /// 向已浏览过实体中添加某商品 /// </summary> /// <param name="productID">产品编号</param> /// <param name="productName">产品名称</param> /// <param name="pro_bianhao">编号</param> /// <param name="picUrl">图片地址</param> public void AddViewItem(string pro_bianhao, int productID, string productName, string picUrl) { RecentViewItem item = (RecentViewItem)_RecentViewItems[productID]; if (item == null) { _RecentViewItems.Add(productID, new RecentViewItem(pro_bianhao, productID, productName, picUrl)); } }
/// <summary> /// 从已浏览过实体中移除某商品 /// </summary> /// <param name="productID"></param> public void RemoveViewItem(int productID) { RecentViewItem item = (RecentViewItem)_RecentViewItems[productID]; if (item == null) { return; } else { _RecentViewItems.Remove(productID); } }
public void AddViewItem(RecentViewItem item) { _RecentViewItems.Add(item.ProductID, item); }