public async Task <IActionResult> Edit(int id, [Bind("idTipoEvento,nombre,estado,idMaestroEvento")] TipoEvento tipoEvento) { if (id != tipoEvento.idTipoEvento) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tipoEvento); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TipoEventoExists(tipoEvento.idTipoEvento)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["idMaestroEvento"] = new SelectList(_context.Set <MaestroEvento>(), "idMaestroEvento", "nombre", tipoEvento.idMaestroEvento); return(View(tipoEvento)); }
public async Task <IActionResult> Edit(int id, [Bind("idGrupoEspacio,nombre,estado")] GrupoEspacio grupoEspacio) { if (id != grupoEspacio.idGrupoEspacio) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(grupoEspacio); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!GrupoEspacioExists(grupoEspacio.idGrupoEspacio)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(grupoEspacio)); }
public async Task <IActionResult> Edit(int id, [Bind("idcategoria,nombre,descripcion,estado")] Categoria categoria) { if (id != categoria.idcategoria) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(categoria); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CategoriaExists(categoria.idcategoria)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(categoria)); }
public async Task <IActionResult> Edit(int id, [Bind("IdProducto,IdCategoria,Codigo,Nombre,Precio_venta,Stock,Descripcion,Estado")] Producto producto) { if (id != producto.IdProducto) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(producto); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductoExists(producto.IdProducto)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdCategoria"] = new SelectList(_context.Categoria, "IdCategoria", "Nombre", producto.IdCategoria); return(View(producto)); }
public async Task <IActionResult> Edit(int id, [Bind("idEspacio,nombre,capacidadMaxima,area,combo,estado,idFlujoIngreso,idGrupoEspacio,idVenue")] Espacio espacio) { if (id != espacio.idEspacio) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(espacio); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EspacioExists(espacio.idEspacio)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["idFlujoIngreso"] = new SelectList(_context.FlujoIngreso, "idFlujoIngreso", "nombre", espacio.idFlujoIngreso); ViewData["idGrupoEspacio"] = new SelectList(_context.GrupoEspacio, "idGrupoEspacio", "nombre", espacio.idGrupoEspacio); ViewData["idVenue"] = new SelectList(_context.Venue, "idVenue", "nombre", espacio.idVenue); return(View(espacio)); }
public async Task <IActionResult> Edit(int id, [Bind("idtipocaja,nombre")] t_tipo_caja t_tipo_caja) { if (id != t_tipo_caja.idtipocaja) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(t_tipo_caja); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!t_tipo_cajaExists(t_tipo_caja.idtipocaja)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(t_tipo_caja)); }
public async Task <IActionResult> Edit(int id, [Bind("idCuenta,nombre,calle,colonia,noInt,noExt,ciudad,estado,pais,cp,web,descripcion,estatus,idContacto,idSegmento,idCampana")] Cuenta cuenta) { if (id != cuenta.idCuenta) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cuenta); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!CuentaExists(cuenta.idCuenta)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["idCampana"] = new SelectList(_context.Set <Campana>(), "idCampana", "nombre", cuenta.idCampana); ViewData["idContacto"] = new SelectList(_context.Contacto, "idContacto", "email", cuenta.idContacto); ViewData["idSegmento"] = new SelectList(_context.Segmento, "idSegmento", "nombre", cuenta.idSegmento); return(View(cuenta)); }
public async Task <IActionResult> Edit(int id, [Bind("idtcaja,fecha_registro,fecha_cierre,usuario,anio,tipo")] t_caja t_caja) { if (id != t_caja.idtcaja) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(t_caja); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!t_cajaExists(t_caja.idtcaja)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["tipo"] = new SelectList(_context.ttipocaja, "idtipocaja", "nombre", t_caja.tipo); return(View(t_caja)); }
public async Task <IActionResult> Edit(int id, [Bind("idContacto,nombre,telefono,email,estado")] Contacto contacto) { if (id != contacto.idContacto) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(contacto); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ContactoExists(contacto.idContacto)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(contacto)); }
public async Task <IActionResult> Edit(int id, [Bind("idVenue,nombre,estado")] Venue venue) { if (id != venue.idVenue) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(venue); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VenueExists(venue.idVenue)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(venue)); }
public async Task <IActionResult> Edit(int id, [Bind("idFlujoIngreso,nombre,estado,idTipoIngreso")] FlujoIngreso flujoIngreso) { if (id != flujoIngreso.idFlujoIngreso) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(flujoIngreso); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!FlujoIngresoExists(flujoIngreso.idFlujoIngreso)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["idTipoIngreso"] = new SelectList(_context.TipoIngreso, "idTipoIngreso", "nombre", flujoIngreso.idTipoIngreso); return(View(flujoIngreso)); }
public async Task <IActionResult> Edit(int id, [Bind("idRazonSocial,nombre,rfc,calle,colonia,noInt,noExt,ciudad,estado,pais,cp,metodoPago,usoCfdi,estatus,idCuenta")] RazonSocial razonSocial) { if (id != razonSocial.idRazonSocial) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(razonSocial); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RazonSocialExists(razonSocial.idRazonSocial)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["idCuenta"] = new SelectList(_context.Cuenta, "idCuenta", "nombre", razonSocial.idCuenta); return(View(razonSocial)); }
public async Task Alterar(T entidade) { _dbContexto.Update <T>(entidade); await _dbContexto.SaveChangesAsync(); }
public bool Update(TEntity ob) { db.Update(ob); return(false); }
public void Update <T>(T entity) where T : class { _context.Update(entity); _context.SaveChanges(); }