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 /// /// 获得数据列表 /// public List DataTableToList(DataTable dt) { List modelList = new List(); 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 } }