예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombres,Apellidos")] PersonaNatural personaNatural)
        {
            if (id != personaNatural.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(personaNatural);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonaNaturalExists(personaNatural.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(personaNatural));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,NumeroDocumento,FechaCreacion")] Persona persona)
        {
            if (id != persona.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(persona);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonaExists(persona.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(persona));
        }
예제 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Direccion,Ciudad")] Localizacion localizacion)
        {
            if (id != localizacion.Id)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(localizacion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LocalizacionExists(localizacion.Id))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(localizacion));
        }
예제 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre")] TipoDocumento tipoDocumento)
        {
            if (id != tipoDocumento.Id)
            {
                return(NotFound());
            }

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