rss.cs

来自「最好用的站点内容管理系统 全部源代码都有」· CS 代码 · 共 46 行

CS
46
字号
//======================================================
//==     (c)2008 aspxcms inc by NeTCMS v1.0              ==
//==          Forum:bbs.aspxcms.com                   ==
//==         Website:www.aspxcms.com                  ==
//======================================================
using System;
using System.Data;
using System.Data.SqlClient;
using NetCMS.DALFactory;
using NetCMS.Model;
using System.Text.RegularExpressions;
using System.Text;
using System.Reflection;
using NetCMS.DALProfile;
using NetCMS.Config;

namespace NetCMS.DALSQLServer
{
    public class Rss : DbBase, IRss
    {
        public int sel(string ClassID)
        {
            string Sql = "select count(*) from " + Pre + "news_Class where ParentID='" + ClassID + "' and isLock=0 and isRecyle=0 and IsURL=0";
            return (int)DbHelper.ExecuteScalar(CommandType.Text, Sql, null);
        }

        public DataTable getxmllist(string ClassID)
        {
            string _datalib = Pre + "_news";
            string getclassSQL = "Select DataLib from " + Pre + "news_class where ClassID='" + ClassID + "'";
            DataTable dt = DbHelper.ExecuteTable(CommandType.Text, getclassSQL, null);
            if (dt != null)
            {
                if (dt.Rows.Count > 0)
                {
                    _datalib = dt.Rows[0]["DataLib"].ToString();
                }
                dt.Clear(); dt.Dispose();
            }
            string Sql = "select top 5 NewsTitle,CreatTime from " + _datalib + " where ClassID='" + ClassID + "' and isLock=0 and isRecyle=0 order by orderID asc,id desc";
            DataTable rdr = DbHelper.ExecuteTable(CommandType.Text, Sql, null);
            return rdr;
        }
    }
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?