public async Task <IActionResult> Edit(int id, [Bind("Id,Vapp,Vga,Vref,Weight")] Landing15Data landing15Data) { if (id != landing15Data.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(landing15Data); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Landing15DataExists(landing15Data.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(landing15Data)); }
}//end initialize flap10landing public static void InitializeLand15(ApplicationDbContext context) { context.Database.EnsureCreated(); // Look for any students. if (context.Landing15Data.Any()) { } var flap15landingtable = new Landing15Data[] { new Landing15Data { Weight = 18000, Vapp = 106, Vref = 105, Vga = 105}, new Landing15Data { Weight = 20000, Vapp = 106, Vref = 106, Vga = 105}, new Landing15Data { Weight = 22000, Vapp = 112, Vref = 112, Vga = 105}, new Landing15Data { Weight = 24000, Vapp = 117, Vref = 117, Vga = 107}, new Landing15Data { Weight = 26000, Vapp = 122, Vref = 121, Vga = 111}, new Landing15Data { Weight = 28000, Vapp = 126, Vref = 126, Vga = 116}, new Landing15Data { Weight = 29000, Vapp = 129, Vref = 129, Vga = 119}, }; foreach (Landing15Data cd in flap15landingtable) { context.Landing15Data.Add(cd); } context.SaveChanges(); return; }//end initialize flap15landing
public async Task <IActionResult> Create([Bind("Id,Vapp,Vga,Vref,Weight")] Landing15Data landing15Data) { if (ModelState.IsValid) { _context.Add(landing15Data); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(landing15Data)); }