private void frmExamenAlumno_Load(object sender, EventArgs e) { Obsever.AgregarForm(this); ExamenComponent examenComponent = new ExamenComponent(); Examen examen = new Examen(persona, null); DateTime fi = new DateTime(curso.salaHorario.año, 1, 31); DateTime ff = new DateTime(curso.salaHorario.año, 12, 1); int n = 0; mgExamenes.Rows.Clear(); foreach (var item in examenComponent.ReadByAlumnoYAño(examen, fi, ff)) { n = mgExamenes.Rows.Add(); mgExamenes.Rows[n].Cells[0].Value = item.Id; string fecha = item.fecha.ToString("dd-MM-yyyy"); mgExamenes.Rows[n].Cells[1].Value = fecha; mgExamenes.Rows[n].Cells[2].Value = item.nota; mgExamenes.Rows[n].Cells[3].Value = item.materia.materia; n++; } }
private void mgAlumnoListado_CellContentClick(object sender, DataGridViewCellEventArgs e) { ExamenComponent examenComponent = new ExamenComponent(); Alumno alumno = new Alumno(); alumno.Id = int.Parse(mgAlumnoListado.CurrentRow.Cells[0].Value.ToString()); Examen examen = new Examen(alumno, null); DateTime fi = new DateTime(int.Parse(txtAño.Text), 1, 31); DateTime ff = new DateTime(int.Parse(txtAño.Text), 12, 1); int n = 0; mgExamenes.Rows.Clear(); foreach (var item in examenComponent.ReadByAlumnoYAño(examen, fi, ff)) { n = mgExamenes.Rows.Add(); mgExamenes.Rows[n].Cells[0].Value = item.Id; string fecha = item.fecha.ToString("dd-MM-yyyy"); mgExamenes.Rows[n].Cells[1].Value = fecha; mgExamenes.Rows[n].Cells[2].Value = item.nota; mgExamenes.Rows[n].Cells[3].Value = item.materia.materia; n++; } }
private void metroButton3_Click(object sender, EventArgs e) { ExamenComponent examenComponent = new ExamenComponent(); Examen examen = new Examen(); Curso curso = new Curso(); curso = (Curso)txtCursoListado.SelectedItem; int n = 0; mgExamenes.Rows.Clear(); foreach (var item in examenComponent.ReadByCurso(curso.Id)) { n = mgExamenes.Rows.Add(); mgExamenes.Rows[n].Cells[0].Value = item.Id; string fecha = item.fecha.ToString("dd-MM-yyyy"); mgExamenes.Rows[n].Cells[1].Value = fecha; mgExamenes.Rows[n].Cells[2].Value = item.nota; mgExamenes.Rows[n].Cells[3].Value = item.materia.materia; n++; } }
private void metroButton1_Click(object sender, EventArgs e) { if (txtNota.Text == "") { MetroMessageBox.Show(this, "Campo nota vacio", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { Materia materia = new Materia(); materia = (Materia)txtMateriaAlta.SelectedItem; Alumno alumno = new Alumno(); alumno.Id = int.Parse(mgReserva.CurrentRow.Cells[0].Value.ToString()); Examen examen = new Examen(alumno, materia); examen.nota = int.Parse(txtNota.Text); examen.fecha = txtFecha.Value; ExamenComponent examenComponent = new ExamenComponent(); examenComponent.Create(examen); ValidadoresComponent.Alta("Examen de: " + txtMateriaAlta.Text, this); } }