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

namespace JuSNS.Factory
{
    public interface INews
    {
        IDataReader GetNewsClass(int ParentID);
        DataTable GetNewsClassD(int ParentID);
        NewsInfo GetNewsId(int NewsID,int Num);
        int InsertNewsComment(int UserID, int NewsID, string Content);
        DataTable GetSysNews(int Num, int isSys);
        int DelNews(int ID,int flg);
        void DelNewsComment(int UserID, int ID);
        int UpdateNews(NewsInfo ns, int NewsID);
        int DeleteNews(int NewsID);
        DataTable GetNewsClassID(int ID);
        int UpdateNewsClassID(string className, int ID);
    }

    public sealed partial class DataAccess
    {
        public static INews CreateNews()
        {
            string className = path + ".News";
            return (INews)Assembly.Load(path).CreateInstance(className);
        }
    }
}
