Beispiel #1
0
        //Editar Datos del profesor
        static public bool EditarDatosProfesor(int id_profesor, PROFESOR profeEditar)
        {
            try
            {
                using (var datos = new bd_webEntities())
                {
                    PROFESOR profesor = datos.PROFESORs.Where(ss => ss.ID_PROFESOR == id_profesor).FirstOrDefault();
                    profesor.CORREO    = profeEditar.CORREO;
                    profesor.CELULAR   = profeEditar.CELULAR;
                    profesor.APELLIDOS = profeEditar.APELLIDOS;
                    profesor.NOMBRES   = profeEditar.NOMBRES;
                    profesor.PROFESION = profeEditar.PROFESION;
                    profesor.FECHA_MOD = profeEditar.FECHA_MOD;
                    profesor.DIRECCION = profeEditar.DIRECCION;


                    datos.SaveChanges();
                }
                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }
Beispiel #2
0
        //añadir  un nuevo curso del profesor
        static public bool AddCursoProfesor(CURSO cursoAdd)
        {
            try
            {
                using (var datos = new bd_webEntities())
                {
                    datos.CURSOes.Add(cursoAdd);
                    datos.SaveChanges();
                }

                return(true);
            }
            catch (Exception e)
            {
                return(false);
            }
        }
Beispiel #3
0
 //Eliminar al profesor por su id
 static public bool EliminarProfesor(int id_profesor)
 {
     try
     {
         using (var datos = new bd_webEntities())
         {
             PROFESOR profe = datos.PROFESORs.Where(ss => ss.ID_PROFESOR == id_profesor).FirstOrDefault();
             datos.PROFESORs.Remove(profe);
             datos.SaveChanges();
         }
         return(true);
     }
     catch (Exception e)
     {
         return(false);
     }
 }
Beispiel #4
0
 // Método para eliminar un curso del profesor
 static public bool EliminarCursoProfesor(int id_cursoProfe)
 {
     try
     {
         using (var datos = new bd_webEntities())
         {
             CURSO curso = datos.CURSOes.Where(ss => ss.ID_CURSO == id_cursoProfe).FirstOrDefault();
             datos.CURSOes.Remove(curso);
             datos.SaveChanges();
         }
         return(true);
     }
     catch (Exception e)
     {
         Console.WriteLine(e.Message);
         return(false);
     }
 }
Beispiel #5
0
        //Agregar profesor
        static public bool AgregarProfesor(PROFESOR ProfesorAdd)
        {
            try
            {
                using (var datos = new bd_webEntities())
                {
                    datos.PROFESORs.Add(ProfesorAdd);
                    datos.SaveChanges();
                }

                return(true);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
                return(false);
            }
        }