コード例 #1
0
ファイル: Correlativas.cs プロジェクト: LucasEG95/Instituto
        private void btnLupaMat_Click(object sender, EventArgs e)
        {
            DataTable dsaux = new DataTable();

            if ((txtCarrera.Text.Trim() != null) && (txtCarrera.Text.Trim() != "") && (cmbAño.Text.ToString().Trim() != ""))
            {
                FormLupa FML = new FormLupa($"Select MateriaID, Nombre, Año, CargaHoraria [Carga Horaria] from Materia where Año = {cmbAño.Text.Trim()} and CarreraID = {carreraid}");
                FML.ConfigurarGrilla(new int[] { 0 });
                FML.ShowDialog();
                if (FML.Valores != null)
                {
                    txtMateria.Text = FML.Valores[1].ToString();
                    materiaidp      = Convert.ToInt32(FML.Valores[0]);
                    GrillaMatCorrelativas.Rows.Clear();
                    if ((dsaux = dalcons.TraerCorMat(materiaidp)).Rows.Count != 0)
                    {
                        for (int i = 0; i < dsaux.Rows.Count; i++)
                        {
                            GrillaMatCorrelativas.Rows.Add(dsaux.Rows[i][0], dsaux.Rows[i][1], dsaux.Rows[i][2], dsaux.Rows[i][3]);
                        }
                    }
                }
            }
            else
            {
                MessageBox.Show("Debe Seleccionar los datos anteriores");
            }
        }
コード例 #2
0
        private void button2_Click(object sender, EventArgs e)
        {
            FormLupa Lupa = new FormLupa("select Nombres,Apellidos,AlumnoID from Alumnos inner join Personas on Alumnos.PersonaID = Personas.PersonaID where Alumnos.Inactivo = 0");

            Lupa.ConfigurarGrilla(new int[] { 2 });
            Lupa.ShowDialog();

            if (Lupa.Valores != null)
            {
                DSMA.Materias.Clear();
                txtAlumno.Text = $"{Lupa.Valores[0].ToString().Trim()} {Lupa.Valores[1].ToString().Trim()}";
                AlumnoID       = (int)Lupa.Valores[2];
                DataTable dt = BE.BeAlumnoMaterias.obtenerAlumnoMaterias(AlumnoID);
                if (dt == null)
                {
                    return;
                }
                cmbAño.Enabled     = true;
                cmbCarrera.Enabled = true;


                if (dt.Rows.Count == 0)
                {
                    return;
                }

                foreach (DataRow d in dt.Rows)
                {
                    DSMA.Materias.AddMateriasRow((string)d[0], (int)d[1]);
                }
            }
        }
コード例 #3
0
ファイル: CargaPersona.cs プロジェクト: LucasEG95/Instituto
        private void btnLupaPersona_Click(object sender, EventArgs e)
        {
            FormLupa FML = new FormLupa("Personas", new string[] { "DNI", "Nombres", "Apellidos" });

            FML.ShowDialog();

            if (FML.Valores != null)
            {
                Llenartxt((int)FML.Valores[0]);
            }
        }
コード例 #4
0
ファイル: CargaMateria.cs プロジェクト: LucasEG95/Instituto
        private void btnLupaProf_Click(object sender, EventArgs e)
        {
            FormLupa lupa = new FormLupa("select Profesores.ProfesorID,Personas.Nombres, Personas.Apellidos, Personas.DNI from Personas,Profesores where Personas.PersonaID = Profesores.PersonaID");

            lupa.ConfigurarGrilla(new int[] { 0 });
            lupa.ShowDialog();
            if (lupa.Valores != null)
            {
                txtProfesor.Text = lupa.Valores[1].ToString() + " " + lupa.Valores[2].ToString();
                IDPROFESOR       = Convert.ToInt32(lupa.Valores[0].ToString());
            }
        }
コード例 #5
0
ファイル: CargaMateria.cs プロジェクト: LucasEG95/Instituto
        private void btnLupaCar_Click(object sender, EventArgs e)
        {
            // string[] CamposCarrera = new string[5];
            // CamposCarrera[0] = "CarreraID";
            // CamposCarrera[1] = "Nombre";
            // CamposCarrera[2] = "CantAños"
            // CamposCarrera[3] = "NumResolucion";
            //  CamposCarrera[4] = "CargaHoraria";
            FormLupa FL = new FormLupa("select Carrera.CarreraID, Carrera.Nombre 'Carrera', Carrera.CantAños 'Cantidad de años', Carrera.NumResolucion 'Resolucion', Carrera.CargaHoraria 'Carga horaria' from Carrera");

            FL.ConfigurarGrilla(new int[] { 0 });
            FL.ShowDialog();
            if (FL.Valores != null)
            {
                txtCarrera.Text = (string)FL.Valores[1];
                IDCARRERA       = (int)FL.Valores[0];
            }
        }
