示例#1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Vapp,Vga,Vref,Weight")] Landing5Data landing5Data)
        {
            if (id != landing5Data.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(landing5Data);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!Landing5DataExists(landing5Data.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction("Index"));
            }
            return(View(landing5Data));
        }
示例#2
0
        public static void InitializeLand5(ApplicationDbContext context)
        {
            context.Database.EnsureCreated();

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

            }

            var flap5landingtable = new Landing5Data[]
            {
                new Landing5Data { Weight = 18000, Vapp = 115, Vref = 109, Vga = 109},
                new Landing5Data { Weight = 20000, Vapp = 120, Vref = 110, Vga = 110},
                new Landing5Data { Weight = 22000, Vapp = 126, Vref = 110, Vga = 110},
                new Landing5Data { Weight = 24000, Vapp = 131, Vref = 120, Vga = 120},
                new Landing5Data { Weight = 26000, Vapp = 137, Vref = 125, Vga = 125},
                new Landing5Data { Weight = 28000, Vapp = 142, Vref = 130, Vga = 130},
                new Landing5Data { Weight = 29000, Vapp = 146, Vref = 134, Vga = 134},

            };
            foreach (Landing5Data cd in flap5landingtable)
            {
                context.Landing5Data.Add(cd);
            }

            context.SaveChanges();
            return;
        }//end initialize flap5landing
示例#3
0
        public async Task <IActionResult> Create([Bind("Id,Vapp,Vga,Vref,Weight")] Landing5Data landing5Data)
        {
            if (ModelState.IsValid)
            {
                _context.Add(landing5Data);
                await _context.SaveChangesAsync();

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