using System;
using System.Collections.Generic;

namespace Stat.SQLServerDAL.ViewItems
{
    public class Engine
    {
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        public static List<Model.ViewItem_Engine> GetList(List<Model.ViewClick> table)
        {
            List<Model.ViewItem_Engine> list = new List<Model.ViewItem_Engine>();
            if (table != null)
            {
                for (int i = 0; i < table.Count; i++)
                {
                    list.Add(GetModel(table[i]));
                }
            }
            return list;
        }
        /// <summary>
        /// 将记录集转为实体类
        /// </summary>
        /// <param name="item">记录集</param> 
        /// <returns></returns>
        private static Model.ViewItem_Engine GetModel(Model.ViewClick item)
        {
            Model.ViewItem_Engine model = new Model.ViewItem_Engine();
            model.id = Convert.ToInt32(item.id);
            model.SoID = item.EngineId;
            model.View_Alone = item.View_Alone;
            model.soKeyWord = item.EngineKeyWord;
            model.ip = item.IP;
            model.mac = item.Mac;
            return model;
        }
    }
}
