Exemplo n.º 1
0
        //public static int submotivo;
        public List <LlenarCombo> ObtenerCursos()
        {
            List <LlenarCombo> lista = new List <LlenarCombo>();

            Global.Conexion.Open();
            try
            {
                MySqlCommand    comando = new MySqlCommand("select idCurso, concat_ws('',c.anio,'° ',c.division,'°') as 'Cursos' from cursos as c where idCurso!= 0 and estado =0", Global.Conexion);
                MySqlDataReader lector  = comando.ExecuteReader();
                while (lector.Read())
                {
                    LlenarCombo Cuno = new LlenarCombo();
                    Cuno.IdCurso     = lector.GetInt32(0);
                    Cuno.CursoString = lector.GetString(1);

                    lista.Add(Cuno);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error al obtener el listado");
            }
            Global.Conexion.Close();
            return(lista);
        }
Exemplo n.º 2
0
        public List <LlenarCombo> ObtenerEspecialidad()
        {
            List <LlenarCombo> lista = new List <LlenarCombo>();

            Global.Conexion.Open();
            try
            {
                MySqlCommand    comando = new MySqlCommand("SELECT * FROM especialidad WHERE idEspecialidad != 0 ", Global.Conexion);
                MySqlDataReader lector  = comando.ExecuteReader();
                while (lector.Read())
                {
                    LlenarCombo ent = new LlenarCombo();
                    ent.IdEspecialidad     = lector.GetInt32(0);
                    ent.EspecialidadString = lector.GetString(1);

                    lista.Add(ent);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error al obtener el listado");
            }
            Global.Conexion.Close();
            return(lista);
        }
Exemplo n.º 3
0
        public List <LlenarCombo> ObtenerRetiroAnticipado()
        {
            List <LlenarCombo> lista = new List <LlenarCombo>();

            Global.Conexion.Open();
            try
            {
                MySqlCommand    comando = new MySqlCommand("SELECT idMotivo, asistencia FROM `motivos` WHERE idMotivo!= 0 and idEvento=3 and idSubmotivo=1 and estado=1", Global.Conexion);
                MySqlDataReader lector  = comando.ExecuteReader();
                while (lector.Read())
                {
                    LlenarCombo ent = new LlenarCombo();
                    ent.IdRetiroAnticipado     = lector.GetInt32(0);
                    ent.RetiroAnticipadoString = lector.GetString(1);

                    lista.Add(ent);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error al obtener el listado");
            }
            Global.Conexion.Close();
            return(lista);
        }
Exemplo n.º 4
0
        public List <LlenarCombo> ObtenerJerarquia()
        {
            List <LlenarCombo> lista = new List <LlenarCombo>();

            Global.Conexion.Open();
            try
            {
                MySqlCommand    comando = new MySqlCommand("SELECT permiso, tipodecargo FROM cargos WHERE idCargo!= 0", Global.Conexion);
                MySqlDataReader lector  = comando.ExecuteReader();
                while (lector.Read())
                {
                    LlenarCombo ent = new LlenarCombo();
                    ent.IdJerarquia     = lector.GetInt32(0);
                    ent.JerarquiaString = lector.GetString(1);

                    lista.Add(ent);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error al obtener el listado");
            }
            Global.Conexion.Close();
            return(lista);
        }
Exemplo n.º 5
0
        public InformeAlumno()
        {
            InitializeComponent();
            LlenarCombo llenar = new LlenarCombo();

            cmbCiclo.DataSource    = llenar.ObtenerCiclos();
            cmbCiclo.DisplayMember = "Ciclo";
            //cmbCiclo.SelectedIndex = -1;
            dtpHasta.MaxDate = Convert.ToDateTime(Oper.NombreArchivo(true, true, true));
        }
Exemplo n.º 6
0
        public List <LlenarCombo> ObtenerCiclos()
        {
            List <LlenarCombo> lista = new List <LlenarCombo>();

            Global.Conexion.Open();
            try
            {
                MySqlCommand    comando = new MySqlCommand("Select Ciclolectivo From ciclos Order By Ciclolectivo ASC", Global.Conexion);
                MySqlDataReader lector  = comando.ExecuteReader();
                while (lector.Read())
                {
                    LlenarCombo ent = new LlenarCombo();
                    ent.CicloString = lector.GetString(0);
                    lista.Add(ent);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error al obtener el listado");
            }
            Global.Conexion.Close();
            return(lista);
        }
Exemplo n.º 7
0
        public List <LlenarCombo> ObtenerTrimestresParaBandera()
        {
            List <LlenarCombo> lista = new List <LlenarCombo>();

            Global.Conexion.Open();
            try
            {
                MySqlCommand    comando = new MySqlCommand("Select id_trimestrenota, trimestre From trimestresnota where id_trimestrenota < 4", Global.Conexion);
                MySqlDataReader lector  = comando.ExecuteReader();
                while (lector.Read())
                {
                    LlenarCombo ent = new LlenarCombo();
                    ent.IdTrimestre     = lector.GetInt32(0);
                    ent.TrimestreString = lector.GetString(1);
                    lista.Add(ent);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error al obtener el listado");
            }
            Global.Conexion.Close();
            return(lista);
        }
Exemplo n.º 8
0
        public List <LlenarCombo> ObtenerMaterias(int idCurso)
        {
            List <LlenarCombo> lista = new List <LlenarCombo>();

            Global.Conexion.Open();
            try
            {
                MySqlCommand    comando = new MySqlCommand("SELECT m.idMateria, m.nombre FROM materias m INNER JOIN materiasxcursos mxc ON m.idMateria = mxc.id_Materia WHERE mxc.id_Curso = " + idCurso, Global.Conexion);
                MySqlDataReader lector  = comando.ExecuteReader();
                while (lector.Read())
                {
                    LlenarCombo ent = new LlenarCombo();
                    ent.idMateria     = lector.GetInt32(0);
                    ent.MateriaString = lector.GetString(1);
                    lista.Add(ent);
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, "Error al obtener el listado");
            }
            Global.Conexion.Close();
            return(lista);
        }