public virtual string GetProductUrl(IProductSummary summary) {
            if (summary != null) {
                return GetProductUrl(summary.ProductID);
            } else {
                try {
                    return GetCatalogueNodeUrl(_module.CatalogueViewer.GetRootCategoryView(_module.Section.Node.Site.Id, _module.Section.Node.Culture).CurrentNode.NodeID);
                } catch { }
            }

            return string.Empty;
        }
        public virtual void PopulateFullProductSummary(IProductSummary product) {

            foreach (ProductSynonym s in Synonyms) {
                product.SynonymList.Add(s);
            }

            foreach (ProductImage epi in Images) {
                IImage image = new Domain.Catalogue.Image();
                ImageHelper.CopyImage(epi, image);
                product.ProductImages.Add(image);
            }

            if (StockLevel > 0) {
                product.StockedIndicator = 1;
            }
        }
        public virtual void PopulateProductSummary(IProductSummary product) {

            product.Description = ProductDescription;
            product.ItemCode = ItemCode;
            product.Name = ProductName;
            product.ProductID = Convert.ToInt64(ProductID);
            product.PriceDescription = BasePriceDescription;
            product.Price = BasePrice;
            product.ShortDescription = ShortProductDescription;
            product.AdditionalInformation = AdditionalInformation;
            product.Features = Features;
        }
        private SearchContent CreateSearchContentName(string category, IProductSummary product, CatalogueUrlHelper urlHelper) {

            SearchContent sc = new SearchContent();
            sc.Title = product.Name;

            sc.Contents = product.Name;

            sc.Author = "simon";
            sc.ModuleType = this.Section.ModuleType.Name;
            sc.Path = urlHelper.GetProductUrl(product);
            sc.Category = category;
            sc.Site = (this.Section.Node != null ? this.Section.Node.Site.Name : String.Empty);
            sc.DateCreated = DateTime.Now;
            sc.DateModified = DateTime.Now;
            sc.SectionId = this.Section.Id;

            if (sc.Title == null || sc.Title.Length == 0) {
                sc.Title = product.Name;
            }

            if (sc.Contents == null || sc.Contents.Length == 0) {
                sc.Contents = "Item " + (sc.Title);
            }

            sc.Summary = sc.Contents;

            return sc;
        }
 protected string GetAttrVal(IProductSummary summary, string arributeReference) {
     try {
         return Product.GetProductAttributeValueByReference(summary.ProductID, arributeReference);
     } catch (Exception f) {
         LogManager.GetLogger(GetType()).Error(f);
         return "";
     }
 }
        private string GetProductLine(IProductSummary summary) {
            //This really isn't very efficient!
            try {
                using (SpHandler sph = new SpHandler("getProductLineForProduct", new SqlParameter("@productID", summary.ProductID))) {
                    sph.ExecuteReader();
                    if (sph.DataReader.Read()) {
                        return sph.DataReader["categoryname"].ToString();
                    }
                }
            } catch (Exception f) {
                LogManager.GetLogger(GetType()).Error(f);
            }

            return "";
        }
        private void RenderProductNameAndDescription(RepeaterItemEventArgs e, IProductSummary ps) {

            HyperLink hplProductName = (HyperLink)e.Item.FindControl("hplProductName");
            Literal litDescription = (Literal)e.Item.FindControl("litDescription");

            litDescription.Text = ps.ShortDescription;
            hplProductName.Text = ps.Name;
            hplProductName.NavigateUrl = UrlHelper.GetProductUrl(ps.ProductID);
            hplProductName.Visible = true;
        }
        private void RenderProductImage(RepeaterItemEventArgs e, IProductSummary ps) {

            Image imgProduct = (Image)e.Item.FindControl("imgProduct");

            imgProduct.Visible = true;
            imgProduct.ImageUrl = WebHelper.GetImagePathWeb() + "blackberry8100_1.jpg"; //default Image

            if (ps.ProductImages.Count > 0) {
                IImage image = ps.ProductImages[0];
                imgProduct.ImageUrl = WebHelper.GetImagePathWeb() + image.Url;
            }
        }
 public decimal GetScaledPrice(IProductSummary product) {
     return GetScaledPrice(product.ProductID, product.Price);
 }