Пример #1
0
        /// <summary>
        /// 文化动态
        /// </summary>
        public void LoadCultureTrends()
        {
            DataTable dtTrends = WebInfoLogic.GetWebInfoRoll(5);

            string sPicUrls = "";
            string sLinks   = "";
            string sTexts   = "";
            string url      = Request.Url.ToString().ToLower().Replace("index.aspx", "InfoDetail.aspx?InfoID=");

            foreach (DataRow dr in dtTrends.Rows)
            {
                sPicUrls += SystemParaLogic.GetSystemParam("MiniatureDummyPath") + dr["MiniatureFileName"].ToString() + "|";
                sLinks   += url + dr["InfoID"].ToString() + "|";
                sTexts   += dr["Title"].ToString() + "|";
            }

            if (dtTrends.Rows.Count > 0)
            {
                sPicUrls = sPicUrls.Substring(0, sPicUrls.Length - 1);
                sLinks   = sLinks.Substring(0, sLinks.Length - 1);
                sTexts   = sTexts.Substring(0, sTexts.Length - 1);
            }
            divPicNews.InnerHtml = "<script type=\"text/javascript\">getFlashNews(\"" + sPicUrls + "\",\"" + sLinks + "\",\"" + sTexts + "\");</script>";

            LoadCultureTrendsRight();
        }
Пример #2
0
        /// <summary>
        /// 各类型信息
        /// </summary>
        public void LoadData(long InfoCategory)
        {
            strTitle   = new StringBuilder(500);
            strContent = new StringBuilder(500);
            strImg     = new StringBuilder(200);
            strNews    = new StringBuilder(2000);

            DataTable dtNews = WebInfoLogic.GetCulumnInfo(InfoCategory, 5);

            if (dtNews.Rows.Count > 0)
            {
                strNews.Append("<table border=\"0\" style=\"width: 100%;\">");
                for (int i = 0; i < dtNews.Rows.Count; i++)
                {
                    if (i == 0)
                    {
                        strTitle.Append("<a href=\"InfoDetail.aspx?InfoID=" + ConvertHelper.ConvertLong(dtNews.Rows[i]["InfoID"].ToString()));
                        strTitle.Append("\" target=\"_blank\" title=\"标    题:" + dtNews.Rows[i]["Title"].ToString() + "&#10;发布日期:");
                        strTitle.Append(ConvertHelper.ConvertDateTime(dtNews.Rows[i]["PubDate"].ToString()).ToShortDateString() + "&#10;访问次数:");
                        strTitle.Append(dtNews.Rows[i]["ClickRate"].ToString() + "\">");
                        strTitle.Append(SelectInfo(dtNews.Rows[0]["Title"].ToString().Trim(), 13) + "</a>");

                        strContent.Append("<span class=\"hidetext\">");
                        strContent.Append(Server.HtmlDecode(dtNews.Rows[0]["InfoContent"].ToString()));
                        strContent.Append("</span>");

                        if (CheckImageUrl(dtNews.Rows[0]["MiniatureFileName"].ToString()))
                        {
                            strImg.Append("<img width=\"105\" height=\"72\" src=\"" + SelectImage(InfoCategory));
                            strImg.Append("\" />");
                        }
                        else
                        {
                            strImg.Append("<img width=\"105\" height=\"72\" src=\"" + SystemParaLogic.GetSystemParam("MiniatureDummyPath") + dtNews.Rows[0]["MiniatureFileName"].ToString() + "\"/>");
                        }
                    }
                    else
                    {
                        strNews.Append("<tr><td style=\"width:60%;\"><ul>");
                        strNews.Append("<li><a class=\"hideText\" style=\"width:200px;\" href=\"InfoDetail.aspx?InfoID=" + ConvertHelper.ConvertLong(dtNews.Rows[i]["InfoID"].ToString()));
                        strNews.Append("\" target=\"_blank\" title=\"标    题:" + dtNews.Rows[i]["Title"].ToString() + "&#10;发布日期:");
                        strNews.Append(ConvertHelper.ConvertDateTime(dtNews.Rows[i]["PubDate"].ToString()).ToShortDateString() + "&#10;访问次数:");
                        strNews.Append(dtNews.Rows[i]["ClickRate"].ToString() + "\">");
                        strNews.Append(dtNews.Rows[i]["Title"].ToString().Trim() + "</a></li></ul>");
                        strNews.Append("</td><td style=\"width:40%;\">");
                        strNews.Append("[" + dtNews.Rows[i]["PubDate"].ToString() + "]</td></tr>");
                    }
                }
                strNews.Append("</table>");
            }
            else
            {
                strTitle.Remove(0, strTitle.Length);
                strContent.Remove(0, strContent.Length);
                strNews.Remove(0, strNews.Length);
            }
        }