using System;
using System.Data;
using System.Collections.Generic;
using System.Reflection;
using JuSNS.Model;

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

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

       /// <summary>
        /// 删除评论
        /// </summary>
        /// <param name="id">信息ID</param>
        /// <param name="Type">mini表示心情日记。其他的，写的人补上</param>
        /// <returns></returns>
        void DelComment(int UserID, int id, string 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>
        int AddComment(int UserID, string Type, int InfoID, string Content, int CommentID);
    }


    public sealed partial class DataAccess
    {
        public static IComment CreateComment()
        {
            string className = path + ".Comment";
            return (IComment)Assembly.Load(path).CreateInstance(className);
        }
    }
}
