public IActionResult Cerrar(int?id) { Pedidos pedido = _context.Pedidos.Find(id); pedido.EstaEntregado = true; pedido.EstaPago = true; pedido.PedidoCerrado = true; _context.Update(pedido); _context.SaveChangesAsync(); return(RedirectToAction("Pendientes", "Pedidos")); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Tipos")] ConfiguracionTipos configuracionTipos) { if (id != configuracionTipos.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(configuracionTipos); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ConfiguracionTiposExists(configuracionTipos.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(configuracionTipos)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,IdPedido,Producto,Cantidad")] ProductosVendidos productosVendidos) { if (id != productosVendidos.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(productosVendidos); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductosVendidosExists(productosVendidos.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(productosVendidos)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Direccion,Correo,Telefono,Localidad")] Clientes clientes) { if (id != clientes.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(clientes); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClientesExists(clientes.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(clientes)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,TipoMercaderia,Direccion,Telefono,NombrePersonal")] Proveedores proveedores) { if (id != proveedores.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(proveedores); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProveedoresExists(proveedores.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(proveedores)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Producto,Tipo,HayStock,UnidadUsada,PrecioKgUnidad,CantidadDisponible")] Productos productos) { if (id != productos.Id) { return(NotFound()); } if (ModelState.IsValid && numeroValido(productos.PrecioKgUnidad) && numeroValido(productos.CantidadDisponible) && productos.Producto != null) { if (productos.CantidadDisponible == 0) { productos.HayStock = false; } else { productos.HayStock = true; } try { _context.Update(productos); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ProductosExists(productos.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(productos)); }