Esempio n. 1
0
        // GET: Character/Delete/5
        public ActionResult Delete(int id)
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new CharService(userId);

            var model = service.GetCharacterById(id);

            return(View(model));
        }
Esempio n. 2
0
        // GET: Character/Details/5
        public ActionResult Details(int?id)
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new CharService(userId);
            var model   = service.GetCharacterById(id);

            //var charRaceService = new CharRaceServices();
            //var raceList = charRaceService.GetRaces();

            //ViewBag.CharRaceID = new SelectList(raceList, "ID", "RaceName");

            //var charClassService = new CharClassServices();
            //var classList = charClassService.GetClasses();

            //ViewBag.CharClassID = new SelectList(classList, "ID", "ClassName");

            return(View(model));
        }
Esempio n. 3
0
        // GET: Character/Edit/5
        public ActionResult Edit(int id)
        {
            var userId  = Guid.Parse(User.Identity.GetUserId());
            var service = new CharService(userId);

            var charClassService = new CharClassServices();
            var classList        = charClassService.GetClasses();

            ViewBag.CharClassID = new SelectList(classList, "ID", "ClassName");

            var detail = service.GetCharacterById(id);
            var model  = new CharDetail
            {
                CharName         = detail.CharName,
                CharClassID      = detail.CharClassID,
                Alignment        = detail.Alignment,
                CharHistory      = detail.CharHistory,
                ExperiencePoints = detail.ExperiencePoints,
                Traits           = detail.Traits,
                Level            = detail.Level,
            };

            return(View(model));
        }