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++;
                }
            }
        }
        private void btnAsignar_Click(object sender, EventArgs e)
        {
            if (mgReserva.CurrentRow.Cells[0].Value == null)
            {
            }
            else
            {
                CursoComponent cursoComponent = new CursoComponent();
                Alumno         alumno         = new Alumno();
                alumno.Id = int.Parse(mgReserva.CurrentRow.Cells[0].Value.ToString());
                List <Alumno> listaAlumno = new List <Alumno>();
                listaAlumno.Add(alumno);
                Curso cursoAlumno = new Curso(null, null, null, listaAlumno, null);
                cursoAlumno.Id = curso;
                Maestro maestro = new Maestro();
                maestro.Id = int.Parse(mgReserva.CurrentRow.Cells[0].Value.ToString());
                MaestroHorario maestroHorario = new MaestroHorario(maestro);
                maestroHorario.Id = int.Parse(mgReserva.CurrentRow.Cells[5].Value.ToString());
                cursoComponent.AsignarAlumno(cursoAlumno);

                cursoAlumno.Id = curso;
                CursoHorarioComponent cursoHorarioComponent = new CursoHorarioComponent();
                CursoHorario          cursoHorario          = new CursoHorario(cursoAlumno, maestroHorario);
                cursoHorarioComponent.Create(cursoHorario);
                this.Close();
                llenarGrilla();
            }
        }
예제 #3
0
        public CursoHorario ALoad(IDataReader entity)
        {
            MaestroHorario maestroHorario = new MaestroHorario();

            maestroHorario.Id = GetDataValue <int>(entity, "id_MaestroHorario");
            Curso curso = new Curso();

            curso.Id = GetDataValue <int>(entity, "id_curso");
            CursoHorario cursoHorario = new CursoHorario(curso, maestroHorario);



            return(cursoHorario);
        }
예제 #4
0
        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();
            }
        }
예제 #5
0
        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();
            }
        }