using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using JuSNS.Factory;
using JuSNS.Model;
using JuSNS.Config;

namespace JuSNS.Home
{
    public class Comment
    {
        JuSNS.Factory.IComment dal;
        public Comment()
        {
            dal = DataAccess.CreateComment();
        }

        /// <summary>
        /// 获取评论
        /// </summary>
        /// <param name="UserID">被评论的ID</param>
        /// <param name="DateNum">mini表示心情日记的回复。其他的，写的人补上</param>
        /// <returns></returns>
        public IDataReader GetCommentList(int id, string Type)
        {
            return dal.GetCommentList(id, Type);
        }

        /// <summary>
        /// 得到评论数
        /// </summary>
        /// <param name="id">信息ID</param>
        /// <param name="Type">mini表示心情日记。其他的，写的人补上</param>
        /// <returns></returns>
        public int GetCommentCount(int id, string Type)
        {
            return dal.GetCommentCount(id, Type);
        }

        /// <summary>
        /// 删除评论
        /// </summary>
        /// <param name="id">信息ID</param>
        /// <param name="Type">mini表示心情日记。其他的，写的人补上</param>
        /// <returns></returns>
        public void DelComment(int UserID,int id, string Type)
        {
            dal.DelComment(UserID, id, Type);
        }

        /// <summary>
        /// 插入评论
        /// </summary>
        /// <param name="UserID">用户ID</param>
        /// <param name="Type">mini表示心情日记。其他的，写的人补上</param>
        /// <param name="InfoID">被评论的ID</param>
        /// <param name="Content">评论内容</param>
        /// <param name="CommentID">回复的ID</param>
        /// <returns></returns>
        public int AddComment(int UserID,string Type,int InfoID,string Content,int CommentID)
        {
            return dal.AddComment(UserID, Type, InfoID, Content, CommentID);
        }
    }
}
