Example #1
0
        public static string BuildContentListItem(List <ProductsInfo> oList, int iType, int numColum, int iPage)
        {
            //var oData = CacheController.GetListProduct(iType, numColum);
            var oData = CacheController.GetListProduct(iType, iPage);

            if (oData != null)
            {
                return(oData.ToString());
            }

            StringBuilder sb = new StringBuilder();
            int           i  = 0;

            sb = new StringBuilder();
            foreach (ProductsInfo o in oList)
            {
                if ((i % numColum) == (numColum - 1))
                {
                    sb.AppendFormat("<div class=\"box_sanpham cuoi\">");
                }
                else
                {
                    sb.AppendFormat("<div class=\"box_sanpham\">");
                }
                sb.Append("<div class=\"childContent\">");
                sb.AppendFormat("<a class=\"group1\" href=\"{0}\" border:\"0\" title=\"{1}\"><img alt=\"\" src=\"{2}\"/></a>", GetPathImage(o), o.s_Description, GetPathThumb(o));
                sb.Append("</div>");
                sb.AppendFormat("<p>{0}</p>", o.s_Name);
                sb.Append("</div>");
                i++;
            }
            string s = sb.ToString();

            //CacheController.GetListProduct(iType, numColum,s);
            CacheController.GetListProduct(iType, iPage, s);
            return(s);
        }