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

namespace Stat.SQLServerDAL
{
    class ViewClrVersion : IDAL.IViewClrVersion
    {

        #region IViewResolve 成员
        /// <summary>
        /// 
        /// </summary>
        /// <param name="model"></param>
        /// <returns>Juju 2011-10-27</returns>
        public List<Model.StatItem> GetList(Stat.Model.StatInfo model)
        {
            model.TableName = "ViewClrVersion";
            model.Cells = "NetFW,pvCount,ipCount,uvCount,nuvCount,timCount,otimCount,vYear,vMonth,vDay";
            return StatItem.GetList(Common.GetViewItemData(model), "NetFW", 0);
        }

        #endregion


        #region IViewOnClick 成员 ：NetClrVersion


        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 = "top 30000 id,NetFW,ip,mac,View_Alone";
            SqlParameter[] parms = ViewItemParmeters.SetSqlParmeter(model);
            DataTable dt = SqlHelper.ExecuteDataTable(SqlHelper.ConnectionStringGather(model.GatherID), CommandType.StoredProcedure, "Stat_ViewClickLoadByWebid", parms);

            return ViewItems.GetInt.GetList(dt, "NetFW");
        }

        #endregion
    }
}
