public async Task <IActionResult> Edit(int id, [Bind("IdMaterial,NombreMaterial")] Material material)
        {
            if (id != material.IdMaterial)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(material);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MaterialExists(material.IdMaterial))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(material));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("IdProducto,Nombre,IdMaterial,IdTipoProducto,PrecioUnidad")] 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["IdMaterial"]     = new SelectList(_context.Material, "IdMaterial", "NombreMaterial", producto.IdMaterial);
            ViewData["IdTipoProducto"] = new SelectList(_context.TipoProducto, "IdTipoProducto", "NombreProducto", producto.IdTipoProducto);
            return(View(producto));
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdProveedor,Distribuidora,Direccion,Telefono")] Proveedor proveedor)
        {
            if (id != proveedor.IdProveedor)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(proveedor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProveedorExists(proveedor.IdProveedor))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(proveedor));
        }
예제 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("IdBarrio,NombreBarrio")] Barrios barrios)
        {
            if (id != barrios.IdBarrio)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(barrios);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!BarriosExists(barrios.IdBarrio))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(barrios));
        }
예제 #5
0
        public async Task <IActionResult> Edit(int id, [Bind("IdPedido,IdCotizacion,FechaPedido,LugarEntrega,IdBarrio")] 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["IdBarrio"]     = new SelectList(_context.Barrios, "IdBarrio", "NombreBarrio", pedido.IdBarrio);
            ViewData["IdCotizacion"] = new SelectList(_context.Cotizacion, "IdCotizacion", "IdCotizacion", pedido.IdCotizacion);
            return(View(pedido));
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdTipoProducto,NombreProducto")] TipoProducto tipoProducto)
        {
            if (id != tipoProducto.IdTipoProducto)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(tipoProducto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TipoProductoExists(tipoProducto.IdTipoProducto))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(tipoProducto));
        }
예제 #7
0
        public async Task <IActionResult> Edit(int id, [Bind("IdProduccion,IdProducto,FechaProduccion,DetalleProducto,IdEstado,Cantidad,IdPerfil")] Produccion produccion)
        {
            if (id != produccion.IdProduccion)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(produccion);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProduccionExists(produccion.IdProduccion))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdEstado"]   = new SelectList(_context.EstadoProduccion, "IdEstado", "EstadoProduccion1", produccion.IdEstado);
            ViewData["IdPerfil"]   = new SelectList(_context.Perfil, "IdUsuarios", "PrimerApellido", produccion.IdPerfil);
            ViewData["IdProducto"] = new SelectList(_context.Producto, "IdProducto", "Nombre", produccion.IdProducto);
            return(View(produccion));
        }
예제 #8
0
        public async Task <IActionResult> Edit(int id, [Bind("IdInsumo,NombreInsumo,IdColor,IdProveedor")] Insumos insumos)
        {
            if (id != insumos.IdInsumo)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(insumos);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!InsumosExists(insumos.IdInsumo))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdColor"]     = new SelectList(_context.Colores, "IdColor", "Color", insumos.IdColor);
            ViewData["IdProveedor"] = new SelectList(_context.Proveedor, "IdProveedor", "Distribuidora", insumos.IdProveedor);
            return(View(insumos));
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdReciboPago,IdPedido")] ReciboPago reciboPago)
        {
            if (id != reciboPago.IdReciboPago)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(reciboPago);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ReciboPagoExists(reciboPago.IdReciboPago))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdPedido"] = new SelectList(_context.Pedido, "IdPedido", "IdPedido", reciboPago.IdPedido);
            return(View(reciboPago));
        }
예제 #10
0
        public async Task <IActionResult> Edit(int id, [Bind("IdColor,Color")] Colores colores)
        {
            if (id != colores.IdColor)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(colores);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ColoresExists(colores.IdColor))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(colores));
        }
예제 #11
0
        public async Task <IActionResult> Edit(int id, [Bind("IdUsuarios,PrimerNombre,PrimerApellido,Direccion,AspnetusersId")] Perfil perfil)
        {
            if (id != perfil.IdUsuarios)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(perfil);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PerfilExists(perfil.IdUsuarios))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AspnetusersId"] = new SelectList(_context.Aspnetusers, "Id", "Email", perfil.AspnetusersId);
            return(View(perfil));
        }
예제 #12
0
        public async Task <IActionResult> Edit(int id, [Bind("IdEntregaPedido,IdPedido,IdProduccion,FechaEntrega")] EntregaPedido entregaPedido)
        {
            if (id != entregaPedido.IdEntregaPedido)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(entregaPedido);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EntregaPedidoExists(entregaPedido.IdEntregaPedido))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdPedido"]     = new SelectList(_context.Pedido, "IdPedido", "IdPedido", entregaPedido.IdPedido);
            ViewData["IdProduccion"] = new SelectList(_context.Produccion, "IdProduccion", "IdProduccion", entregaPedido.IdProduccion);
            return(View(entregaPedido));
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdInventario,IdInsumo,FechaIngreso,Cantidad,ValorUnidadValorMetro,ValorTotal,IdPerfil")] 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["IdInsumo"] = new SelectList(_context.Insumos, "IdInsumo", "NombreInsumo", inventario.IdInsumo);
            ViewData["IdPerfil"] = new SelectList(_context.Perfil, "IdUsuarios", "PrimerApellido", inventario.IdPerfil);
            return(View(inventario));
        }