示例#1
0
 public ActionResult Index()
 {
     return(View(new ViewModels.HomeViewModel
     {
         Maps = GameMapService.SearchVariants("", "release", false, null, true, null).Take(3),
         Types = GameTypeService.SearchVariants("", "release", false, null, true, null).Take(3)
     }));
 }
示例#2
0
 // GET: Admin/Home
 public ActionResult Index()
 {
     return(View(new Models.HomeIndexViewModel
     {
         AccountCount = UserService.Count(),
         ReactionCount = ReactionService.Count(),
         UploadCount = FileService.Count(),
         DownloadCount = FileService.DownloadCount(),
         GameVariants = GameTypeService.SearchVariants("", "release", false, null, null, null).Take(5),
         ForgeVariants = GameMapService.SearchVariants("", "release", false, null, null, null).Take(5),
     }));
 }
示例#3
0
        public ActionResult Index(string q, int?page, int?typeId, bool?staffPick, string sort = "release", string order = "descending", string author = "")
        {
            ViewBag.selectedMapId = typeId;
            ViewBag.typeId        = GameTypeService.GetTypeSelectlist(typeId);
            ViewBag.q             = q;
            ViewBag.order         = order;
            ViewBag.sort          = sort;
            ViewBag.staffPick     = staffPick;


            int?authorId = null;

            if (!string.IsNullOrWhiteSpace(author))
            {
                var user = UserManager.FindByName(author);
                authorId       = user.Id;
                ViewBag.author = user.UserName;
            }

            var maps = GameTypeService.SearchVariants(q, sort, order == "ascending" ? true : false, typeId, staffPick, authorId);

            return(View(maps.ToPagedList(page ?? 1, 15)));
        }