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