public async Task <IActionResult> Edit(int id, [Bind("CargoId,Nombre,Descripcion,InternoExterno,CambioEstado")] Cargo cargo)
        {
            if (id != cargo.CargoId)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(cargo);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!CargoExists(cargo.CargoId))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(cargo));
        }
        public async Task <IActionResult> Edit(int id, [Bind("EmpleadoId,Nombre,Apellido,Documento,Email,Celular,Contrasena,CargoId")] 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));
        }
Esempio n. 3
0
 public async Task EditarProducto(Producto producto)
 {
     try
     {
         _context.Update(producto);
         await _context.SaveChangesAsync();
     }
     catch (Exception e)
     {
         throw e;
     }
 }
 public async Task EditarTipoProducto(TipoProducto tipoProducto)
 {
     _context.Update(tipoProducto);
     await _context.SaveChangesAsync();
 }
Esempio n. 5
0
 public async Task EditarEmpleado(Empleado empleado)
 {
     _context.Update(empleado);
     await ActualizarBd();
 }