Exemplo n.º 1
0
        public ActionResult Create(AdventureTypeModel model)
        {
            if (ModelState.IsValid)
            {
                var templates = TypeTemplateRepository.GetTypeTemplateList();
                var selectedTemplates = templates.Where(t => model.SelectedTemplates.Contains(t.Id)).ToList();

                model.AdventureType.DataCardTemplates = selectedTemplates;

                return View("Details", TypeRepository.SaveAdventureType(model.AdventureType));
            }
            ViewBag.AdventureTypeTemplates = TypeTemplateRepository.GetTypeTemplateList();
            return View(model);
        }
Exemplo n.º 2
0
        //
        // GET: /AdventureType/Edit/5
        public ActionResult Edit(string id)
        {
            AdventureType adventuretype = TypeRepository.GetAdventureType(id);

            if (adventuretype == null)
                return View("NotFound");

            var model = new AdventureTypeModel(adventuretype)
                            {TemplateList = TypeTemplateRepository.GetTypeTemplateList()};

            return View(model);
        }
Exemplo n.º 3
0
 //
 // GET: /AdventureType/Create
 public ActionResult Create()
 {
     //ViewBag.AdventureTypeTemplates = TypeTemplateRepository.GetTypeTemplateList();
     var model = new AdventureTypeModel {TemplateList = TypeTemplateRepository.GetTypeTemplateList()};
     return View(model);
 }