Exemplo n.º 1
0
        public ActionResult RechargeList(string usercode, string truename, DateTime?start, DateTime?end, int type = 0, int style = 0, int pageIndex = 1)
        {
            RechargeListModel model = new RechargeListModel();

            //查询数据
            RechargePageResult rechargeModel = new RechargePageResult();

            rechargeModel = rechargeService.GetPageList(0, usercode, truename, type, style, start, end, pageIndex, PageSize);

            model.rechargeList = rechargeModel.Recharges;
            //分页
            Pagination pager = new Pagination();

            pager.PageIndex  = pageIndex;
            pager.PageSize   = PageSize;
            pager.TotalCount = rechargeModel.TotalCount;

            if (rechargeModel.TotalCount <= PageSize)
            {
                model.Page = "";
            }
            else
            {
                model.Page = pager.GetPagerHtml();
            }

            return(Json(new AjaxResult {
                Status = "1", Data = model
            }));
        }
Exemplo n.º 2
0
        /// <summary>
        /// 分页查询
        /// </summary>
        /// <param name="UserID"></param>
        /// <param name="UserCode"></param>
        /// <param name="TrueName"></param>
        /// <param name="RechargeType">币种</param>
        /// <param name="RechargeStyle">充值类型</param>
        /// <param name="StartTime"></param>
        /// <param name="EndTime"></param>
        /// <param name="PageIndex"></param>
        /// <param name="PageSize"></param>
        /// <returns></returns>
        public RechargePageResult GetPageList(long UserID, string UserCode, string TrueName, int RechargeType, int RechargeStyle, DateTime?StartTime, DateTime?EndTime, int PageIndex, int PageSize)
        {
            using (MyDbContext dbcontext = new MyDbContext())
            {
                CommonService <RechargeEntity> csr        = new CommonService <RechargeEntity>(dbcontext);
                RechargePageResult             PageResult = new RechargePageResult();
                var RechargeQuery = csr.GetAll();

                if (UserID > 0)
                {
                    RechargeQuery = RechargeQuery.Where(p => p.UserID == UserID);
                }
                if (!string.IsNullOrEmpty(UserCode))
                {
                    RechargeQuery = RechargeQuery.Where(p => p.Users.UserCode.Contains(UserCode));
                }
                if (!string.IsNullOrEmpty(TrueName))
                {
                    RechargeQuery = RechargeQuery.Where(p => p.Users.TrueName.Contains(TrueName));
                }
                if (RechargeType > 0)//币种
                {
                    RechargeQuery = RechargeQuery.Where(p => p.RechargeType == RechargeType);
                }
                if (RechargeStyle > 0)//充值类型
                {
                    RechargeQuery = RechargeQuery.Where(p => p.RechargeStyle == RechargeStyle);
                }
                if (StartTime != null)
                {
                    RechargeQuery = RechargeQuery.Where(p => p.RechargeDate >= StartTime);
                }
                if (EndTime != null)
                {
                    RechargeQuery = RechargeQuery.Where(p => p.RechargeDate <= EndTime);
                }
                PageResult.Recharges  = RechargeQuery.OrderByDescending(p => p.CreateTime).Skip((PageIndex - 1) * PageSize).Take(PageSize).ToList().Select(p => ToDTO(p)).ToArray();
                PageResult.TotalCount = RechargeQuery.LongCount();

                return(PageResult);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// 后台充值列表
        /// </summary>
        /// <returns></returns>
        public ActionResult RechargeList()
        {
            RechargeListModel model = new RechargeListModel();

            //查询数据
            RechargePageResult rechargeModel = new RechargePageResult();

            rechargeModel = rechargeService.GetPageList(0, "", "", 0, 0, null, null, 1, PageSize);

            model.rechargeList = rechargeModel.Recharges;
            //分页
            Pagination pager = new Pagination();

            pager.PageIndex  = 1;
            pager.PageSize   = PageSize;
            pager.TotalCount = rechargeModel.TotalCount;

            if (rechargeModel.TotalCount <= PageSize)
            {
                model.Page = "";
            }
            else
            {
                model.Page = pager.GetPagerHtml();
            }
            //币种
            model.currencyList = currencynameService.GetList();
            var selectItemList = new List <SelectListItem>()
            {
                new SelectListItem()
                {
                    Value = "0", Text = "请选择", Selected = true
                }
            };
            var selectList = new SelectList(model.currencyList, "ID", "CurrencyName");

            selectItemList.AddRange(selectList);
            ViewBag.currency = selectItemList;

            return(View(model));
        }