Exemple #1
0
        public async Task <IActionResult> Edit(string id, [Bind("IdVapo,Intecambiador_Izq,Intecambiador_Der")] Vapo vapo)
        {
            if (id != vapo.IdVapo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(vapo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!VapoExists(vapo.IdVapo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(vapo));
        }
Exemple #2
0
        public async Task <IActionResult> Edit(string id, [Bind("nombreApe,telefono")] Persona persona)
        {
            if (id != persona.nombreApe)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(persona);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PersonaExists(persona.nombreApe))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(persona));
        }
Exemple #3
0
        public async Task <IActionResult> Edit(int id, [Bind("IdRegistro,fecha,IdVapo,nombreApe,Prueba_Hidráulica,Prueba_Estanqueidad,Prueba_Funcionamiento,Detalles")] Registro registro)
        {
            if (id != registro.IdRegistro)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(registro);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RegistroExists(registro.IdRegistro))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["nombreApe"] = new SelectList(_context.Personas, "nombreApe", "nombreApe", registro.nombreApe);
            ViewData["IdVapo"]    = new SelectList(_context.Vapos, "IdVapo", "IdVapo", registro.IdVapo);
            return(View(registro));
        }