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

namespace JuSNS.Factory
{
    /// <summary>
    /// 投票评论类接口
    /// </summary>
    public interface IVoteComm
    {
        /// <summary>
        /// 添加投票评论
        /// </summary>
        /// <param name="Info">投票评论实体类</param>
        /// <returns>添加成功返回1</returns>
        int Add(VoteCommInfo Info, int uid);

        /// <summary>
        /// 回复数量
        /// </summary>
        /// <param name="PID">评论编号</param>
        int ReplyCnt(int PID);

        /// <summary>
        /// 删除回复
        /// </summary>
        /// <param name="ID">回复编号</param>
        /// <param name="UserID">会员编号</param>
        void Del(int ID, int UserID);

        /// <summary>
        /// 取得评论列表
        /// </summary>
        /// <param name="PID">父级编号</param>
        /// <returns></returns>
        List<VoteCommInfo> List(int PID);

        /// <summary>
        /// 取得会员评论内容信息
        /// </summary>
        /// <param name="UserID">会员编号</param>
        /// <param name="VoteID">投票编号</param>
        /// <returns>返回投票评论实体类</returns>
        VoteCommInfo Info(int UserID, int VoteID);

    }

    public sealed partial class DataAccess
    {
        public static IVoteComm CreateVoteComm()
        {
            string className = path + ".VoteComm";
            return (IVoteComm)Assembly.Load(path).CreateInstance(className);
        }
    }
}
