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"); } }
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]); } } }
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]); } }
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()); } }
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]; } }
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); } } }
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]; } }
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]); } }
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"); } }