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

namespace CallCenterApi.BLL
{
    public class CallResult
    {
        private readonly DAL.CallRecords dal = new DAL.CallRecords();
        public CallResult()
        { }
        #region  BasicMethod

        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<Model.CallResult> DataTableToList(DataTable dt)
        {
            List<Model.CallResult> modelList = new List<Model.CallResult>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                Model.CallResult model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = dal.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }


        #endregion  BasicMethod
        #region  ExtensionMethod

        #endregion  ExtensionMethod
    }
}