public async Task <IActionResult> Create([Bind("IdAlumno,Nombre,ApPaterno,ApMaterno,Email,BanActivo")] Alumno alumno)
        {
            if (ModelState.IsValid)
            {
                _context.Add(alumno);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(alumno));
        }
예제 #2
0
        public async Task <IActionResult> Create([Bind("DeptId,DeptName")] Department department)
        {
            if (ModelState.IsValid)
            {
                _context.Add(department);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(department));
        }
예제 #3
0
        public async Task <IActionResult> Create([Bind("IdColonia,IdDelMun,Nombre")] Colonia colonia)
        {
            if (ModelState.IsValid)
            {
                _context.Add(colonia);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdDelMun"] = new SelectList(_context.DelegacionMunicipio, "IdDelMun", "IdDelMun", colonia.IdDelMun);
            return(View(colonia));
        }