public async Task <IActionResult> Edit(int id, [Bind("IdOrdenVenta,CantidadProducto,ValorUnitario,ValorTotal")] OrdenDeVenta ordenDeVenta) { if (id != ordenDeVenta.IdOrdenVenta) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(ordenDeVenta); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!OrdenDeVentaExists(ordenDeVenta.IdOrdenVenta)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(ordenDeVenta)); }
public async Task <IActionResult> Edit(int id, [Bind("IdPedido,IdEstadoPedido,Cantidad,IdUsuario")] Pedido pedido) { if (id != pedido.IdPedido) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(pedido); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PedidoExists(pedido.IdPedido)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdEstadoPedido"] = new SelectList(_context.EstadoDePedido, "IdEstadoPedido", "IdEstadoPedido", pedido.IdEstadoPedido); ViewData["IdUsuario"] = new SelectList(_context.Usuarios, "IdUsuario", "IdUsuario", pedido.IdUsuario); return(View(pedido)); }
public async Task <IActionResult> Edit(int id, [Bind("IdRol,TipoDeRol")] Rol rol) { if (id != rol.IdRol) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(rol); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!RolExists(rol.IdRol)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(rol)); }
public async Task <IActionResult> Edit(string id, [Bind("Id,UserName,NormalizedUserName,Email,NormalizedEmail,EmailConfirmed,PasswordHash,SecurityStamp,ConcurrencyStamp,PhoneNumber,PhoneNumberConfirmed,TwoFactorEnabled,LockoutEnabled,AccessFailedCount")] Aspnetusers aspnetusers) { if (id != aspnetusers.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(aspnetusers); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!AspnetusersExists(aspnetusers.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(aspnetusers)); }
public async Task <IActionResult> Edit(int id, [Bind("IdInventario,FechaIngreso,IdUsuario,IdOrdenCompra,IdOrdenVenta,IdPedido,IdProducto")] Inventario inventario) { if (id != inventario.IdInventario) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(inventario); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InventarioExists(inventario.IdInventario)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdOrdenCompra"] = new SelectList(_context.OrdenDeCompra, "IdOrdenCompra", "Producto", inventario.IdOrdenCompra); ViewData["IdOrdenVenta"] = new SelectList(_context.OrdenDeVenta, "IdOrdenVenta", "IdOrdenVenta", inventario.IdOrdenVenta); ViewData["IdPedido"] = new SelectList(_context.Pedido, "IdPedido", "IdUsuario", inventario.IdPedido); ViewData["IdProducto"] = new SelectList(_context.Producto, "IdProducto", "IdProducto", inventario.IdProducto); ViewData["IdUsuario"] = new SelectList(_context.Usuarios, "IdUsuario", "IdUsuario", inventario.IdUsuario); return(View(inventario)); }
public async Task <IActionResult> Edit(int id, [Bind("IdTipoTelefono,TipoDeTelefono1")] TipoDeTelefono tipoDeTelefono) { if (id != tipoDeTelefono.IdTipoTelefono) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(tipoDeTelefono); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TipoDeTelefonoExists(tipoDeTelefono.IdTipoTelefono)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(tipoDeTelefono)); }
public async Task <IActionResult> Edit(int id, [Bind("IdProducto,CantidaadProducto,IdTipoProducto,Descripcion,PrecioProducto")] 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["IdTipoProducto"] = new SelectList(_context.TipoDeProducto, "IdTipoProducto", "IdTipoProducto", producto.IdTipoProducto); return(View(producto)); }
public async Task <IActionResult> Edit(string id, [Bind("IdUsuario,IdRol,IdTelefono,Nombre,Apellido")] Usuarios usuarios) { if (id != usuarios.IdUsuario) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(usuarios); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UsuariosExists(usuarios.IdUsuario)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdRol"] = new SelectList(_context.Rol, "IdRol", "IdRol", usuarios.IdRol); ViewData["IdTelefono"] = new SelectList(_context.Telefono, "IdTelefono", "NumeroTelefonico", usuarios.IdTelefono); return(View(usuarios)); }
public async Task <IActionResult> Edit(int id, [Bind("IdEstadoPedido,NombreEstadoPedido")] EstadoDePedido estadoDePedido) { if (id != estadoDePedido.IdEstadoPedido) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(estadoDePedido); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!EstadoDePedidoExists(estadoDePedido.IdEstadoPedido)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(estadoDePedido)); }
public async Task <IActionResult> Edit(int id, [Bind("IdTelefono,IdTipoTelefono,NumeroTelefonico")] Telefono telefono) { if (id != telefono.IdTelefono) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(telefono); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!TelefonoExists(telefono.IdTelefono)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdTipoTelefono"] = new SelectList(_context.TipoDeTelefono, "IdTipoTelefono", "IdTipoTelefono", telefono.IdTipoTelefono); return(View(telefono)); }