コード例 #6
0
ファイル: Correlativas.cs プロジェクト: LucasEG95/Instituto
        private void btnLupaCar_Click(object sender, EventArgs e)
        {
            FormLupa FML = new FormLupa("Carrera", new string[] { "CarreraID", "Nombre", "CantAños", "NumResolucion" });

            FML.ConfigurarGrilla(new int[] { 0 });
            FML.ShowDialog();
            if (FML.Valores != null)
            {
                txtCarrera.Text = FML.Valores[1].ToString();
                carreraid       = Convert.ToInt32(FML.Valores[0]);
                cmbAño.Items.Clear();
                txtMateria.Text = "";
                GrillaMatCorrelativas.Rows.Clear();
                for (int i = 1; i <= (int)FML.Valores[2]; i++)
                {
                    cmbAño.Items.Add(i);
                }
            }
        }
コード例 #7
0
ファイル: CargaMateria.cs プロジェクト: LucasEG95/Instituto
        private void btBuscarMateria_Click(object sender, EventArgs e)
        {
            FormLupa Fl = new FormLupa("select Carrera.CarreraID, Carrera.Nombre 'Carrera',Materia.MateriaID ,Materia.Nombre 'Materia',Profesores.ProfesorID,Personas.Nombres 'Nombre Profesor',Personas.Apellidos 'Apellido Profesor',Materia.Año,Materia.CargaHoraria 'Carga Horaria',Materia.Promocional from Materia,Carrera,Profesores,Personas where Materia.CarreraID = Carrera.CarreraID and Profesores.ProfesorID = Materia.ProfesorID and Profesores.PersonaID = Personas.PersonaID");

            Fl.ConfigurarGrilla(new int[] { 0, 2, 4 });
            Fl.ShowDialog();
            if (Fl.Valores != null)
            {
                IDCARRERA              = (int)Fl.Valores[0];
                IDPROFESOR             = (int)Fl.Valores[4];
                IDMATERIA              = (int)Fl.Valores[2];
                txtCarrera.Text        = (string)Fl.Valores[1];
                txtMateria.Text        = (string)Fl.Valores[3];
                txtProfesor.Text       = (string)Fl.Valores[5] + " " + (string)Fl.Valores[6];
                txtAño.Text            = Convert.ToString(Fl.Valores[7]);
                txtHoras.Text          = Convert.ToString(Fl.Valores[8]);
                chkPromocional.Checked = (bool)Fl.Valores[9];
            }
        }
コード例 #8
0
ファイル: CargarCarrera.cs プロジェクト: LucasEG95/Instituto
        private void btnlupC_Click(object sender, EventArgs e)
        {
            FormLupa flupa = new FormLupa("select Carrera.CarreraID, Carrera.Nombre 'Carrera'," +
                                          " Carrera.CantAños 'Años'," +
                                          " Carrera.Numresolucion 'Nº Resolucion'," +
                                          " Carrera.CargaHoraria 'Horas'from Carrera");

            flupa.ConfigurarGrilla(new int[] { 0 });
            flupa.ShowDialog();


            if (flupa.Valores != null)
            {
                txtCarrera.Text    = (string)flupa.Valores[1];
                IDCARRERA          = (int)flupa.Valores[0];
                txtAños.Text       = Convert.ToString(flupa.Valores[2]);
                txtResolucion.Text = (string)flupa.Valores[3];
                txtHoras.Text      = Convert.ToString(flupa.Valores[4]);
            }
        }
コード例 #9
0
ファイル: Correlativas.cs プロジェクト: LucasEG95/Instituto
 private void btnAgregar_Click(object sender, EventArgs e)
 {
     if ((txtCarrera.Text.Trim() != null) && (txtCarrera.Text.Trim() != "") && (cmbAño.Text.ToString().Trim() != ""))
     {
         bool     comparador = true;
         FormLupa FML        = new FormLupa($"Select MateriaID, Nombre, Año, CargaHoraria [Carga Horaria] from Materia where Año < {cmbAño.Text.Trim()} and CarreraID = {carreraid}");
         FML.ConfigurarGrilla(new int[] { 0 });
         FML.ShowDialog();
         if (FML.Valores != null)
         {
             if (GrillaMatCorrelativas.Rows.Count == 0)
             {
                 GrillaMatCorrelativas.Rows.Add(FML.Valores);
             }
             else
             {
                 for (int i = 0; i < GrillaMatCorrelativas.Rows.Count; i++)
                 {
                     if ((int)GrillaMatCorrelativas.Rows[i].Cells[0].Value == (int)FML.Valores[0])
                     {
                         comparador = false;
                     }
                 }
                 if (comparador)
                 {
                     GrillaMatCorrelativas.Rows.Add(FML.Valores);
                 }
                 else
                 {
                     MessageBox.Show("Materia ya agregada a la tabla");
                 }
             }
         }
     }
     else
     {
         MessageBox.Show("Debe seleccionar los datos anteriores");
     }
 }