コード例 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("id,nombres,apellidos,domicilio")] Clientes clientes)
        {
            if (id != clientes.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(clientes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClientesExists(clientes.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(clientes));
        }
コード例 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("id,nombres,apellidos,domicilio,fechaNacimiento")] Personal personal)
        {
            if (id != personal.id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(personal);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonalExists(personal.id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(personal));
        }