Пример #1
0
        private void BindSaleAd()
        {
            string where = " ExpiredTime > '" + DateTime.Now.ToString("yyyy-MM-dd") + "'";
            List <ClassLibrary.Model.SaleAdvertise> sadList = adBll.GetModelList(4, where, "SaleOrder Asc, CreatedTime Desc");
            StringBuilder sb = new StringBuilder();

            foreach (ClassLibrary.Model.SaleAdvertise model in sadList)
            {
                sb.AppendFormat("<li><a href='{0}' title='{1}'><img src='{2}' alt='' width='272' height='345' /></a>",
                                model.LinkUrl, model.Title, SysConfig.UploadFilePathAdImg + model.Img).AppendLine();
                sb.AppendFormat("<a class='showimg' href='{0}' target='_blank' rel='nofollow'>查看</a></li>",
                                SysConfig.webSite + SysConfig.UploadFilePathAdImg + model.Img).AppendLine();
            }
            DataSaleAd = sb.ToString();
            if (DataSaleAd == "")
            {
                hasSaleAd = false;
            }
        }
Пример #2
0
        private void BindRouteAds()
        {
            string where = " ExpiredTime > '" + DateTime.Now.ToString("yyyy-MM-dd") + "'";
            List <ClassLibrary.Model.SaleAdvertise> saList = saBll.GetModelList(4, where, "SaleOrder Asc, CreatedTime Desc");

            if (saList.Count > 0)
            {
                StringBuilder sb = new StringBuilder();
                sb.AppendLine("<div class='route_sale'>");
                sb.AppendLine("<div class='route_sale_top'>限时特价</div>");
                sb.AppendLine("<div class='route_sale_items'>");
                foreach (ClassLibrary.Model.SaleAdvertise model in saList)
                {
                    sb.AppendFormat("<a href='{0}' title='{1}' target='_blank' >", model.LinkUrl, model.Title);
                    sb.AppendFormat("<img src='{0}' alt='' width='211px' height='254px' /></a>", SysConfig.UploadFilePathAdImg + model.Img);
                }
                sb.AppendLine("</div>");
                sb.AppendLine("</div>");

                routelistAds = sb.ToString();
            }
        }