public async Task <ViewResult> Index()
        {
            ViewBag.NewNoticeChannel = ViewBag.NoticeChannel = DownloadAppManager.QueryNoticeChannel() ?? new List <NoticeChannel>();
            var result = DownloadAppManager.QueryHomePagePopup(new HomePagePopupQuery {
                PositionCriterion = 1
            }, 1);

            ViewBag.NumOfPopups = DownloadAppManager.CountHomePagePopup(new HomePagePopupQuery {
                PositionCriterion = 1
            });
            ViewBag.Page            = 1;
            ViewBag.OrderCriterion  = 0;
            ViewBag.AllTargetGroups = GetTargetGroupDic();
            var scManager = new ShareConfigManager();

            ViewBag.WxConfigs = JsonConvert.SerializeObject((await scManager.SelectWxConfigsAsync()).Select(_ => new { appId = _.appId, name = _.name }));
            return(View(result ?? new List <HomePagePopup>()));
        }
        public async Task <ViewResult> Index(HomePagePopupQuery popupQuery, int orderCriterion, int page = 1)
        {
            ViewBag.NewNoticeChannel  = ViewBag.NoticeChannel = DownloadAppManager.QueryNoticeChannel() ?? new List <NoticeChannel>();
            popupQuery.OrderCriterion = orderCriterion;
            if (!string.IsNullOrWhiteSpace(popupQuery.StartVersionCriterion))
            {
                popupQuery.StartVersionCriterion = popupQuery.StartVersionCriterion.Trim();
            }
            if (!string.IsNullOrWhiteSpace(popupQuery.EndVersionCriterion))
            {
                popupQuery.EndVersionCriterion = popupQuery.EndVersionCriterion.Trim();
            }
            var result = DownloadAppManager.QueryHomePagePopup(popupQuery, page);

            ViewBag.NumOfPopups     = DownloadAppManager.CountHomePagePopup(popupQuery);
            ViewBag.Page            = page;
            ViewBag.OrderCriterion  = orderCriterion;
            ViewBag.AllTargetGroups = GetTargetGroupDic();
            var scManager = new ShareConfigManager();

            ViewBag.WxConfigs = JsonConvert.SerializeObject((await scManager.SelectWxConfigsAsync()).Select(_ => new { appId = _.appId, name = _.name }));
            return(View(result ?? new List <HomePagePopup>()));
        }