public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Descripcion,Telefono,Direccion,Email")] Cliente cliente) { if (id != cliente.Id) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(cliente); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!ClienteExists(cliente.Id)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(cliente)); }
public async Task <IActionResult> Edit(int id, [Bind("Id,Nombre,Descripcion,Categoriaid,Cantidad,Precio,Costo,Impuestoventas,Impuestovarios")] 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))); } ViewData["Categoriaid"] = new SelectList(_context.Categoriaproducto, "Id", "Categoria", producto.Categoriaid); return(View(producto)); }