Example #1
0
 public ActionResult GameRight(int gameid)
 {
     ViewData["gameinfo"]   = _mobilGameTask.GetById(gameid);
     ViewData["newlist"]    = _gameNewsTask.GetAll(15, "GameID = " + gameid.ToString() + " AND NewsType = 2");
     ViewData["serverlist"] = _gameServersTask.GetAll(7, "GameID = " + gameid.ToString());
     ViewData["gamekalist"] = _gameKaTask.GetAll(7, "GameID = " + gameid.ToString());
     return(View());
 }
Example #2
0
        public ActionResult AddCode(int kaid)
        {
            ViewData["gamelist"] = _mobilGameTask.GetAll(null, "").ToSelectList(c => c.ID.ToString(), c => c.GameName);
            var info     = _gamekaTask.GetById(kaid);
            var gameinfo = _mobilGameTask.GetById(info.GameID);

            ViewBag.CaName = string.Format("{0}-{1}区-{2}", gameinfo.GameName, info.ServerID, info.KaTitle);
            return(View());
        }
Example #3
0
        public ActionResult index(int gid)
        {
            ViewData["gameinfo"] = _mobilGameTask.GetById(gid);
            if (ViewData["gameinfo"] == null)
            {
                return(RedirectToAction("index", "home"));
            }
            //新闻列表
            var newlist = _gameNewsTask.GetGameNewsList(gid);

            ViewData["serverlist"] = _gameServersTask.GetAll(7, "GameID = " + gid.ToString());
            ViewData["gamekalist"] = _gameKaTask.GetAll(7, "GameID = " + gid.ToString());
            ViewData["friendlist"] = _friendLinkTask.GetAll();

            //广告图
            ViewData["GameLunBo"] = _adConfigTask.GetListBy((int)ADConfigPlaceEnum.GameLunBo);
            ViewData["GameBLook"] = _adConfigTask.GetListBy((int)ADConfigPlaceEnum.GameBLook);

            return(View(newlist));
        }
Example #4
0
        public ActionResult Save(int?id)
        {
            //var GameSysEnumList = GameSysEnum.Andior.ToSelectList();
            var autolist = new SelectListItem
            {
                Selected = true,
                Text     = "请选择",
                Value    = ""
            };
            //GameSysEnumList.Insert(0,autolist);
            //ViewData["GameSysEnumList"] = GameSysEnumList;
            var GameTeZhenList = GameTeZhenEnum.Chongwu.ToSelectList();

            GameTeZhenList.Insert(0, autolist);
            ViewData["GameTeZhenList"] = GameTeZhenList;
            var GameTypeEnumList = GameTypeEnum.CeLve.ToSelectList();

            GameTypeEnumList.Insert(0, autolist);
            ViewData["GameTypeEnumList"] = GameTypeEnumList;
            ViewData["syslist"]          = GameSysEnum.Andior.ToSelectListAddDefault();
            var YunYingStateEnumList = YunYingStateEnum.XinFu.ToSelectList();

            YunYingStateEnumList.Insert(0, autolist);
            ViewData["YunYingStateEnumList"] = YunYingStateEnumList;
            var model = new SaveMobilGame
            {
                GameDes = string.Empty,
            };

            if (id != null)
            {
                var item = _mobilgameTask.GetById((int)id);
                if (item == null)
                {
                    return(AlertMsg("参数错误", HttpContext.Request.UrlReferrer.PathAndQuery));
                }

                model = EntityMapper.Map <MobilGame, SaveMobilGame>(item);
            }
            return(View(model));
        }
Example #5
0
        public ActionResult Save(SaveGameServers savemodel)
        {
            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;
            if (ModelState.IsValid)
            {
                if (savemodel.ID == null)
                {
                    var model = new GameServers
                    {
                        GameID     = savemodel.GameID,
                        ServerName = savemodel.ServerName,
                        ServerID   = savemodel.ServerID,
                        OpenTime   = savemodel.OpenTime,
                        CreateDate = DateTime.Now,
                        ServerStat = _mobilGameTask.GetById(savemodel.GameID).YunYingState,
                    };
                    _gameserversTask.Add(model);
                }
                else
                {
                    var model = _gameserversTask.GetById((int)savemodel.ID);

                    if (model == null)
                    {
                        return(AlertMsg("参数错误", HttpContext.Request.UrlReferrer.PathAndQuery));
                    }

                    model.GameID     = savemodel.GameID;
                    model.ServerName = savemodel.ServerName;
                    model.ServerID   = savemodel.ServerID;
                    model.OpenTime   = savemodel.OpenTime;

                    _gameserversTask.Update(model);
                }
                return(AlertMsg("保存成功", HttpContext.Request.UrlReferrer.PathAndQuery));
            }
            return(View(savemodel));
        }