예제 #1
0
        public async Task <IActionResult> Edit(int id, [Bind("IdOrdenCompra,NumOrden,FechaSolicitud,FechaEntrega,IdCliente,IdPago")] OrdenCompra ordenCompra)
        {
            if (id != ordenCompra.IdOrdenCompra)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(ordenCompra);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrdenCompraExists(ordenCompra.IdOrdenCompra))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCliente"] = new SelectList(_context.Clientes, "IdCliente", "Ciudad", ordenCompra.IdCliente);
            ViewData["IdPago"]    = new SelectList(_context.CondicionPago, "IdPago", "Plazo", ordenCompra.IdPago);
            return(View(ordenCompra));
        }
예제 #2
0
        public async Task <IActionResult> Edit(int id, [Bind("IdProducto,VlrUnitario,IdArte,IdCategoria")] 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["IdArte"]      = new SelectList(_context.ArteProducto, "IdArte", "Alto", producto.IdArte);
            ViewData["IdCategoria"] = new SelectList(_context.CategoriaProducto, "IdCategoria", "Categoria", producto.IdCategoria);
            return(View(producto));
        }
예제 #3
0
        public async Task <IActionResult> Edit(int id, [Bind("IdOrdenPago,Fecha,FechaVencimiento")] OrdenPago ordenPago)
        {
            if (id != ordenPago.IdOrdenPago)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(ordenPago);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!OrdenPagoExists(ordenPago.IdOrdenPago))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(ordenPago));
        }
예제 #4
0
        public async Task <IActionResult> Edit(int id, [Bind("IdArte,NombreProducto,Alto,Largo,Ancho,Imagen,IdCliente,Estado")] ArteProducto arteProducto)
        {
            if (id != arteProducto.IdArte)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(arteProducto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ArteProductoExists(arteProducto.IdArte))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdCliente"] = new SelectList(_context.Clientes, "IdCliente", "Ciudad", arteProducto.IdCliente);
            return(View(arteProducto));
        }
예제 #5
0
        public async Task <IActionResult> Edit(int id, [Bind("IdCliente,Nit,RazonSocial,Direccion,Telefono,Correo,PersonaContacto,Ciudad,IdUsuarios")] Clientes clientes)
        {
            if (id != clientes.IdCliente)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(clientes);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClientesExists(clientes.IdCliente))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["IdUsuarios"] = new SelectList(_context.Usuarios, "IdUsuarios", "Contraseña", clientes.IdUsuarios);
            return(View(clientes));
        }
예제 #6
0
        public async Task <IActionResult> Edit(int id, [Bind("IdProveedor,Nit,RazonSocial,Direccion,Telefono,Correo,PersonaContacto,IdCategoria")] 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)));
            }
            ViewData["IdCategoria"] = new SelectList(_context.CategoriaProveedor, "IdCategoria", "Categoria", proveedor.IdCategoria);
            return(View(proveedor));
        }