Example #1
0
        public void Page(int pageIndex, int pageSize, int total, ListPromotionLog item)
        {
            item.PageIndex = pageIndex;
            int pageToTal = total / pageSize;
            int more      = total % pageSize;

            if (more > 0)
            {
                pageToTal += 1;
            }
            if (pageIndex == pageToTal)
            {
                item.NextPage = 0;
                int prve = pageIndex - 1;
                if (prve <= 0)
                {
                    item.PrevPage = 0;
                }
                else
                {
                    item.PrevPage = prve;
                }
            }
            else if (pageIndex < pageToTal)
            {
                item.NextPage = pageIndex + 1;
                int prve = pageIndex - 1;
                if (prve <= 0)
                {
                    item.PrevPage = 0;
                }
                else
                {
                    item.PrevPage = prve;
                }
            }
            else
            {
                item.PrevPage = 0;
                item.NextPage = 0;
            }
        }
Example #2
0
 public void reayd()
 {
     RecommendLogs = new ListPromotionLog();
     PointLogs     = new ListPromotionLog();
 }