//GET: Bracket Edit public ActionResult Edit(int id) { var db = new BracketService(); var detail = db.GetBracketById(id); var characterList = new SelectList(db.Characters(), "CharacterId", "CharacterName"); ViewBag.FirstCharacterId = characterList; ViewBag.SecondCharacterId = characterList; ViewBag.ThirdCharacterId = characterList; ViewBag.FourthCharacterId = characterList; ViewBag.FifthCharacterId = characterList; ViewBag.SixthCharacterId = characterList; ViewBag.SeventhCharacterId = characterList; ViewBag.EighthCharacterId = characterList; var model = new BracketEdit { BracketId = detail.BracketId, Location = detail.Location, TournamentName = detail.TournamentName, FirstCharacterId = detail.FirstCharacterEightId, SecondCharacterId = detail.SecondCharacterEightId, ThirdCharacterId = detail.ThirdCharacterEightId, FourthCharacterId = detail.FourthCharacterEightId, FifthCharacterId = detail.FifthCharacterEightId, SixthCharacterId = detail.SixthCharacterEightId, SeventhCharacterId = detail.SeventhCharacterEightId, EighthCharacterId = detail.EighthCharacterEightId, }; return(View(model)); }
//GET: Create Bracket public ActionResult Create() { var service = new BracketService(); //var characterService = CreateCharacterService(); //if (!ModelState.IsValid) //{ // return RedirectToAction("Register", "Account"); //} var characterList = new SelectList(service.Characters(), "CharacterId", "CharacterName"); ViewBag.FirstCharacterEightId = characterList; ViewBag.SecondCharacterEightId = characterList; ViewBag.ThirdCharacterEightId = characterList; ViewBag.FourthCharacterEightId = characterList; ViewBag.FifthCharacterEightId = characterList; ViewBag.SixthCharacterEightId = characterList; ViewBag.SeventhCharacterEightId = characterList; ViewBag.EighthCharacterEightId = characterList; return(View()); }