Ejemplo n.º 1
0
        public ActionResult Edit(int id)
        {
            var service          = CreateGameNightService();
            var detail           = service.GetGameNightById(id);
            var userId           = Guid.Parse(User.Identity.GetUserId());
            var gatheringService = new GameService(userId);
            var gameList         = gatheringService.GetGames();
            var gamerId          = Guid.Parse(User.Identity.GetUserId());
            var gettingService   = new GamerService(gamerId);
            var gamerList        = gettingService.GetGamers();
            var model            =
                new GameNightEdit
            {
                GameTimeId    = detail.GameTimeId,
                GameId        = detail.GameId,
                DateTime      = detail.DateTime,
                Location      = detail.Location,
                NoobsAllowed  = detail.NoobsAllowed,
                Description   = detail.Description,
                TutorialVideo = detail.TutorialVideo,
                GamerTag      = detail.GamerTag
            };

            ViewBag.GameId   = new SelectList(gameList, "GameId", "Title");
            ViewBag.GamerTag = new SelectList(gamerList, "GamerTag", "GamerTag");

            return(View(model));
        }
Ejemplo n.º 2
0
        // GET: Gamer
        public ActionResult Index()
        {
            var gamerId = Guid.Parse(User.Identity.GetUserId());
            var service = new GamerService(gamerId);
            var model   = service.GetGamers();

            return(View(model));
        }
Ejemplo n.º 3
0
        // GET
        public ActionResult Create()
        {
            var userId           = Guid.Parse(User.Identity.GetUserId());
            var gatheringService = new GameService(userId);
            var gameList         = gatheringService.GetGames();

            ViewBag.GameId = new SelectList(gameList, "GameId", "Title");

            var gamerId        = Guid.Parse(User.Identity.GetUserId());
            var gettingService = new GamerService(gamerId);
            var gamerList      = gettingService.GetGamers();

            ViewBag.GamerTag = new SelectList(gamerList, "GamerTag", "GamerTag");

            return(View());
        }