示例#1
0
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="model"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public ActionResult PageList(SalesLogQuery model, int currentPage = 1, int pageSize = 20)
        {
            int             recordCount = 0;
            List <SalesLog> SalesLog    = new DALSalesLog().QueryPagination(currentPage, pageSize, out recordCount, model).ToList();

            ViewBag.RecordCount = recordCount;
            ViewBag.CurrentPage = currentPage;
            ViewBag.PageSize    = pageSize;
            ViewBag.PageCount   = Math.Ceiling((double)recordCount / (double)pageSize);
            ViewBag.Model       = model;

            return(View(SalesLog));
        }
示例#2
0
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="model"></param>
        /// <param name="currentPage"></param>
        /// <param name="pageSize"></param>
        /// <returns></returns>
        public ActionResult PageList(SalesLogQuery model, int currentPage = 1, int pageSize = 20)
        {
            if (model.endTime != null)
            {
                model.endTime = Convert.ToDateTime(model.endTime).AddDays(1).AddSeconds(-1);
            }

            int             recordCount = 0;
            List <SalesLog> SalesLog    = new DALSalesLog().QueryPagination(currentPage, pageSize, out recordCount, model).ToList();

            ViewBag.RecordCount = recordCount;
            ViewBag.CurrentPage = currentPage;
            ViewBag.PageSize    = pageSize;
            ViewBag.PageCount   = Math.Ceiling((double)recordCount / (double)pageSize);

            return(View(SalesLog));
        }