public async Task <IActionResult> Edit(int id, [Bind("Id,ApartamentoID,Nombre,Apellido,telefono")] Propietario propietario) { if (id != propietario.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(propietario); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PropietarioExists(propietario.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["ApartamentoID"] = new SelectList(_context.Apartamento, "Id", "Id", propietario.ApartamentoID); return(View(propietario)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Estado")] Ciudad ciudad) { if (id != ciudad.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ciudad); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CiudadExists(ciudad.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ciudad)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Id_mercado,Id_producto,Cantidad")] Compra compra) { if (id != compra.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(compra); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CompraExists(compra.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(compra)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Unidad_de_Medida,Estado")] Producto producto) { if (id != producto.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(producto); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductoExists(producto.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(producto)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Fecha_creacion,Estado")] Mercado_ mercado_) { if (id != mercado_.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(mercado_); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Mercado_Exists(mercado_.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(mercado_)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Direccion,telefono,Estado")] Unidad_Residencial unidad_Residencial) { if (id != unidad_Residencial.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(unidad_Residencial); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!Unidad_ResidencialExists(unidad_Residencial.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(unidad_Residencial)); }
public void Atualizar(TEntity entity) { MercadoContext.Update(entity); }