Example #1
0
        public async Task <IActionResult> Edit(int id, Cliente cliente)
        {
            if (id != cliente.NumeroCliente)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cliente);
                    _context.Update(cliente.Persona);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClienteExists(cliente.NumeroCliente))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
Example #2
0
        public async Task <IActionResult> Edit(int id, Proveedor proveedor)
        {
            if (id != proveedor.NumeroProveedor)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(proveedor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProveedorExists(proveedor.NumeroProveedor))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(proveedor));
        }
Example #3
0
        public async Task <IActionResult> Edit(int id, [Bind("CodMovimientoInventario,TipoMovimiento,FechaMovimiento,Factura,PrecioUnitario,Cantidad,Observacion,InventarioFk,ProveedorFk,OrdenAprovisionamientoFk,Digitador,FechaDigitador")] MovimientoInventario movimientoInventario)
        {
            if (id != movimientoInventario.CodMovimientoInventario)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(movimientoInventario);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MovimientoInventarioExists(movimientoInventario.CodMovimientoInventario))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["InventarioFk"]             = new SelectList(_context.Inventario, "CodInventario", "CodInventario", movimientoInventario.InventarioFk);
            ViewData["OrdenAprovisionamientoFk"] = new SelectList(_context.OrdenAprovisionamiento, "NumeroOrdenAprovisionamiento", "NumeroOrdenAprovisionamiento", movimientoInventario.OrdenAprovisionamientoFk);
            ViewData["ProveedorFk"] = new SelectList(_context.Proveedor, "NumeroProveedor", "NumeroProveedor", movimientoInventario.ProveedorFk);
            return(View(movimientoInventario));
        }
Example #4
0
        public async Task <IActionResult> Edit(int id, Inventario inventario)
        {
            if (id != inventario.CodInventario)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(inventario);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InventarioExists(inventario.CodInventario))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AgregadoFk"] = new SelectList(_context.Agregado, "CodMateriaPrima", "CodMateriaPrima", inventario.AgregadoFk);
            return(View(inventario));
        }
Example #5
0
        public async Task <IActionResult> Edit(int id, LineaProduccion lineaProduccion)
        {
            if (id != lineaProduccion.NumeroLineaProduccion)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(lineaProduccion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!LineaProduccionExists(lineaProduccion.NumeroLineaProduccion))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(lineaProduccion));
        }
Example #6
0
        public async Task <IActionResult> Edit(int id, Insumo insumo)
        {
            if (id != insumo.CodInsumo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(insumo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InsumoExists(insumo.CodInsumo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(insumo));
        }
Example #7
0
        public async Task <IActionResult> Edit(int id, [Bind("CodEstructuraMateria,CodigoProducto,NombreModelo,TamanoEstandar,PrecioUnitario,Observaciones,Estado,LineaProduccionFk,Digitador,FechaDigitador")] ModeloProducto modeloProducto)
        {
            if (id != modeloProducto.CodEstructuraMateria)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(modeloProducto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ModeloProductoExists(modeloProducto.CodEstructuraMateria))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["LineaProduccionFk"] = new SelectList(_context.LineaProduccion, "NumeroLineaProduccion", "NumeroLineaProduccion", modeloProducto.LineaProduccionFk);
            return(View(modeloProducto));
        }
Example #8
0
        public async Task <IActionResult> Edit(int id, Pedido pedido)
        {
            if (id != pedido.NumeroOrdenCompra)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pedido);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PedidoExists(pedido.NumeroOrdenCompra))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ClienteFk"]  = new SelectList(_context.Persona, "NumeroCliente", "NombreCliente", pedido.ClienteFk);
            ViewData["VendedorFk"] = new SelectList(_context.Vendedor, "NumeroVendedor", "NumeroVendedor", pedido.VendedorFk);
            return(View(pedido));
        }
        public async Task<IActionResult> Edit(int id, [Bind("CodDetalle,CantidadDetalle,PrecioTotalDetalle,DetallePedidoFinalizado,PedidoFk,ModeloProductoFk,Digitador,FechaDigitador")] DetallePedido detallePedido)
        {
            if (id != detallePedido.CodDetalle)
            {
                return NotFound();
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(detallePedido);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DetallePedidoExists(detallePedido.CodDetalle))
                    {
                        return NotFound();
                    }
                    else
                    {
                        throw;
                    }
                }
                return RedirectToAction(nameof(Index));
            }
            ViewData["ModeloProductoFk"] = new SelectList(_context.ModeloProducto, "CodEstructuraMateria", "CodEstructuraMateria", detallePedido.ModeloProductoFk);
            ViewData["PedidoFk"] = new SelectList(_context.Pedido, "NumeroOrdenCompra", "NumeroOrdenCompra", detallePedido.PedidoFk);
            return View(detallePedido);
        }
        public async Task <IActionResult> Edit(int id, [Bind("CodUnidadMedida,NombreUnidadMedida,Abreviatura,Digitador,FechaDigitador")] UnidadMedida unidadMedida)
        {
            if (id != unidadMedida.CodUnidadMedida)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(unidadMedida);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UnidadMedidaExists(unidadMedida.CodUnidadMedida))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(unidadMedida));
        }
        public async Task <IActionResult> Edit(int id, MateriaPrima materiaPrima)
        {
            if (id != materiaPrima.CodMateriaPrima)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(materiaPrima);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MateriaPrimaExists(materiaPrima.CodMateriaPrima))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["InsumoFk"]       = new SelectList(_context.Insumo, "CodInsumo", "CodInsumo", materiaPrima.InsumoFk);
            ViewData["UnidadMedidaFk"] = new SelectList(_context.UnidadMedida, "CodUnidadMedida", "CodUnidadMedida", materiaPrima.UnidadMedidaFk);
            return(View(materiaPrima));
        }
Example #12
0
        public async Task <IActionResult> Edit(int id, OrdenAprovisionamiento ordenAprovisionamiento)
        {
            if (id != ordenAprovisionamiento.NumeroOrdenAprovisionamiento)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(ordenAprovisionamiento);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrdenAprovisionamientoExists(ordenAprovisionamiento.NumeroOrdenAprovisionamiento))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(ordenAprovisionamiento));
        }