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

namespace JuSNS.Home
{
    public class Ask
    {
        private IAsk dal;

        public DataTable GetAskClass(int ParentID, int Num)
        {
            return dal.GetAskClass(ParentID, Num);
        }

        public DataTable GetXAskList(int Flag, int Num, int ClassID)
        {
            return dal.GetXAskList(Flag, Num, ClassID);
        }

        public int Add(JuSNS.Model.AskInfo ask, int rJiFen, int flg)
        {
            return dal.Add(ask, rJiFen, flg);
        }

        public int Del(int UserID, int ID)
        {
            return dal.Del(UserID, ID);
        }

        public AskInfo GetAskInfo(int ID)
        {
            return dal.GetAskInfo(ID);
        }

        public void UpdateAskClick(int ID)
        {
            dal.UpdateAskClick(ID);
        }
        public void UpdateAskBest(int ID,int UserID)
        {
            dal.UpdateAskBest(ID, UserID);
        }

        public List<AskInfo> GetChildAskList(int ID)
        {
            return dal.GetChildAskList(ID);
        }

        public int GetChildCount(int UserID, int ID)
        {
            return dal.GetChildCount(UserID, ID);
        }

        public int askClassAdd(int ParentID,string className)
        {
            return dal.askClassAdd(ParentID, className);
        }

        public int DeleteAskClass(int ID)
        {
            return dal.DeleteAskClass(ID);
        }

        public int EditInfo(int UserID,int qID,string Content)
        {
            return dal.EditInfo(UserID, qID, Content);
        }

        /// <summary>
        /// ¹¹Ôìº¯Êý
        /// </summary>
        public Ask()
        {
            dal = DataAccess.CreateAsk();
        }

    }
}
