public async Task <IActionResult> Edit(int id, [Bind("Id,Cold0V2,Cold0Vr,Cold10000V2,Cold10000Vr,Cold2000V2,Cold2000Vr,Cold4000V2,Cold4000Vr,Cold6000V2,Cold6000Vr,Cold8000V2,Cold8000Vr,Hot0V2,Hot0Vr,Hot10000V2,Hot10000Vr,Hot2000V2,Hot2000Vr,Hot4000V2,Hot4000Vr,Hot6000V2,Hot6000Vr,Hot8000V2,Hot8000Vr,Weight")] FlapData flapData) { if (id != flapData.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(flapData); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FlapDataExists(flapData.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction("Index")); } return(View(flapData)); }
}//end initialize flap35landing public static void InitializeFlap5(ApplicationDbContext context) { context.Database.EnsureCreated(); // Look for any students. if (context.Flap5Data.Any()) { // DB has been seeded with flap 5 return; } else { var Flap5Takeofftable = new FlapData[] { new FlapData { Weight = 18000, Cold0Vr = 102, Cold0V2 = 116, Cold2000Vr = 102, Cold2000V2 = 115, Cold4000Vr = 102, Cold4000V2 = 114, Cold6000Vr = 102, Cold6000V2 = 113, Cold8000Vr = 102, Cold8000V2 = 112, Cold10000Vr = 103, Cold10000V2 = 111, Hot0Vr = 102, Hot0V2 = 114, Hot2000Vr = 102, Hot2000V2 = 113, Hot4000Vr = 102, Hot4000V2 = 112, Hot6000Vr = 103, Hot6000V2 = 111, Hot8000Vr = 103, Hot8000V2 = 110, Hot10000Vr = 105, Hot10000V2 = 109}, new FlapData { Weight = 20000, Cold0Vr = 105, Cold0V2 = 115, Cold2000Vr = 106, Cold2000V2 = 114, Cold4000Vr = 107, Cold4000V2 = 113, Cold6000Vr = 107, Cold6000V2 = 112, Cold8000Vr = 108, Cold8000V2 = 112, Cold10000Vr = 110, Cold10000V2 = 111, Hot0Vr = 107, Hot0V2 = 113, Hot2000Vr = 108, Hot2000V2 = 112, Hot4000Vr = 108, Hot4000V2 = 112, Hot6000Vr = 110, Hot6000V2 = 111, Hot8000Vr = 110, Hot8000V2 = 111, Hot10000Vr = 112, Hot10000V2 = 111}, new FlapData { Weight = 22000, Cold0Vr = 112, Cold0V2 = 117, Cold2000Vr = 113, Cold2000V2 = 117, Cold4000Vr = 113, Cold4000V2 = 117, Cold6000Vr = 114, Cold6000V2 = 117, Cold8000Vr = 115, Cold8000V2 = 117, Cold10000Vr = 116, Cold10000V2 = 117, Hot0Vr = 113, Hot0V2 = 117, Hot2000Vr = 114, Hot2000V2 = 117, Hot4000Vr = 115, Hot4000V2 = 117, Hot6000Vr = 116, Hot6000V2 = 117, Hot8000Vr = 117, Hot8000V2 = 117, Hot10000Vr = 118, Hot10000V2 = 117}, new FlapData { Weight = 24000, Cold0Vr = 118, Cold0V2 = 122, Cold2000Vr = 119, Cold2000V2 = 122, Cold4000Vr = 120, Cold4000V2 = 122, Cold6000Vr = 120, Cold6000V2 = 122, Cold8000Vr = 121, Cold8000V2 = 122, Cold10000Vr = 122, Cold10000V2 = 122, Hot0Vr = 120, Hot0V2 = 122, Hot2000Vr = 120, Hot2000V2 = 122, Hot4000Vr = 121, Hot4000V2 = 122, Hot6000Vr = 122, Hot6000V2 = 122, Hot8000Vr = 123, Hot8000V2 = 122, Hot10000Vr = 124, Hot10000V2 = 122}, new FlapData { Weight = 26000, Cold0Vr = 124, Cold0V2 = 127, Cold2000Vr = 125, Cold2000V2 = 127, Cold4000Vr = 126, Cold4000V2 = 127, Cold6000Vr = 126, Cold6000V2 = 127, Cold8000Vr = 127, Cold8000V2 = 127, Cold10000Vr = 128, Cold10000V2 = 127, Hot0Vr = 126, Hot0V2 = 127, Hot2000Vr = 126, Hot2000V2 = 127, Hot4000Vr = 127, Hot4000V2 = 127, Hot6000Vr = 128, Hot6000V2 = 127, Hot8000Vr = 129, Hot8000V2 = 127, Hot10000Vr = 130, Hot10000V2 = 127}, new FlapData { Weight = 28000, Cold0Vr = 130, Cold0V2 = 132, Cold2000Vr = 131, Cold2000V2 = 132, Cold4000Vr = 131, Cold4000V2 = 132, Cold6000Vr = 132, Cold6000V2 = 132, Cold8000Vr = 133, Cold8000V2 = 132, Cold10000Vr = 134, Cold10000V2 = 132, Hot0Vr = 131, Hot0V2 = 132, Hot2000Vr = 132, Hot2000V2 = 132, Hot4000Vr = 133, Hot4000V2 = 132, Hot6000Vr = 134, Hot6000V2 = 132, Hot8000Vr = 135, Hot8000V2 = 132, Hot10000Vr = 136, Hot10000V2 = 132}, new FlapData { Weight = 29000, Cold0Vr = 133, Cold0V2 = 135, Cold2000Vr = 134, Cold2000V2 = 135, Cold4000Vr = 135, Cold4000V2 = 135, Cold6000Vr = 136, Cold6000V2 = 135, Cold8000Vr = 137, Cold8000V2 = 135, Cold10000Vr = 138, Cold10000V2 = 135, Hot0Vr = 135, Hot0V2 = 135, Hot2000Vr = 136, Hot2000V2 = 135, Hot4000Vr = 137, Hot4000V2 = 135, Hot6000Vr = 138, Hot6000V2 = 135, Hot8000Vr = 138, Hot8000V2 = 135, Hot10000Vr = 140, Hot10000V2 = 135}, }; foreach (FlapData fd in Flap5Takeofftable) { context.Flap5Data.Add(fd); } context.SaveChanges(); return; };// end flap5takeoff else }//end flap5
public async Task <IActionResult> Create([Bind("Id,Cold0V2,Cold0Vr,Cold10000V2,Cold10000Vr,Cold2000V2,Cold2000Vr,Cold4000V2,Cold4000Vr,Cold6000V2,Cold6000Vr,Cold8000V2,Cold8000Vr,Hot0V2,Hot0Vr,Hot10000V2,Hot10000Vr,Hot2000V2,Hot2000Vr,Hot4000V2,Hot4000Vr,Hot6000V2,Hot6000Vr,Hot8000V2,Hot8000Vr,Weight")] FlapData flapData) { if (ModelState.IsValid) { _context.Add(flapData); await _context.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(flapData)); }