Beispiel #1
0
        public async Task <IActionResult> Edit(int id, [Bind("IdExcusa,AnexoEvidencia,Nombre1,Nombre2,Apellido1,Apellodo2,Correo,Telefono,RolIdRol")] Excusa excusa)
        {
            if (id != excusa.IdExcusa)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(excusa);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ExcusaExists(excusa.IdExcusa))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RolIdRol"] = new SelectList(_context.Rol, "IdRol", "NombreRol", excusa.RolIdRol);
            return(View(excusa));
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdProyecto,NumeroEmpleados,DireccionPoyecto,PersonaResponsable,RolIdRol")] Proyecto proyecto)
        {
            if (id != proyecto.IdProyecto)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(proyecto);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ProyectoExists(proyecto.IdProyecto))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RolIdRol"] = new SelectList(_context.Rol, "IdRol", "NombreRol", proyecto.RolIdRol);
            return(View(proyecto));
        }
Beispiel #3
0
        public async Task <IActionResult> Edit(int id, [Bind("IdRol,NombreRol")] Rol rol)
        {
            if (id != rol.IdRol)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(rol);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!RolExists(rol.IdRol))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(rol));
        }
Beispiel #4
0
        public async Task <IActionResult> Edit(int id, [Bind("IdConsulta,HoraIngreso,HoraSalida,RolIdRol,JornadaIdJornada")] TurnoLaboral turnoLaboral)
        {
            if (id != turnoLaboral.IdConsulta)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(turnoLaboral);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!TurnoLaboralExists(turnoLaboral.IdConsulta))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["JornadaIdJornada"] = new SelectList(_context.Jornada, "IdJornada", "IdJornada", turnoLaboral.JornadaIdJornada);
            ViewData["RolIdRol"]         = new SelectList(_context.Rol, "IdRol", "NombreRol", turnoLaboral.RolIdRol);
            return(View(turnoLaboral));
        }
Beispiel #5
0
        public async Task <IActionResult> Edit(int id, [Bind("IdPermiso,Nombre1,Nombre2,Apellido1,Apellido2,Correo,Telefono,RolIdRol")] Permiso permiso)
        {
            if (id != permiso.IdPermiso)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(permiso);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!PermisoExists(permiso.IdPermiso))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["RolIdRol"] = new SelectList(_context.Rol, "IdRol", "NombreRol", permiso.RolIdRol);
            return(View(permiso));
        }
Beispiel #6
0
        public async Task <IActionResult> Edit(int id, [Bind("IdListaEmpleados,ProyectoIdProyecto")] ListaEmpleados listaEmpleados)
        {
            if (id != listaEmpleados.IdListaEmpleados)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(listaEmpleados);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!ListaEmpleadosExists(listaEmpleados.IdListaEmpleados))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["ProyectoIdProyecto"] = new SelectList(_context.Proyecto, "IdProyecto", "DireccionPoyecto", listaEmpleados.ProyectoIdProyecto);
            return(View(listaEmpleados));
        }
Beispiel #7
0
        public async Task <IActionResult> Edit(int id, [Bind("Nit,NombreEmpresa,Direccion,Ciudad,Telefono")] Empresa empresa)
        {
            if (id != empresa.Nit)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(empresa);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!EmpresaExists(empresa.Nit))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            return(View(empresa));
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdUsuario,PrimerNombre,SegundoNombre,PrimerApellido,SegundoApellido,Correo,Edad,Telefono,Contraseña,EmpresaNit,RolIdRol")] Usuario usuario)
        {
            if (id != usuario.IdUsuario)
            {
                return(NotFound());
            }

            if (ModelState.IsValid)
            {
                try
                {
                    _context.Update(usuario);
                    await _context.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (!UsuarioExists(usuario.IdUsuario))
                    {
                        return(NotFound());
                    }
                    else
                    {
                        throw;
                    }
                }
                return(RedirectToAction(nameof(Index)));
            }
            ViewData["EmpresaNit"] = new SelectList(_context.Empresa, "Nit", "Ciudad", usuario.EmpresaNit);
            ViewData["RolIdRol"]   = new SelectList(_context.Rol, "IdRol", "NombreRol", usuario.RolIdRol);
            return(View(usuario));
        }
        public async Task <IActionResult> Edit(int id, [Bind("IdJornada,Jornada1")] Jornada jornada)
        {
            if (id != jornada.IdJornada)
            {
                return(NotFound());
            }

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