예제 #1
0
        public async Task <IActionResult> Create([Bind("IdProfesor,NameProfesor,EnrollDate")] Profesor profesor)
        {
            if (ModelState.IsValid)
            {
                _context.Add(profesor);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(profesor));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("Id,Name,Age,EnrollDate")] Student student)
        {
            if (ModelState.IsValid)
            {
                _context.Add(student);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(student));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("Id,NCode,SCode,Name,Family,Father,Phone,Mobile,Address,isActive")] Student student)
        {
            if (ModelState.IsValid)
            {
                _context.Add(student);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(student));
        }