예제 #1
0
        public ActionResult JiaoFeiJiLu(int current = 1)
        {
            if (current > 1)
            {
                ViewBag.currents = current - 1;
            }
            else
            {
                ViewBag.currents = 1;
            }
            int           count   = 5;
            DetailManager a       = new DetailManager();
            List <detail> detail  = a.GetAll();
            var           list    = detail.OrderByDescending(x => x.MoneyTime).Skip((current - 1) * count).Take(count).ToList();
            int           zongshu = detail.Count();
            int           zongye  = zongshu / count;

            zongye = zongshu % count == 0 ? zongye : zongye + 1;
            if (current < zongye)
            {
                ViewBag.currentc = current + 1;
            }
            else
            {
                ViewBag.currentc = zongye;
            }
            ViewBag.zongye  = zongye;
            ViewBag.current = current;
            return(View(list));
        }
예제 #2
0
        public ActionResult JiaoFeiJiLu(detail info)
        {
            if (info.detail_Condition.Equals("全部"))
            {
                int current = 1;
                if (current > 1)
                {
                    ViewBag.currents = current - 1;
                }
                else
                {
                    ViewBag.currents = 1;
                }
                int           count = 5;
                DetailManager a     = new DetailManager();

                if (info.MonryResult == null)
                {
                    List <detail> detail  = a.GetAll();
                    var           list    = detail.OrderByDescending(x => x.MoneyTime).Skip((current - 1) * count).Take(count).ToList();
                    int           zongshu = detail.Count();
                    int           zongye  = zongshu / count;
                    zongye = zongshu % count == 0 ? zongye : zongye + 1;
                    if (current < zongye)
                    {
                        ViewBag.currentc = current + 1;
                    }
                    else
                    {
                        ViewBag.currentc = zongye;
                    }
                    ViewBag.zongye  = zongye;
                    ViewBag.current = current;
                    return(View(list));
                }
                else
                {
                    List <detail> detail  = a.Where(x => x.MonryResult.Contains(info.MonryResult)).ToList();
                    var           list    = detail.OrderByDescending(x => x.MoneyTime).Skip((current - 1) * count).Take(count).ToList();
                    int           zongshu = detail.Count();
                    int           zongye  = zongshu / count;
                    zongye = zongshu % count == 0 ? zongye : zongye + 1;
                    if (current < zongye)
                    {
                        ViewBag.currentc = current + 1;
                    }
                    else
                    {
                        ViewBag.currentc = zongye;
                    }
                    ViewBag.zongye  = zongye;
                    ViewBag.current = current;
                    return(View(list));
                }
            }
            else
            {
                int current = 1;
                if (current > 1)
                {
                    ViewBag.currents = current - 1;
                }
                else
                {
                    ViewBag.currents = 1;
                }
                int           count = 5;
                DetailManager a     = new DetailManager();
                if (info.MonryResult == null)
                {
                    List <detail> detail  = a.Where(x => x.detail_Condition == info.detail_Condition).ToList();
                    var           list    = detail.OrderByDescending(x => x.MoneyTime).Skip((current - 1) * count).Take(count).ToList();
                    int           zongshu = detail.Count();
                    int           zongye  = zongshu / count;
                    zongye = zongshu % count == 0 ? zongye : zongye + 1;
                    if (current < zongye)
                    {
                        ViewBag.currentc = current + 1;
                    }
                    else
                    {
                        ViewBag.currentc = zongye;
                    }
                    ViewBag.zongye  = zongye;
                    ViewBag.current = current;
                    return(View(list));
                }
                else
                {
                    List <detail> detail = a.Where(x => x.MonryResult.Contains(info.MonryResult) && x.detail_Condition == info.detail_Condition).ToList();
                    var           list   = detail.OrderByDescending(x => x.MoneyTime).Skip((current - 1) * count).Take(count).ToList();

                    int zongshu = detail.Count();
                    int zongye  = zongshu / count;
                    zongye = zongshu % count == 0 ? zongye : zongye + 1;
                    if (current < zongye)
                    {
                        ViewBag.currentc = current + 1;
                    }
                    else
                    {
                        ViewBag.currentc = zongye;
                    }
                    ViewBag.zongye  = zongye;
                    ViewBag.current = current;
                    return(View(list));
                }
            }
        }