using System.Collections.Generic;

namespace Stat.BLL
{
    /// <summary>
    /// 
    /// </summary>
    public class News
    {
        private static IDAL.INews dal = DALFactory.AbstractFactory.GetInstance().CreateNews();

        /// <summary>
        /// 添加信息
        /// </summary>
        /// <returns></returns>
        public static bool Insert(Stat.Model.News model)
        {

            return dal.Insert(model);
        }
        /// <summary>
        /// 修改信息
        /// </summary>
        /// <returns></returns>
        public static bool Update(Stat.Model.News model)
        {

            return dal.Update(model);
        }
        /// <summary>
        ///删除信息
        /// </summary>
        /// <returns></returns>
        public static bool Delete(int id)
        {

            return dal.Delete(id);
        }
        /// <summary>
        /// 获取信息
        /// </summary>
        /// <returns></returns>
        public static IList<Stat.Model.News> Get(int id)
        {
            return dal.Get(id);
        }
        /// <summary>
        /// 获取信息
        /// </summary>
        /// <returns></returns>
        public static IList<Stat.Model.News> GetTop1(int Num, int IsTop)
        {
            return dal.GetTop1(Num, IsTop);
        }

        /// <summary>
        /// 获取新闻数据
        /// </summary>
        /// <param name="newsModel"></param>
        /// <param name="pageModel"></param>
        /// <returns></returns>
        public static IList<Model.News> Get(Model.News newsModel, ref Model.PageInfo pageModel)
        {
            return dal.Get(newsModel, ref pageModel);
        }
    }
}
