示例#1
0
        public ActionResult UpdateCharacter(Int64 characterID, long gameId)
        {
            ActionResult response = null;

            if ((Int64)Session["RoleID"] >= 2)
            {
                ViewBag.GameID = gameId;
                CharacterMap map             = new CharacterMap();
                CharacterDO  characterObject = dl.ViewCharacterByID(characterID);
                CharacterPO  form            = map.CharacterDOToPO(characterObject);
                response = View(form);
            }
            else
            {
                response = RedirectToAction("CharacterIndex", new { gameID = gameId });
            }
            return(response);
        }
示例#2
0
        // GET: Character
        public ActionResult CharacterIndex(Int64 gameID)
        {
            ActionResult response = null;

            if (Session["UserName"] != null)
            {
                CharacterMap       map      = new CharacterMap();
                List <CharacterPO> fullList = new List <CharacterPO>();
                List <CharacterDO> allData  = dl.ViewCharactersByGame(gameID);
                foreach (CharacterDO data in allData)
                {
                    CharacterPO mappedData = map.CharacterDOToPO(data);
                    fullList.Add(mappedData);
                }
                ViewBag.GameId = gameID;
                response       = View(fullList);
            }
            else
            {
                response = RedirectToAction("Index", "Game");
            }
            return(response);
        }