Beispiel #1
0
 public void insertarDD(Maestro aux)
 {
     cnn   = c.conectar;
     query = "INSERT INTO MAESTRO(IDPROYECTO,IDPERSONA,CARGO,carrera)VALUES(" + aux.idProyecto + "," + aux.idPersona + "," +
             "'DD','" + aux.carrera + "')";
     cmd = new SqlCommand(query, cnn);
     cmd.ExecuteNonQuery();
     cnn.Close();
 }
Beispiel #2
0
 public void agregarMaestro(Maestro ma)
 {
     cnn   = c.conectar;
     query = @"INSERT INTO MAESTRO(IDPROYECTO, IDPERSONA, CARGO, CARRERA) VALUES(" + ma.idProyecto + ","
             + ma.idPersona + ",'" + ma.cargo + "','" + ma.carrera.Trim() + "')";
     cmd = new SqlCommand(query, cnn);
     cmd.ExecuteNonQuery();
     cnn.Close();
     c.desconectar();
 }
        public void registrarTutorAcademico(Maestro maestro, Estudiante estudiate)
        {
            SqlCommand cmd = new SqlCommand();

            cnn   = c.conectar;
            query = "UPDATE ESTUDIANTE SET IDMAPERSONA=" + maestro.idPersona + " WHERE IDPERSONA=" + estudiate.idPersona + "";
            cmd   = new SqlCommand(query, cnn);
            cmd.ExecuteNonQuery();
            cnn.Close();
            c.desconectar();
        }
Beispiel #4
0
        public List <Maestro> queryDocentesProyecto()
        {
            List <Maestro> listaMaestro = new List <Maestro>();

            cnn = c.conectar;
            using (cnn)
            {
                query = @"SELECT DISTINCT m.IDPROYECTO,m.IDPERSONA,m.CARGO,m.CARGO,P.NOMBREPERSONA, p.APELLIDOPERSONA FROM Persona p,MAESTRO m, ESTUDIANTE e WHERE m.CARGO = 'MP' AND M.IDPERSONA=P.IDPERSONA";
                SqlCommand    cmd  = new SqlCommand(query, cnn);
                SqlDataReader read = cmd.ExecuteReader();
                while (read.Read())
                {
                    Maestro maestro = new Maestro(Convert.ToInt16(read[0]), Convert.ToInt16(read[1]),
                                                  Convert.ToString(read[2]), Convert.ToString(read[3]), Convert.ToString(read[4]),
                                                  Convert.ToString(read[5]));
                    listaMaestro.Add(maestro);
                }
            }
            cnn.Close();
            c.desconectar();
            return(listaMaestro);
        }