public async Task <IActionResult> Edit(int id, [Bind("Id,Vapp,Vga,Vref,Weight")] Landing35Data landing35Data)
        {
            if (id != landing35Data.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(landing35Data);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Landing35DataExists(landing35Data.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(landing35Data));
        }
Esempio n. 2
0
        }//end initialize flap15landing

        public static void InitializeLand35(ApplicationDbContext context)
        {
            context.Database.EnsureCreated();

            // Look for any students.
            if (context.Landing35Data.Any())
            {

            }

            var flap35landingtable = new Landing35Data[]
            {
                new Landing35Data { Weight = 18000, Vapp = 101, Vref = 101, Vga = 101},
                new Landing35Data { Weight = 20000, Vapp = 102, Vref = 102, Vga = 102},
                new Landing35Data { Weight = 22000, Vapp = 107, Vref = 107, Vga = 107},
                new Landing35Data { Weight = 24000, Vapp = 112, Vref = 112, Vga = 112},
                new Landing35Data { Weight = 26000, Vapp = 116, Vref = 116, Vga = 116},
                new Landing35Data { Weight = 28000, Vapp = 120, Vref = 120, Vga = 120},
                new Landing35Data { Weight = 29000, Vapp = 123, Vref = 123, Vga = 123},
            };
            foreach (Landing35Data cd in flap35landingtable)
            {
                context.Landing35Data.Add(cd);
            }

            context.SaveChanges();
            return;
        }//end initialize flap35landing
        public async Task <IActionResult> Create([Bind("Id,Vapp,Vga,Vref,Weight")] Landing35Data landing35Data)
        {
            if (ModelState.IsValid)
            {
                _context.Add(landing35Data);
                await _context.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }
            return(View(landing35Data));
        }