public async Task <IActionResult> Create([Bind("ID,Username,Password")] AdministrativeUsers administrativeUsers) { if (ModelState.IsValid) { _context.Add(administrativeUsers); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(administrativeUsers)); }
public async Task <IActionResult> Create([Bind("ID,Make,Model")] ConsumerDrones consumerDrones) { if (ModelState.IsValid) { _context.Add(consumerDrones); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(consumerDrones)); }
public async Task <IActionResult> Create([Bind("ID,FirstName,LastName,Address,DroneIdNumber")] Users users) { if (ModelState.IsValid) { _context.Add(users); await _context.SaveChangesAsync(); // We give the newly generated user their FAA-ID //users.generateFAANumberID(); return(RedirectToRoute(new { controller = "Users", action = "Details", users.ID })); } return(View(users)); }