Ejemplo n.º 1
0
        public async Task <IActionResult> Create([Bind("ID,TableNo,TableGrade,TableCapacity,TableDescription")] Table table)
        {
            if (ModelState.IsValid)
            {
                _context.Add(table);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(table));
        }
Ejemplo n.º 2
0
        public async Task <IActionResult> Create([Bind("ID,SISID,FirstName,LastName,Grade,Notes,TableID")] Student student)
        {
            if (ModelState.IsValid)
            {
                _context.Add(student);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TableID"] = new SelectList(_context.Set <Table>(), "ID", "ID", student.TableID);
            return(View(student));
        }