DAL/NewsService.cs

(开头部分) 38KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Data;
using System.Text;
using System.Data.SqlClient;
using Model;
using System.Collections.Generic;

namespace DAL
{
	/// <summary>
	/// 数据访问类NewsService。
	/// </summary>
	public class NewsService
	{
		public NewsService()
		{}
		#region  成员方法

        /// <summary>
        /// 审核信息更新
        /// </summary>
        /// <param name="id"></param>
        /// <param name="num"></param>
        /// <returns></returns>
        public static int UpdateCheckInfo(int id, int num)
        {
            string sql = "update News set areaId = " + num + " where id = " + id;
            return DBHelperSQL.ExecuteSql(sql);
        }

        /// <summary>
        /// 专题页顶部推荐最新
        /// </summary>
        /// <returns></returns>
        public static News GetTopicTjNew()
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("select  top 1 * from News ");
            strSql.Append(" where newsType in(select id from NewsType where parentId = 2) and is_tj = 1 and newImg <> '' and is_hot= 1 order by id desc");
            Model.News model = new Model.News();
            DataSet ds = DBHelperSQL.Query(strSql.ToString());
            if (ds.Tables[0].Rows.Count > 0)
            {
                if (ds.Tables[0].Rows[0]["id"].ToString() != "")
                {
                    model.id = int.Parse(ds.Tables[0].Rows[0]["id"].ToString());
                }
                model.title = ds.Tables[0].Rows[0]["title"].ToString();
                model.pageName = ds.Tables[0].Rows[0]["pageName"].ToString();
                if (ds.Tables[0].Rows[0]["newsType"].ToString() != "")
                {
                    model.newsType = int.Parse(ds.Tables[0].Rows[0]["newsType"].ToString());
                }
                model.newImg = ds.Tables[0].Rows[0]["newImg"].ToString();
                model.newsContent = ds.Tables[0].Rows[0]["newsContent"].ToString();
                model.keyword = ds.Tables[0].Rows[0]["keyword"].ToString();
                model.newsDesc = ds.Tables[0].Rows[0]["newsDesc"].ToString();
                model.linkurl = ds.Tables[0].Rows[0]["linkurl"].ToString();
                if (ds.Tables[0].Rows[0]["is_tj"].ToString() != "")
                {
后面还有 873 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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