using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using Dapper; using DapperExtensions; using DapperExtensions.SqlServerExt; using HH.AMS.Ex.Interface; using HH.AMS.Ex.Model; using HH.AMS.Ex.Factroy; using Hanhe.iWCS.Common; namespace HH.AMS.Ex.MSSQLServices { public class ITN_AM_RES_INF_LOGServices : ITN_AM_RES_INF_LOGInterface { /// /// /// /// /// public List GetList(int pageIndex,int pageSize,string strWhere,string orderBy,out long total,out long totalPage) { List list = new List(); try { using (var dapper = Connections.Instance.GetConnection(DBConnetctionString.GetDBConnetctionString)) { int iTotal = 0; list = dapper.GetByPage(pageIndex, pageSize, out iTotal, null, strWhere, null, orderBy, null, null).ToList(); total = (long)iTotal; if (total <= pageSize) totalPage = 1; else if (total % pageSize > 0) totalPage = (long)Math.Floor(Convert.ToDouble((total / pageSize))) + 1; else totalPage = (long)(Math.Floor(Convert.ToDouble(total / pageSize))); return list; } } catch (Exception ex) { total = 0; totalPage = 0; CMMLog.Error("SQL Script ---errMsg=" + ex.ToString()); return new List(); } } } }