private void btningresarnota_Click(object sender, EventArgs e) // selected value una vez solo acepta { try { Nota a = new Nota(); a.Codigoestudiante = Convert.ToInt32(txtcarnetidentidadmod.Text);// a.Semestre = Convert.ToInt32(cbxsemestremod.SelectedValue); a.Materia = Convert.ToInt32(cbxmateriamod.SelectedValue); a.Primerparcial = Convert.ToInt32(cbxprimerparcialmod.SelectedValue); a.Segundoparcial = Convert.ToInt32(cbxsegundoparcialmod.SelectedValue); a.Evaluacionproyecto = Convert.ToInt32(cbxevaluacionproyectomod.SelectedValue); a.Examenfinal = Convert.ToInt32(cbxexamenfinalmod.SelectedValue); a.Segundoturno = Convert.ToInt32(cbxsegundoturnomod.SelectedValue); int x = MetodosUniversidad.ModificarNota(a); if (x > 0) { MessageBox.Show("Nota ingresado/modificado exitosamente!"); txtnotafinalmod.Text = a.Notafinal.ToString(); } else { MessageBox.Show("ERROR!!!!"); } } catch (Exception x) { MessageBox.Show(x.Message); } }
private void btnobtenernotas_Click(object sender, EventArgs e) // selectedvalue una sola vez acepta { Nota b = new Nota(); int carnetidentidad = Convert.ToInt32(lsbseleccionestudiantemod.SelectedValue); // Ci==Ce int semestre = Convert.ToInt32(cbxsemestremod.SelectedValue); int materia = Convert.ToInt32(cbxmateriamod.SelectedValue); b = MetodosUniversidad.CargarNota(carnetidentidad, semestre, materia); if (b != null) { try { cbxprimerparcialmod.SelectedValue = b.Primerparcial; cbxsegundoparcialmod.SelectedValue = b.Segundoparcial; cbxevaluacionproyectomod.SelectedValue = b.Evaluacionproyecto; cbxexamenfinalmod.SelectedValue = b.Examenfinal; cbxsegundoturnomod.SelectedValue = b.Segundoturno; txtnotafinalmod.Text = b.Notafinal.ToString(); } catch (Exception error) { MessageBox.Show(error.Message); } } }
private void lsbseleccionestudiantemod_MouseClick(object sender, MouseEventArgs e) { Estudiante a = new Estudiante(); a = MetodosEstudiante.CargarEstudiante(Convert.ToInt32(lsbseleccionestudiantemod.SelectedValue)); if (a != null) { try { gbxestudiantemod.Enabled = true; txtnombremod.Text = a.Nombre; txtapellidopaternomod.Text = a.Apellidopaterno; txtapellidomaternomod.Text = a.Apellidomaterno; cbxsexomod.SelectedValue = a.Sexo; // selectedvalue(valuemember is 1 or 2)<-(1 or 2) // both match txtcarnetidentidadmod.Text = a.Carnetidentidad.ToString(); DTPfechanacimientomod.Value = a.Fechanacimiento; txtpaisnacimientomod.Text = a.Paisnacimiento; txtdireccionmod.Text = a.Direccion; txttelefonomod.Text = a.Telefono.ToString(); txtemailmod.Text = a.Email; } catch (Exception error) { MessageBox.Show(error.Message); } } Universidad b = new Universidad(); b = MetodosUniversidad.Cargar(Convert.ToInt32(lsbseleccionestudiantemod.SelectedValue)); // Ci==Ce if (b != null) { try { gbxuniversidadmod.Enabled = true; gbxnotasmod.Enabled = true; txtcodigoestudiantemod.Text = b.Codigoestudiante.ToString(); txtpasswordestudiantemod.Text = b.Passwordestudiante; cbxuniversidadcarreramod.SelectedValue = b.Carrera; // selectedvalue(valuemember are ints)<-(ints) // both match cbxuniversidadsedemod.SelectedValue = b.Sede; // selectedvalue(valuemember are ints)<-(ints) // both match cbxpagomod.SelectedValue = b.Pago; // selectedvalue(valuemember are ints)<-(ints) // both match cbxgestionmod.SelectedValue = b.Gestion; // selectedvalue(valuemember are ints)<-(ints) // both match chklegalizadabachillermod.Checked = Convert.ToBoolean(b.Legalizadabachiller); // 1==true, 0==false chkfotocopialibretamod.Checked = Convert.ToBoolean(b.Fotocopialibreta); chkcertificadonacimientomod.Checked = Convert.ToBoolean(b.Certificadonacimiento); chkfotocopiacarnetidentidadmod.Checked = Convert.ToBoolean(b.Fotocopiacarnetidentidad); chkfotografiasfondoazulmod.Checked = Convert.ToBoolean(b.Fotografiasfondoazul); } catch (Exception error) { MessageBox.Show(error.Message); } } }
private void btnnotas_Click(object sender, EventArgs e) { materia = Convert.ToInt32(cbxmateria.SelectedValue); Nota a = new Nota(); a = MetodosUniversidad.CargarNota(codigoestudiante, semestre, materia); cbxprimerparcial.SelectedValue = a.Primerparcial; cbxsegundoparcial.SelectedValue = a.Segundoparcial; cbxevaluacionproyecto.SelectedValue = a.Evaluacionproyecto; cbxexamenfinal.SelectedValue = a.Examenfinal; cbxsegundoturno.SelectedValue = a.Segundoturno; txtnotafinal.Text = a.Notafinal.ToString(); }
// Auto-update private void btnmod_Click(object sender, EventArgs e) { int x, y; try { Estudiante a = new Estudiante(); a.Nombre = txtnombremod.Text; a.Apellidopaterno = txtapellidopaternomod.Text; a.Apellidomaterno = txtapellidomaternomod.Text; a.Sexo = Convert.ToInt32(cbxsexomod.SelectedValue); a.Carnetidentidad = Convert.ToInt32(txtcarnetidentidadmod.Text); a.Fechanacimiento = DTPfechanacimientomod.Value; a.Paisnacimiento = txtpaisnacimientomod.Text; a.Direccion = txtdireccionmod.Text; a.Telefono = Convert.ToInt32(txttelefonomod.Text); a.Email = txtemailmod.Text; x = MetodosEstudiante.Modificar(a); // Universidad b = new Universidad(); b.Codigoestudiante = Convert.ToInt32(txtcarnetidentidadmod.Text);// b.Passwordestudiante = txtpasswordestudiantemod.Text; b.Carrera = Convert.ToInt32(cbxuniversidadcarreramod.SelectedValue); b.Sede = Convert.ToInt32(cbxuniversidadsedemod.SelectedValue); b.Pago = Convert.ToInt32(cbxpagomod.SelectedValue); b.Gestion = Convert.ToInt32(cbxgestionmod.SelectedValue); if (chklegalizadabachillermod.Checked == true) { b.Legalizadabachiller = 1; } else { b.Legalizadabachiller = 0; } if (chkfotocopialibretamod.Checked == true) { b.Fotocopialibreta = 1; } else { b.Fotocopialibreta = 0; } if (chkcertificadonacimientomod.Checked == true) { b.Certificadonacimiento = 1; } else { b.Certificadonacimiento = 0; } if (chkfotocopiacarnetidentidadmod.Checked == true) { b.Fotocopiacarnetidentidad = 1; } else { b.Fotocopiacarnetidentidad = 0; } if (chkfotografiasfondoazulmod.Checked == true) { b.Fotografiasfondoazul = 1; } else { b.Fotografiasfondoazul = 0; } y = MetodosUniversidad.Modificar(b); if (x > 0 && y > 0) { MessageBox.Show("Dato estudiante y/o dato universidad modificado con EXITO!!!!"); } else { MessageBox.Show("ERROR!!!!"); } } catch (Exception error) { MessageBox.Show(error.Message); } btnbuscarmod_Click(sender, e); }
private void btnIngresar_Click(object sender, EventArgs e) { int x, y, z; try { int carnetidentidad = Convert.ToInt32(txtcarnetidentidadingresar.Text); int sede = Convert.ToInt32(cbxsedeingresar.SelectedValue); int carrera = Convert.ToInt32(cbxcarreraingresar.SelectedValue); x = MetodosUniversidad.IngresarNota(carnetidentidad, sede, carrera); // Estudiante a = new Estudiante(); a.Nombre = txtnombreingresar.Text; a.Apellidopaterno = txtapellidopaternoingresar.Text; a.Apellidomaterno = txtapellidomaternoingresar.Text; a.Sexo = Convert.ToInt32(cbxsexoingresar.SelectedValue); a.Carnetidentidad = Convert.ToInt32(txtcarnetidentidadingresar.Text); a.Fechanacimiento = DTPfechanacimientoingresar.Value; a.Paisnacimiento = txtpaisnacimientoingresar.Text; a.Direccion = txtdireccioningresar.Text; a.Telefono = Convert.ToInt32(txttelefonoingresar.Text); a.Email = txtemailingresar.Text; y = MetodosEstudiante.Ingresar(a); // Universidad b = new Universidad(); b.Codigoestudiante = Convert.ToInt32(txtcarnetidentidadingresar.Text); b.Passwordestudiante = txtcarnetidentidadingresar.Text; b.Carrera = Convert.ToInt32(cbxcarreraingresar.SelectedValue); b.Sede = Convert.ToInt32(cbxsedeingresar.SelectedValue); b.Pago = Convert.ToInt32(cbxpagoingresar.SelectedValue); b.Gestion = Convert.ToInt32(cbxgestioningresar.SelectedValue); //chkbox no tiene metodos: datasource,valuemember,displaymember if (chklegalizadabachilleringresar.Checked == true) { b.Legalizadabachiller = 1; } else { b.Legalizadabachiller = 0; } if (chkfotocopialibretaingresar.Checked == true) { b.Fotocopialibreta = 1; } else { b.Fotocopialibreta = 0; } if (chkcertificadonacimientoingresar.Checked == true) { b.Certificadonacimiento = 1; } else { b.Certificadonacimiento = 0; } if (chkfotocopiacarnetidentidadingresar.Checked == true) { b.Fotocopiacarnetidentidad = 1; } else { b.Fotocopiacarnetidentidad = 0; } if (chkfotografiasfondoazulingresar.Checked == true) { b.Fotografiasfondoazul = 1; } else { b.Fotografiasfondoazul = 0; } z = MetodosUniversidad.Ingresar(b); if (x > 0 && y > 0 && z > 0) { MessageBox.Show("Estudiante ingresado!"); } else { MessageBox.Show("ERROR ingresar al estudiante"); } } catch (Exception error) { MessageBox.Show(error.Message); } }
private void FrmPostEstudiante_Load(object sender, EventArgs e) { if (verNotas == 0) { gbxNotas.Visible = false; } else if (verNotas == 1) { gbxestudiantemod.Visible = false; gbxuniversidadmod.Visible = false; gbxNotas.SetBounds(20, 28, 689, 141); } Estudiante a = new Estudiante(); a = MetodosEstudiante.CargarEstudiante(Login); txtnombre.Text = a.Nombre; txtapellidopaterno.Text = a.Apellidopaterno; txtapellidomaterno.Text = a.Apellidomaterno; // cbxsexo.DataSource = MetodoSexo.ObtenerSexos(); cbxsexo.DisplayMember = "NombreSexo"; cbxsexo.ValueMember = "IdSexo"; cbxsexo.SelectedValue = MetodoSexo.CargarSexo(Login); cbxsexo.Enabled = false; // txtcarnetidentidad.Text = a.Carnetidentidad.ToString(); DTPfechanacimiento.Value = a.Fechanacimiento; txtpaisnacimiento.Text = a.Paisnacimiento; txtdireccion.Text = a.Direccion; txttelefono.Text = a.Telefono.ToString(); txtemail.Text = a.Email; // // Universidad b = new Universidad(); b = MetodosUniversidad.Cargar(Login); txtcodigoestudiante.Text = b.Codigoestudiante.ToString(); txtpasswordestudiante.Text = b.Passwordestudiante; // cbxcarrera.DataSource = MetodoCarrera.ObtenerCarreras(); cbxcarrera.DisplayMember = "NombreCarrera"; cbxcarrera.ValueMember = "IdCarrera"; cbxcarrera.SelectedValue = MetodoCarrera.CargarCarrera(Login); cbxcarrera.Enabled = false; cbxsede.DataSource = MetodoSede.ObtenerSedes(); cbxsede.DisplayMember = "NombreSede"; cbxsede.ValueMember = "IdSede"; cbxsede.SelectedValue = MetodoSede.CargarSede(Login); cbxsede.Enabled = false; cbxpago.DataSource = MetodoPago.ObtenerPagos(); cbxpago.DisplayMember = "NombrePago"; cbxpago.ValueMember = "IdPago"; cbxpago.SelectedValue = MetodoPago.CargarPago(Login); cbxpago.Enabled = false; cbxgestion.DataSource = MetodoGestion.ObtenerGestiones(); cbxgestion.DisplayMember = "NombreGestion"; cbxgestion.ValueMember = "IdGestion"; cbxgestion.SelectedValue = MetodoGestion.CargarGestion(Login); cbxgestion.Enabled = false; // chklegalizadabachiller.Checked = Convert.ToBoolean(b.Legalizadabachiller); chkfotocopialibreta.Checked = Convert.ToBoolean(b.Fotocopialibreta); chkcertificadonacimiento.Checked = Convert.ToBoolean(b.Certificadonacimiento); chkfotocopiacarnetidentidad.Checked = Convert.ToBoolean(b.Fotocopiacarnetidentidad); chkfotografiasfondoazul.Checked = Convert.ToBoolean(b.Fotografiasfondoazul); // // codigoestudiante = Convert.ToInt32(txtcodigoestudiante.Text); carrera = Convert.ToInt32(cbxcarrera.SelectedValue); cbxsemestre.DataSource = MetodoSemestre.ObtenerSemestres(); cbxsemestre.DisplayMember = "NombreSemestre"; cbxsemestre.ValueMember = "IdSemestre"; // cbxprimerparcial.DataSource = MetodoNota.ObtenerPrimerParcial(); cbxprimerparcial.DisplayMember = "PrimerParcial"; cbxprimerparcial.ValueMember = "PrimerParcial"; cbxsegundoparcial.DataSource = MetodoNota.ObtenerSegundoParcial(); cbxsegundoparcial.DisplayMember = "SegundoParcial"; cbxsegundoparcial.ValueMember = "SegundoParcial"; cbxevaluacionproyecto.DataSource = MetodoNota.ObtenerEvaluacionProyecto(); cbxevaluacionproyecto.DisplayMember = "EvaluacionProyecto"; cbxevaluacionproyecto.ValueMember = "EvaluacionProyecto"; cbxexamenfinal.DataSource = MetodoNota.ObtenerExamenFinal(); cbxexamenfinal.DisplayMember = "ExamenFinal"; cbxexamenfinal.ValueMember = "ExamenFinal"; cbxsegundoturno.DataSource = MetodoNota.ObtenerSegundoTurno(); cbxsegundoturno.DisplayMember = "SegundoTurno"; cbxsegundoturno.ValueMember = "SegundoTurno"; // }