public async Task <IActionResult> Create([Bind("Id,Name,Email,PhoneNumber")] Dealership dealership) { if (ModelState.IsValid) { _context.Add(dealership); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(dealership)); }
public async Task <IActionResult> Create([Bind("Id,Make,Model,Year,VIN,Color,DealershipID")] Car car) { if (ModelState.IsValid) { _context.Add(car); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(car)); }
public async Task <IActionResult> Create([Bind("Id,FirstName,LastName,Email,Company,Position,BirthDate")] Member member) { if (ModelState.IsValid) { _context.Add(member); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(member)); }
public async Task <IActionResult> Create([Bind("Id,HikeName,Path")] Hike hike) { if (ModelState.IsValid) { _context.Add(hike); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["Path"] = new SelectList(_context.Paths, "Id", "Id", hike.Path); return(View(hike)); }
public async Task <IActionResult> Create(int hike, [Bind("TrueId,Name,Side,Id,MaxHealth,NowHealth,MaxEnergy,NowEnergy,MaxSatiety,NowSatiety,MaxSanity,NowSanity,Status,Strength,HeavyWeapone,ResourceGather,Carrying,HandToHand,Bruteforce,Dexterity,LightWeapone,RangedWeapone,Sneak,Dodge,Agility,Constitution,Shield,Armour,Stamina,Health,Balance,Intelligence,MagickPower,Medicine,Cooking,Science,Craft,Memory,Willpower,MagickLevel,Languages,Learning,Logistics,Perception,Hunting,Traps,Foraging,Spotting,Pathfinding,Charisma,Persuation,Intimidation,Trade,Music,Discussion,Leadership,Command,Tactic,Strategy,Survival,Adjutant,Epathy,Lie,LieDetector,Psycology,Pacification,AnimalHandling,Weapone,Hike,BattleTactic")] Character character) { character.Hike = hike; character.BattleTactic = 0; character.Weapone = 0; if (ModelState.IsValid) { _context.Add(character); await _context.SaveChangesAsync(); //return RedirectToAction(nameof(Index)); return(RedirectToAction("Index", "Characters", new { id = hike, name = _context.Hikes.Where(c => c.Id == hike).FirstOrDefault().HikeName })); } //ViewData["BattleTactic"] = new SelectList(_context.Tactics, "Id", "Id", character.BattleTactic); //ViewData["Hike"] = new SelectList(_context.Hikes, "Id", "Id", character.Hike); //ViewData["Weapone"] = new SelectList(_context.Items, "Id", "Id", character.Weapone); //return View(character); return(RedirectToAction("Index", "Characters", new { id = hike, name = _context.Hikes.Where(c => c.Id == hike).FirstOrDefault().HikeName })); }