Ejemplo n.º 1
0
        private string GetLastNew()
        {
            int       iDescLength = 110;
            DataTable dt          = new DAL.CategoryDAL().GetLastNewZT(sCategoryPath, iYIndex + 1);

            if (dt == null || dt.Rows.Count == 0)
            {
                return(string.Empty);
            }
            DataTable dtArticle = new DAL.Article().GetArticleList(dt.Rows[0]["CategoryGUID"].ToString(), false, 3);
            string    sTitle    = dt.Rows[0]["CategoryName"].ToString();
            string    sContent  = new DAL.CategoryDAL().GetZTSummaryFromTitle(sZTSummaryAlias, sTitle);


            sContent = DAL.Article.RemoveHtml(sContent);
            string sDesc = sContent;

            if (sContent.Length > iDescLength)
            {
                sContent = sContent.Replace(" ", "");//*CC*
                sContent = sContent.Substring(0, iDescLength);
                sDesc    = sDesc.Remove(0, iDescLength);
                if (sDesc.StartsWith(">"))
                {
                    sDesc.Remove(0, 1);
                }
            }

            string sDiv = "<div class=\"SpecialAttentionNewLeft\">";

            sDiv += string.Format("<a href=\"SpecialAttentionLite.aspx?ID={0}&Title={1}\" title=\"{2}\" target=\"_blank\">", dt.Rows[0]["CategoryGUID"].ToString(), HttpUtility.UrlEncode(sTitle), sTitle);
            sDiv += "<img width=\"276\" height=\"195\" src=\"ShowZTImage.aspx?Title=" + HttpUtility.UrlEncode(sTitle) + "\" alt=\"\" border=\"0\" /></a>";
            sDiv += "</div><div class=\"SpecialAttentionNewRight\"><div class=\"SpecialAttentionNewTitle\">";
            sDiv += string.Format("<a href=\"SpecialAttentionLite.aspx?ID={0}&Title={1}\" target=\"_blank\">{2}</a>", dt.Rows[0]["CategoryGUID"].ToString(), HttpUtility.UrlEncode(sTitle), DataProcessing.SubstringText(sTitle, 19)); //*CC*
            sDiv += "</div>";
            sDiv += string.Format("<div class=\"ZTSummary\" data-tooltip=\"{0}\" data-placement=\"bottom\">", string.IsNullOrEmpty(sDesc) ? string.Empty : string.Format("<div class='divTooltip'>{0}</div>", sDesc));
            sDiv += string.Format("<a href=\"SpecialAttentionLite.aspx?ID={0}&Title={1}\" target=\"_blank\">", dt.Rows[0]["CategoryGUID"].ToString(), HttpUtility.UrlEncode(sTitle)) + sContent + "</a>";
            sDiv += "</div><table class=\"SpecialAttentionNewTable\" style=\"table-layout:fixed;\" width=\"355\">";
            if (dtArticle.Rows.Count > 0)
            {
                for (int i = 0; i < dtArticle.Rows.Count; i++)
                {
                    sDiv += "<tr><td class=\"SpecialAttentionNewTableTitle SpecialAttentionNewTableTitleZTTop\" style=\"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;\">";
                    sDiv += string.Format("<a href=\"ShowVideo.aspx?ID={0}\" title=\"{1}\" target=\"_blank\">{2}</a></td>", dtArticle.Rows[i]["ArticleGUID"].ToString(), dtArticle.Rows[i]["Title"].ToString(), DataProcessing.SubstringText(dtArticle.Rows[i]["Title"].ToString(), 18));//*CC*
                    sDiv += "<td align=\"right\">" + DateTime.Parse(dtArticle.Rows[i]["CreateTime"].ToString()).ToString("yyyy-MM-dd") + "</td></tr>";
                }
            }
            sDiv += "</table></div>";
            return(sDiv);
        }