예제 #1
0
        public ActionResult HotGroupsWithSort(int sortType)
        {
            var groups = GroupVMService.DiscountGroups();

            groups = GroupListSortTypes.Sort(sortType, PriceService.CoursePriceIndex(), groups);
            return(View(PartialViewNames.NearestGroupList,
                        new NearestGroupsVM(groups)
            {
                ShowAllDiscountLink = true
            }));
        }
예제 #2
0
        public ActionResult ForCourseTCListWithSort(string tcList,
                                                    bool addGroups, int titleType, int sortType)
        {
            var hideDiscount = !tcList.IsEmpty() && tcList.StartsWith(CommonConst.HideDiscount);

            if (hideDiscount)
            {
                tcList = tcList.Remove(CommonConst.HideDiscount);
            }

            var groups = GroupService.GetForUnsplitCourseTCList(tcList);

            if (!groups.Any() && addGroups)
            {
                groups = GroupService.GetPlannedAndNotBegin().NotSpecial().Take(30).ToList();
            }
            if (groups.Any())
            {
                groups = GroupListSortTypes.Sort(sortType, PriceService.CoursePriceIndex(), groups);
                return(Content(Html.Site().NearestGroups(groups, titleType, hideDiscount)));
            }
            return(Content(""));
        }