예제 #1
0
        public static ResponseGeneric ModificarProfesor(Teacher model)
        {
            ResponseGeneric response = new ResponseGeneric();

            response.status = false;
            if (ProfesorDataAccess.getPerson(model.Id) == null)
            {
                response = ProfesorDataAccess.ModificarProfesor(model);
                if (response.status)
                {
                    response.error = "Profesor modificado satisfactoriamente";
                }
                else
                {
                    response.error = "Error al modificar el profesor";
                }
            }
            else
            {
                response.error = "La persona ya existe en la base de datos";
            }


            return(response);
        }
예제 #2
0
        public static ResponseGeneric EliminarProfesor(int Id)
        {
            ResponseGeneric response = ProfesorDataAccess.EliminarProfesor(Id);

            if (response.status)
            {
                response.error = "Profesor eliminado con exito";
            }
            else
            {
                response.error = "Hubo un error al eliminar el profesor";
            }
            return(response);
        }
예제 #3
0
        public static ResponseGeneric CrearProfesor(CrearProfesorImportModel model)
        {
            ResponseGeneric response = new ResponseGeneric();

            if (ProfesorDataAccess.getPerson(model.ci) == null)
            {
                response = ProfesorDataAccess.CrearProfesor(model);
                if (response.status)
                {
                    response.error = "Profesor creado con exito";
                }
                else
                {
                    response.error = "Hubo un error al crear el profesor";
                }
            }
            else
            {
                response.error = "La persona ya existe en la base de datos";
            }
            return(response);
        }
예제 #4
0
 public static Teacher getProfesor(int Id)
 {
     return(ProfesorDataAccess.getProfesor(Id));
 }
예제 #5
0
 public static listaProfesores Profesores()
 {
     return(ProfesorDataAccess.Profesores());
 }