public async Task <IActionResult> Edit(int id, [Bind("IdProducto,Identificador,Descripcion,IdProveedor,PrecioUnitario,PrecioVenta,IdCategoria,Impuestos,VerificaDisponible,Descuento,Utilidad")] InventarioProductos inventarioProductos) { if (id != inventarioProductos.IdProducto) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(inventarioProductos); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!InventarioProductosExists(inventarioProductos.IdProducto)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } ViewData["IdCategoria"] = new SelectList(_context.InventarioCategorias, "IdCategoria", "Descripcion", inventarioProductos.IdCategoria); ViewData["IdProveedor"] = new SelectList(_context.ProveeduriaProveedores, "IdProveedor", "Correo", inventarioProductos.IdProveedor); return(View(inventarioProductos)); }
public async Task <IActionResult> Create([Bind("IdProducto,Identificador,Descripcion,IdProveedor,PrecioUnitario,PrecioVenta,IdCategoria,Impuestos,VerificaDisponible,Descuento,Utilidad")] InventarioProductos inventarioProductos) { if (ModelState.IsValid) { _context.Add(inventarioProductos); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } ViewData["IdCategoria"] = new SelectList(_context.InventarioCategorias, "IdCategoria", "Descripcion", inventarioProductos.IdCategoria); ViewData["IdProveedor"] = new SelectList(_context.ProveeduriaProveedores, "IdProveedor", "Correo", inventarioProductos.IdProveedor); return(View(inventarioProductos)); }
private void InventarioDeProductoToolStripMenuItem_Click(object sender, EventArgs e) { InventarioProductos formInventarioProductos = new InventarioProductos(); CargarFormulario(formInventarioProductos); }