using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using Stat.DBUtility;
using Stat.SQLServerDAL.CommonParmeters;

namespace Stat.SQLServerDAL
{
    class ViewRclass : IDAL.IViewRclass
    {
        #region IViewUrlPage 成员
        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns>Juju 2011-10-27</returns>
        public List<Model.StatItem> GetList(Stat.Model.StatInfo model)
        {
            model.TableName = "ViewSoid";
            model.Cells = "Soid,pvCount,ipCount,uvCount,nuvCount,timCount,otimCount,vYear,vMonth,vDay";
            return StatItem.GetList(Common.GetViewItemData(model), "Soid", 0);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns>Juju 2011-10-27</returns>
        public List<Model.ViewItem_Int> GetItem(global::Stat.Model.StatInfo model)
        {
            model.TableName = "View_" + model.StartTime.Year + "_" + model.StartTime.Month + "_" + model.StartTime.Day;
            model.Cells = "[id],SoId,IP,Mac,View_Alone";
            SqlParameter[] parms = ViewItemParmeters.SetSqlParmeter(model);
            DataTable dt = SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringGather(model.GatherID), CommandType.StoredProcedure, "Stat_ViewClickLoadEnterByWebid", parms);
            return ViewItems.GetInt.GetList(dt, "SoId");
        }
        #endregion
    }
}
