void llenarGrilla() { MaestroHorarioComponent maestroHorarioComponent = new MaestroHorarioComponent(); CursoComponent cursoComponent = new CursoComponent(); Curso unCurso = new Curso(); unCurso = cursoComponent.ReadBy(curso); MaestroHorario maestroHorario = new MaestroHorario(); maestroHorario.año = unCurso.salaHorario.año; maestroHorario.turno = unCurso.salaHorario.turno; if (txtEspecialidad.ValueMember != "") { int especilidad = int.Parse(txtEspecialidad.SelectedValue.ToString()); mgReserva.Rows.Clear(); int n = 0; foreach (var item in maestroHorarioComponent.DisponibilidadEspecialidad(especilidad, maestroHorario.año, maestroHorario.turno)) { n = mgReserva.Rows.Add(); mgReserva.Rows[n].Cells[0].Value = item.persona.Id; mgReserva.Rows[n].Cells[1].Value = item.persona.nombre; mgReserva.Rows[n].Cells[2].Value = item.persona.apellido; mgReserva.Rows[n].Cells[3].Value = item.persona.DNI; string f = item.persona.fechaNacimiento.ToString().Substring(0, 10); mgReserva.Rows[n].Cells[4].Value = f; mgReserva.Rows[n].Cells[5].Value = item.Id; mgReserva.Rows[n].Cells[6].Value = item.hora; mgReserva.Rows[n].Cells[7].Value = item.diaSemana; n++; } } }
public CursoHorario Create(CursoHorario entity) { CursoHorarioDAC curso = new CursoHorarioDAC(); MaestroHorarioComponent maestroHorario = new MaestroHorarioComponent(); maestroHorario.CambiarDisponibilidad(entity.maestroHorario); return(curso.Create(entity)); }
private void btnEliminar_Click(object sender, EventArgs e) { if (mgAlumno.CurrentRow.Cells[0].Value == null) { MetroMessageBox.Show(this, "Seleccione un horario", "error", MessageBoxButtons.OK, MessageBoxIcon.Warning); } else { MaestroHorarioComponent maestroHorarioComponent = new MaestroHorarioComponent(); maestroHorarioComponent.Delete(int.Parse(mgAlumno.CurrentRow.Cells[0].Value.ToString())); llenarGrilla(); } }
public List <CursoHorario> ReadByCurso(int id_Curso) { List <CursoHorario> result = new List <CursoHorario>(); CursoHorarioDAC cursoHorarioDAC = new CursoHorarioDAC(); foreach (var item in cursoHorarioDAC.ReadByCurso(id_Curso)) { CursoComponent cursoComponent = new CursoComponent(); MaestroHorarioComponent maestroHorarioComponent = new MaestroHorarioComponent(); CursoHorario cursoHorario = new CursoHorario(cursoComponent.ReadBy(item.curso.Id), maestroHorarioComponent.ReadBy(item.maestroHorario.Id)); result.Add(cursoHorario); } return(result); }
private void btnAlta_Click(object sender, EventArgs e) { MaestroHorario maestroHorario = new MaestroHorario(); MaestroHorarioComponent maestroHorarioComponent = new MaestroHorarioComponent(); maestroHorario.persona.Id = legajo; maestroHorario.turno = txtturno.Text; maestroHorario.año = int.Parse(txtAño.Text); if (maestroHorarioComponent.Create(maestroHorario) == null) { ValidadoresComponent.ErrorAltaModificacado("Horario", this); } else { ValidadoresComponent.Alta("Horario", this); RecorridoForm.LimpiarTXT(this); llenarGrilla(); } }
void llenarGrilla() { mgAlumno.Rows.Clear(); int n = 0; MaestroHorarioComponent maestroHorarioComponent = new MaestroHorarioComponent(); foreach (MaestroHorario item in maestroHorarioComponent.ReadByMaestro(legajo)) { n = mgAlumno.Rows.Add(); mgAlumno.Rows[n].Cells[0].Value = item.Id; mgAlumno.Rows[n].Cells[1].Value = item.persona.nombre; mgAlumno.Rows[n].Cells[2].Value = item.persona.apellido; mgAlumno.Rows[n].Cells[3].Value = item.año; mgAlumno.Rows[n].Cells[4].Value = item.turno; n++; } }
private void btnAlta_Click(object sender, EventArgs e) { Maestro maestro = new Maestro(); maestro.Id = legajo; MaestroHorario maestroHorario = new MaestroHorario(maestro); MaestroHorarioComponent maestroHorarioComponent = new MaestroHorarioComponent(); maestroHorario.turno = txtturno.Text; maestroHorario.año = int.Parse(txtAño.Text); maestroHorario.diaSemana = txtDia.SelectedIndex + 1; maestroHorario.hora = int.Parse(txtHora.Text); if (maestroHorarioComponent.CreateNoGrado(maestroHorario) == null) { ValidadoresComponent.ErrorAltaModificacado("Horario", this); } else { ValidadoresComponent.Alta("Horario", this); RecorridoForm.LimpiarTXT(this); llenarGrilla(); } }