public async Task <IActionResult> Edit(int id, [Bind("id,FirstName,LastName,FavoriteDestinations,YearsExperience,phoneNumber,email,Password")] TravelAgentInfo2 travelAgentInfo2) { if (id != travelAgentInfo2.id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(travelAgentInfo2); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TravelAgentInfo2Exists(travelAgentInfo2.id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(travelAgentInfo2)); }
public IActionResult Create([Bind("id,FirstName,LastName,FavoriteDestinations,YearsExperience,phoneNumber,email,Password")] TravelAgentInfo2 TravelAgentInfo2) //Adds data we entered to list. { if (ModelState.IsValid) { _context.TravelAgentInfo.Add(TravelAgentInfo2); _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View()); }
public async Task <IActionResult> Create([Bind("id,FirstName,LastName,FavoriteDestinations,YearsExperience,phoneNumber,email,Password")] TravelAgentInfo2 travelAgentInfo2) { if (ModelState.IsValid) { _context.Add(travelAgentInfo2); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } //return View(travelAgentInfo2); return(RedirectToAction("Thank You", "BidllS")); }