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 News
    {
        JuSNS.Factory.INews dal;
        public News()
        {
            dal = DataAccess.CreateNews();
        }

        public IDataReader GetNewsClass(int ParentID)
        {
            return dal.GetNewsClass(ParentID);
        }

        public DataTable GetNewsClassD(int ParentID)
        {
            return dal.GetNewsClassD(ParentID);
        }

        public NewsInfo GetNewsId(int NewsID, int Num)
        {
            return dal.GetNewsId(NewsID,Num);
        }

        public int InsertNewsComment(int UserID,int NewsID, string Content)
        {
           return  dal.InsertNewsComment(UserID, NewsID, Content);
        }

        public DataTable GetSysNews(int Num,int isSys)
        {
            return dal.GetSysNews(Num, isSys);
        }

        public int DelNews(int ID,int flg)
        {
            return dal.DelNews(ID,flg);
        }

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

        public int UpdateNews(NewsInfo ns, int NewsID)
        {
            return dal.UpdateNews(ns, NewsID);
        }

        public int DeleteNews(int NewsID)
        {
            return dal.DeleteNews(NewsID);
        }

        public DataTable GetNewsClassID(int ID)
        {
            return dal.GetNewsClassID(ID);
        }

        public int UpdateNewsClassID(string className,int id)
        {
            return dal.UpdateNewsClassID(className,id);
        }
    }
}
