/// <summary>Creates a new, empty LastViewedProductEntity object.</summary>
        /// <returns>A new, empty LastViewedProductEntity object.</returns>
        public override IEntity Create()
        {
            IEntity toReturn = new LastViewedProductEntity();

            // __LLBLGENPRO_USER_CODE_REGION_START CreateNewLastViewedProduct
            // __LLBLGENPRO_USER_CODE_REGION_END
            return(toReturn);
        }
示例#2
0
        public void AddLastViewedProduct(int productId, DateTime time, string ipAdress)
        {
            DateTime t = DateTime.Parse(time.ToShortDateString());

            if (CheckViewList(productId, t, ipAdress))
            {
                LastViewedProductEntity lastViewedProduct = new LastViewedProductEntity();
                lastViewedProduct.ProductId  = productId;
                lastViewedProduct.ViewedTime = t;
                lastViewedProduct.IpAdrees   = ipAdress;
                lastViewedProduct.Save();
            }
        }