Hidistro.SqlDal/Weibo/ReplyDao.cs

(开头部分) 8KB

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

namespace Hidistro.SqlDal.Weibo
{
    using Hidistro.Core;
    using Hidistro.Entities;
    using Hidistro.Entities.Weibo;
    using Microsoft.Practices.EnterpriseLibrary.Data;
    using System;
    using System.Collections.Generic;
    using System.Data;
    using System.Data.Common;

    public class ReplyDao
    {
        private Database database = DatabaseFactory.CreateDatabase();

        public bool DeleteReplyInfo(int ReplyInfoid)
        {
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("DELETE Weibo_Reply WHERE id = @id");
            this.database.AddInParameter(sqlStringCommand, "id", DbType.Int32, ReplyInfoid);
            return (this.database.ExecuteNonQuery(sqlStringCommand) > 0);
        }

        public bool DeleteReplyKeyInfo(int ReplyKeyInfoid)
        {
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("DELETE Weibo_ReplyKeys WHERE id = @id");
            this.database.AddInParameter(sqlStringCommand, "id", DbType.Int32, ReplyKeyInfoid);
            return (this.database.ExecuteNonQuery(sqlStringCommand) > 0);
        }

        private int GetAllWeibo_ReplyKeysCount()
        {
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("select count(*) from Weibo_ReplyKeys");
            return (1 + Convert.ToInt32(this.database.ExecuteScalar(sqlStringCommand)));
        }

        public DataTable GetReplyAll(int type)
        {
            DataTable table = new DataTable();
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT *  from vw_Hishop_ReplyKeysReply where type=" + type);
            using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand))
            {
                return DataHelper.ConverDataReaderToDataTable(reader);
            }
        }

        public IList<ReplyInfo> GetReplyInfo(int ReplyKeyId)
        {
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM Weibo_Reply WHERE ReplyKeyId = @ReplyKeyId");
            this.database.AddInParameter(sqlStringCommand, "ReplyKeyId", DbType.Int32, ReplyKeyId);
            using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand))
            {
                return ReaderConvert.ReaderToList<ReplyInfo>(reader);
            }
        }

        public ReplyInfo GetReplyInfoMes(int id)
        {
            DbCommand sqlStringCommand = this.database.GetSqlStringCommand("SELECT * FROM Weibo_Reply WHERE id = @id");
            this.database.AddInParameter(sqlStringCommand, "id", DbType.Int32, id);
            using (IDataReader reader = this.database.ExecuteReader(sqlStringCommand))
后面还有 93 行代码,购买后查看完整代码

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

AI 解读 AI

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

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