Web.UI/Article.cs

(完整代码) 1KB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using cosmos.Common;

namespace cosmos.Web.UI
{
    public class Article
    {
        /// <summary>
        /// 新闻调用类(文字)
        /// </summary>
        /// <param name="top">显示条数</param>
        /// <param name="txtNum">显示字数</param>
        /// <param name="isTime">显示时间</param>
        /// <param name="chrico">显示符号</param>
        /// <param name="where">查询条件</param>
        /// <param name="orderby">排序条件</param>
        /// <returns></returns>
        public static string ViewTxtList(int top, int txtNum, int isTime, string chrico, string strWhere, string orderby)
        {
            cosmos.BLL.NewsInfo bll = new cosmos.BLL.NewsInfo();
            StringBuilder strTxt = new StringBuilder();
            DataSet ds = bll.GetList(top, strWhere, orderby);
            if (ds.Tables[0].Rows.Count > 0)
            {
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    DataRow dr = ds.Tables[0].Rows[i];
                    strTxt.Append("<li>");

                    strTxt.Append(chrico);
                    strTxt.Append("<a target=\"_blank\" title=\"" + dr["Title"].ToString() + " + [" + string.Format("{0:d}", dr["PubTime"]) + "]\" href=\"NewsView.aspx?id=" + dr["Id"] + "\">" + Utils.CutString(dr["Title"].ToString(), txtNum) + "</a>");
                    if (isTime == 1)
                    {
                        strTxt.Append("<span>  [" + string.Format("{0:yyyy-MM-dd}", dr["PubTime"]) + "]</span>");
                    }
                    strTxt.Append("</li>");
                }
            }
            else
            {
                strTxt.Append("<li>暂无数据显示...</li>");
            }
            return strTxt.ToString();
        }
    }
}

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。