Ejemplo n.º 1
0
        public string GenerateTeamProductHtml()
        {
            StringBuilder    teamHtmlStringBuilder = new StringBuilder();
            var              iCategoryService      = EngineContext.Current.Resolve <ICategoryService>();
            IList <Category> teamCategoryProducts  = iCategoryService.GetAllCategoriesByParentCategoryId(this.id);
            //var orderedTeamCategoryProducts = teamCategoryProducts.OrderBy(x => x.DisplayOrder).ToList();

            var iProductService = EngineContext.Current.Resolve <IProductService>();


            teamHtmlStringBuilder.Append("<div class='pricing bottommargin clearfix'>");

            foreach (var category in teamCategoryProducts)
            {
                SportsTeam customExtendedCategoryData            = new SportsTeam(category.Id);
                IPagedList <ProductCategory> productCategoryList = iCategoryService.GetProductCategoriesByCategoryId(category.Id);
                Product featuredProductData = iProductService.GetProductById(customExtendedCategoryData.featuredProductId);



                teamHtmlStringBuilder.Append("<div class='col-md-3'>");
                if (customExtendedCategoryData.isFeatured == true)
                {
                    teamHtmlStringBuilder.Append("    <div class='pricing-box best-price'>");
                }
                else
                {
                    teamHtmlStringBuilder.Append("    <div class='pricing-box'>");
                }
                teamHtmlStringBuilder.Append("        <div class='pricing-title'>");
                teamHtmlStringBuilder.Append("            <h3>" + category.Name + "</h3>");
                teamHtmlStringBuilder.Append("        </div>");
                teamHtmlStringBuilder.Append("        <div class='gateway-image'><img src='" + customExtendedCategoryData.mainPicturePath + "'/></div>");
                teamHtmlStringBuilder.Append("        <div class='pricing-features'>");
                teamHtmlStringBuilder.Append("            <ul>");
                teamHtmlStringBuilder.Append("                <li>" + featuredProductData.Width.ToString("f1") + "\" X " + featuredProductData.Length.ToString("f1") + "\"</li> ");
                teamHtmlStringBuilder.Append("                <li>" + category.Name + " top</li>");
                teamHtmlStringBuilder.Append("                <li></li>"); //spec attributes stuff
                teamHtmlStringBuilder.Append("                <li>" + productCategoryList.Count + " designs available</li>");
                teamHtmlStringBuilder.Append("            </ul>");
                teamHtmlStringBuilder.Append("            <div class='gateway-pricing'>Starting at $" + (int)featuredProductData.Price + "</div>");
                teamHtmlStringBuilder.Append("        </div>"); //ask aboud naveeds image front/back handler
                if (customExtendedCategoryData.isFeatured == true)
                {
                    teamHtmlStringBuilder.Append("        <div class='pricing-action'><a href='' class='team-handle button button-rounded button-reveal button-large button-green tright'><i class='icon-angle-right'></i><span>Select</span></a></div>");
                }
                else
                {
                    teamHtmlStringBuilder.Append("        <div class='pricing-action'><a href='' class='team-handle button button-rounded button-reveal button-large button-blue tright'><i class='icon-angle-right'></i><span>Select</span></a></div>");
                }
                teamHtmlStringBuilder.Append("    </div>");
                teamHtmlStringBuilder.Append("</div>");
            }

            teamHtmlStringBuilder.Append("</div>");

            return(teamHtmlStringBuilder.ToString());
        }
Ejemplo n.º 2
0
        public List <SportsTeam> CreateSportsTeamListFromCategories(IList <Category> teamList)
        {
            List <SportsTeam> teams = new List <SportsTeam>();

            ICacheManager cacheManager = EngineContext.Current.Resolve <ICacheManager>();

            if (teamList.Count > 0)
            {
                teams = cacheManager.Get("sportsTeamList" + teamList[0].ParentCategoryId, 60, () => {
                    foreach (var team in teamList)
                    {
                        SportsTeam curTeam = new SportsTeam(team.Id);
                        teams.Add(curTeam);
                    }

                    return(teams);
                });
            }

            return(teams);
        }