コード例 #1
0
        public ActionResult XiaoFeiJiLu(int current = 1)
        {
            if (current > 1)
            {
                ViewBag.currents = current - 1;
            }
            else
            {
                ViewBag.currents = 1;
            }
            ConsumeManager a       = new ConsumeManager();
            int            count   = 5;
            List <consume> consume = a.GetAll();
            //List<consume> consume = a.Where(x => x.consume_Condition == "可见").ToList();
            var list = consume.OrderByDescending(x => x.consume_Time).Skip((current - 1) * 5).Take(count).ToList();

            int zongshu = consume.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 XiaoFeiJiLu(consume info)
        {
            if (info.consume_Condition.Equals("全部"))
            {
                int current = 1;
                if (current > 1)
                {
                    ViewBag.currents = current - 1;
                }
                else
                {
                    ViewBag.currents = 1;
                }
                int            count = 5;
                ConsumeManager a     = new ConsumeManager();

                if (info.consume_cause == null)
                {
                    List <consume> detail  = a.GetAll();
                    var            list    = detail.OrderByDescending(x => x.consume_Time).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 <consume> detail = a.Where(x => x.consume_cause.Contains(info.consume_cause)).ToList();
                    var            list   = detail.OrderByDescending(x => x.consume_Time).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;
                ConsumeManager a     = new ConsumeManager();
                //List<action> detail = a.GetAll();
                if (info.consume_cause == null)
                {
                    List <consume> detail  = a.Where(x => x.consume_Condition == info.consume_Condition).ToList();
                    var            list    = detail.OrderByDescending(x => x.consume_Time).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 <consume> detail = a.Where(x => x.consume_cause.Contains(info.consume_cause) && x.consume_Condition == info.consume_Condition).ToList();
                    //List<action> detail = a.Where(x => x.actionhead.Contains(info.actionhead)).ToList();
                    var list = detail.OrderByDescending(x => x.consume_Time).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));
                }
            }
        }
コード例 #3
0
        // GET: ZhengLiang/FinanceQT
        public ActionResult Show(int index = 1, int indexs = 1)
        {
            if (index > 1)
            {
                ViewBag.index1 = index - 1;
            }
            else
            {
                ViewBag.index1 = 1;
            }
            if (indexs > 1)
            {
                ViewBag.indexss = indexs - 1;
            }
            else
            {
                ViewBag.indexss = 1;
            }
            int           count  = 3;
            ActionManager a      = new ActionManager();
            List <action> action = a.Where(x => x.actiontype == "通过").ToList();
            var           list   = action.OrderBy(x => x.actiontime).Skip((index - 1) * count).Take(count).ToList();


            int zongshu = action.Count();
            int zongye  = zongshu / count;

            zongye = zongshu % count == 0 ? zongye : zongye + 1;
            if (index < zongye)
            {
                ViewBag.zongyeqq = index + 1;;
            }
            else
            {
                ViewBag.zongyeqq = zongye;
            }
            ViewBag.zongshu = zongshu;
            ViewBag.index   = index;
            ViewBag.list    = list;

            ConsumeManager aa       = new ConsumeManager();
            List <consume> consume  = aa.GetAll();
            var            lists    = consume.OrderBy(x => x.consume_Time).Skip((indexs - 1) * count).Take(count).ToList();
            int            zongshus = consume.Count();
            int            zongyes  = zongshus / count;

            zongyes = zongshus % count == 0 ? zongyes : zongyes + 1;
            if (indexs < zongyes)
            {
                ViewBag.zongyeaa = indexs + 1;
            }
            else
            {
                ViewBag.zongyeaa = zongye;
            }
            ViewBag.zongyes = zongyes;
            ViewBag.indexs  = indexs;
            ViewBag.lists   = lists;


            return(View());
        }