public async Task <IActionResult> Edit(int id, [Bind("ClienteID,Nombre,Apellido,Direccion,Email,Telefono,Documento")] Cliente cliente)
        {
            if (id != cliente.ClienteID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cliente);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ClienteExists(cliente.ClienteID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cliente));
        }
        public async Task <IActionResult> Edit(int id, [Bind("ProveedorID,Nombre,Telefono,Direccion")] Proveedor proveedor)
        {
            if (id != proveedor.ProveedorID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(proveedor);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProveedorExists(proveedor.ProveedorID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(proveedor));
        }
        public async Task <IActionResult> Edit(int id, [Bind("EmpleadoID,Nombre,Apellido,Documento,Cargo,Telefono")] Empleado empleado)
        {
            if (id != empleado.EmpleadoID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(empleado);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmpleadoExists(empleado.EmpleadoID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(empleado));
        }
Example #4
0
        public async Task <IActionResult> Edit(int id, [Bind("PedidoID,AutoservicioID,ClienteID,MetodoPagoID,DomicilioID,FechaHora,Direccion,Total")] Pedido pedido)
        {
            if (id != pedido.PedidoID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(pedido);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PedidoExists(pedido.PedidoID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["AutoservicioID"] = new SelectList(_context.Autoservicio, "AutoservicioID", "Nombre", pedido.AutoservicioID);
            ViewData["ClienteID"]      = new SelectList(_context.Cliente, "ClienteID", "Nombre", pedido.ClienteID);
            ViewData["DomicilioID"]    = new SelectList(_context.Domicilio, "DomicilioID", "DomicilioID", pedido.DomicilioID);
            ViewData["MetodoPagoID"]   = new SelectList(_context.MetodoPago, "MetodoPagoID", "Nombre", pedido.MetodoPagoID);
            return(View(pedido));
        }
        public async Task <IActionResult> Edit(int id, [Bind("AutoservicioID,Nombre,Direccion,Telefono,Estado,Imagen")] Autoservicio autoservicio)
        {
            if (id != autoservicio.AutoservicioID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(autoservicio);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!AutoservicioExists(autoservicio.AutoservicioID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(autoservicio));
        }
        public async Task <IActionResult> Edit(int id, [Bind("DomicilioID,TransporteID,HoraFecha")] Domicilio domicilio)
        {
            if (id != domicilio.DomicilioID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(domicilio);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!DomicilioExists(domicilio.DomicilioID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["TransporteID"] = new SelectList(_context.Set <Transporte>(), "TransporteID", "TransporteID", domicilio.TransporteID);
            return(View(domicilio));
        }
Example #7
0
        public async Task <IActionResult> Edit(int id, [Bind("MetodoPagoID,Nombre,NumeroReferencia")] MetodoPago metodoPago)
        {
            if (id != metodoPago.MetodoPagoID)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(metodoPago);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!MetodoPagoExists(metodoPago.MetodoPagoID))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(metodoPago));
        }
        public async Task<IActionResult> Edit(int id, [Bind("TransporteID,TipoVehiculo,Marca,Placa,Color,Estado")] Transporte transporte)
        {
            if (id != transporte.TransporteID)
            {
                return NotFound();
            }

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