public ActionResult Delete(int id)
 {
     try
     {
         var roles = _context.Roles.Find(id);
         if (roles == null)
         {
             return(NotFound());
         }
         _context.Remove(roles);
         _context.SaveChanges();
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Example #2
0
 public ActionResult Delete(int id)
 {
     try
     {
         var tp = _context.TipoPlanillas.Find(id);
         if (tp == null)
         {
             return(NotFound());
         }
         _context.Remove(tp);
         _context.SaveChanges();
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Example #3
0
 public ActionResult Delete(int id)
 {
     try
     {
         var empleado = _context.EmpleadosInactivos.Find(id);
         if (empleado == null)
         {
             return(NotFound());
         }
         _context.Remove(empleado);
         _context.SaveChanges();
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }
Example #4
0
 public ActionResult Delete(int id)
 {
     try
     {
         var history = _context.Historial.Find(id);
         if (history == null)
         {
             return(NotFound());
         }
         _context.Remove(history);
         _context.SaveChanges();
         return(Ok());
     }
     catch (Exception ex)
     {
         return(BadRequest(ex.Message));
     }
 }