using System.Collections.Generic;
using System.Data;

namespace Stat.BLL
{
    /// <summary>
    /// 
    /// </summary>
    public class ViewOnLine
    {
        static Stat.IDAL.IViewOnLine dal = Stat.DALFactory.AbstractFactory.GetInstance().CreateOnLine();

        /// <summary>
        /// 获取在线情况 概况(Pv IPUv)
        /// </summary>
        /// <param name="model"></param> 
        /// <returns></returns>
        public static List<Model.Online> GetPvIpUv(Model.StatInfo model)
        {
            return dal.GetPvIpUv(model);
        }
        /// <summary>
        /// 最近来路页面数据
        /// </summary>
        /// <param name="model"></param> 
        /// <returns>Juju 2011-10-24</returns>
        public static List<Model.ViewClick> GetReferer(Model.StatInfo model)
        {
            return dal.GetReferer(model);
        }
        /// <summary>
        /// 最近停留页面
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        ///<remarks>Juju 2011-10-24</remarks>
        public static DataTable GetStayPage(Model.StatInfo model)
        {
            return dal.GetStayPage(model);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public static List<Model.StatItem> Get(Model.StatInfo model)
        {
            List<Model.Online> list = BLL.ViewOnLine.GetPvIpUv(model);

            return BLL.Report.Rp_Online.Get(list, model.StartTime, model.EndTime);
        }
        /// <summary>
        /// 获取在线信息
        /// </summary>
        /// <param name="statModel"></param>
        /// <param name="pageModel"></param>
        /// <returns></returns>
        public static IList<Stat.Model.Online> GetOnLineList(Model.StatInfo statModel, ref Model.PageInfo pageModel)
        {
            return dal.GetOnLineList(statModel, ref pageModel);
        }
    }
}
