コード例 #1
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Apellido,Telefono,Email,Imagen")] Empleado empleado)
        {
            if (ModelState.IsValid)
            {
                _context.Add(empleado);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(empleado));
        }
コード例 #2
0
        public async Task <IActionResult> Create([Bind("name,id")] Departments departments)
        {
            if (ModelState.IsValid)
            {
                _context.Add(departments);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(departments));
        }
コード例 #3
0
        public async Task <IActionResult> Create([Bind("Id,Nombre,Abreviatura")] Departamento departamento)
        {
            if (ModelState.IsValid)
            {
                _context.Add(departamento);
                await _context.SaveChangesAsync();

                return(RedirectToAction(nameof(Index)));
            }
            return(View(departamento));
        }
コード例 #4
0
ファイル: EmpresasController.cs プロジェクト: NagoreReina/M3
        public async Task <IActionResult> Create([Bind("Id,Nombre,Direccion,CIF,Pais")] Empresa empresa)
        {
            if (ModelState.IsValid)
            {
                _context.Add(empresa);
                await _context.SaveChangesAsync();

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