Exemplo n.º 1
0
        public IActionResult List()
        {
            try
            {
                string funcId = PermissionEnum.CodeFormat((int)PermissionEnum.会员管理.等级管理.列表);
                if (!IsPermission(funcId))
                {
                    return(ToPermission(funcId));
                }
                string startTime = GetQueryString("datemin");
                string endTime   = GetQueryString("datemax");
                string keyword   = GetQueryString("keyword");
                ViewBag.datemin = startTime;
                ViewBag.datemax = endTime;
                ViewBag.keyword = keyword;

                int pageId                    = 1;
                int pageSize                  = 100;
                int rowCount                  = 0;
                List <Member_Rank> lists      = new List <Member_Rank>();
                string             strKeyword = string.Format("", startTime, keyword);
                if (string.IsNullOrWhiteSpace(strKeyword))
                {
                    lists = RankService.GetRankPagingPro(SystemID, CompanyID, pageId, pageSize, out rowCount);
                }
                else
                {
                    lists = RankService.SearchRankPro(SystemID, CompanyID, startTime, endTime, keyword);
                }
                int totalNum = rowCount > 0 ? rowCount : lists == null ? 0 : lists.Count();
                ViewBag.Count = totalNum;
                return(View(lists));
            }
            catch (Exception ex)
            {
                return(ToError(ex.Message));
            }
        }