using System;
using System.Collections.Generic;
using System.Text;
using JuSNS.Model;
using JuSNS.Common;
using JuSNS.Factory;


namespace JuSNS.Home
{
    /// <summary>
    /// 投票评论类
    /// </summary>
    public class VoteComm
    {
        private IVoteComm dal;

        /// <summary>
        /// 构造函数
        /// </summary>
        public VoteComm()
        {
            dal = DataAccess.CreateVoteComm();
        }

        /// <summary>
        /// 添加投票评论
        /// </summary>
        /// <param name="Info">投票评论实体类</param>
        /// <returns>添加成功返回1</returns>
        public int Add(VoteCommInfo Info, int uid)
        {
            return dal.Add(Info, uid);
        }

        /// <summary>
        /// 回复数量
        /// </summary>
        /// <param name="PID">评论编号</param>
        public int ReplyCnt(int PID)
        {
            return dal.ReplyCnt(PID);
        }

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

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

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