public ActionResult List(int?placeid, int?gameid, int pageIndex = 1, int pageSize = 10) { var gamelist = _mobilGameTask.GetAll(null, "").ToSelectList(c => c.ID.ToString(), c => c.GameName); gamelist.Insert(1, new SelectListItem { Selected = false, Text = "不属于任何游戏", Value = "0" }); gamelist.Insert(0, new SelectListItem { Selected = true, Text = "请选择", Value = string.Empty }); ViewData["gamelist"] = gamelist; var placelist = ADConfigPlaceEnum.HomeLunBo.ToSelectList(); placelist.Insert(0, new SelectListItem { Selected = true, Text = "请选择", Value = string.Empty, }); ViewData["adconfiglist"] = placelist; var list = _lunBoAdTask.GetPagedList(placeid, gameid, pageIndex, pageSize); var model = new PagedList <ADConfig>(list.ToList(), pageIndex, pageSize, list.TotalItemCount); return(View(model)); }
public ActionResult List(int?gameid, int?serverid, int pageIndex = 1, int pageSize = 20) { var pagedList = _gamekaTask.GetPagedList(pageIndex, pageSize); var kalist = KaTypeEnum.SpecialCard.ToSelectList(); kalist.Insert(0, new SelectListItem { Selected = true, Text = "请选择", Value = string.Empty, }); ViewBag.KaType = kalist; var model = new PagedList <GameKa>(pagedList.ToList(), pageIndex, pageSize, pagedList.TotalItemCount); var gamelist = _mobilGameTask.GetAll(null, "").ToSelectList(c => c.ID.ToString(), c => c.GameName); gamelist.Insert(0, new SelectListItem { Selected = true, Text = "请选择", Value = string.Empty }); ViewData["gamelist"] = gamelist; return(View(model)); }
public ActionResult index() { //首页广告 ViewData["newsAdList"] = _adConfigTask.GetListBy((int)ADConfigPlaceEnum.HomeNews); ViewData["cePingAdList"] = _adConfigTask.GetListBy((int)ADConfigPlaceEnum.HomeCePing); //今日新闻 var newsHight = new List <NewsXmlDto>(); //XElement root = XElement.Load("http://admin.w3wgame.com/config/HomeConfig.xml"); //var todayxe = root.Element("TodayNews").Element("HotNews").Elements("li"); //foreach (var xe in todayxe) //{ // newsHight.Add(new NewsXmlDto // { // Href = xe.Attribute("href").Value, // Title = xe.Value, // }); //} ViewData["newsHight"] = newsHight; //新闻列表 ViewData["newlist"] = _gameNewsTask.GetAll(4, "NewsType = " + ((int)NewsTypeEnum.News).ToString() + " AND IsDisplayHomePage=1"); ViewData["Activenewslist"] = _gameNewsTask.GetAll(4, "NewsType = " + ((int)NewsTypeEnum.Active).ToString() + " AND IsDisplayHomePage=1"); ViewData["cepingList"] = _gameNewsTask.GetAll(4, "NewsType = " + ((int)NewsTypeEnum.Active).ToString() + " AND IsDisplayHomePage=1"); //活动列表 //本周热门 ViewData["thisweenHotGame"] = _mobilGameTask.GetAll(10, "IsThisAWeekHot = 1"); //抢礼包 ViewData["qianlibaoGameList"] = _gameKaTask.GetHomeList(); //游戏推荐 ViewData["tuijianGameList"] = _mobilGameTask.GetAll(15, "IsTuiJian = 1"); //游戏分类 ViewData["gametypeGameList"] = _mobilGameTask.GetAll(null, "IsGameType = 1"); //手机游戏开测 ViewData["kaiceServerList"] = _gameServersTask.GetHomeServerList((int)YunYingStateEnum.GongCe); //手机游戏新服 ViewData["xinfuServerList"] = _gameServersTask.GetHomeServerList((int)YunYingStateEnum.XinFu); ViewData["friendList"] = _friendLinkTask.GetAll(); return(View()); }
public ActionResult HomeGamesDanner() { //热门 ViewData["hostGameList"] = _mobilGameTask.GetAll(11, "IsHot = 1"); //考虑用缓存 //必玩 ViewData["biwanGameList"] = _mobilGameTask.GetAll(10, "IsBiWan = 1"); //最新 ViewData["newestGameList"] = _mobilGameTask.GetAll(10, "IsNew = 1"); return(View()); }
public ActionResult List(int?gameid, int pageIndex = 1, int pageSize = 20) { var pagedList = _gamedownloadurlsTask.GetPagedList(gameid, pageIndex, pageSize); var gamelist = _mobilGameTask.GetAll(null, "").ToSelectList(c => c.ID.ToString(), c => c.GameName); gamelist.Insert(0, new SelectListItem { Selected = true, Text = "请选择", Value = string.Empty }); ViewData["gamelist"] = gamelist; var model = new PagedList <GameDownloadUrls>(pagedList.ToList(), pageIndex, pageSize, pagedList.TotalItemCount); return(View(model)); }
public ActionResult List(int?platId, int?newstype, bool?isWeb, bool?isDisplayHome, int pageIndex = 1, int pageSize = 20) { var pagedList = _gamenewsTask.GetPagedList(platId, newstype, isWeb, isDisplayHome, pageIndex, pageSize); var newsplatform = _mobilGameTask.GetAll(null, "").ToSelectList(c => c.ID.ToString(), c => c.GameName); newsplatform.Insert(0, new SelectListItem { Selected = true, Value = string.Empty, Text = "请选择" }); ViewData["newsplatform"] = newsplatform; ViewData["newstypelist"] = NewsTypeEnum.Active.ToSelectListAddDefault(); var model = new PagedList <GameNews>(pagedList.ToList(), pageIndex, pageSize, pagedList.TotalItemCount); return(View(model)); }
public ActionResult index(int?tid, int pageindex = 1, int pagesize = 10) { ViewData["adinfo"] = _adConfigTask.GetListBy((int)ADConfigPlaceEnum.PlatformNewsRight).FirstOrDefault(); ViewData["adinfoactive"] = _adConfigTask.GetListBy((int)ADConfigPlaceEnum.PlatformNewsRightActive).FirstOrDefault(); ViewData["gameinfolist"] = _mobilGameTask.GetAll(10, ""); ViewData["newlist"] = _gameNewsTask.GetAll(15, " NewsType = 2"); var pagedList = _gameNewsTask.GetPagedList(null, tid, null, null, pageindex, pagesize); var model = new PagedList <GameNews>(pagedList.ToList(), pageindex, pagesize, pagedList.TotalItemCount); return(View(model)); }
public static void RegisterRoutes(RouteCollection routes) { MobilGameTask mobilGameTask = new MobilGameTask(); routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); foreach (var item in mobilGameTask.GetAll(null, "")) { routes.Add("DomainRouteName" + item.Domain.ToLower(), new DomainRoute(string.Format("{0}.w3wgame.com", item.Domain.ToLower()), "{action}/{id}", new { Controller = "games", action = "index", id = "" } )); } routes.MapRoute( "Default", // 路由名称 "{controller}/{action}/{id}", // 带有参数的 URL new { controller = "Home", action = "Index", id = UrlParameter.Optional } // 参数默认值 ); }