void llenarListaComunicado()
        {
            ComunicadoComponent comunicadoComponent  = new ComunicadoComponent();
            AlumnoComponent     cursoAlumnoComponent = new AlumnoComponent();

            int año = DateTime.Now.Year;
            List <Comunicado> result = new List <Comunicado>();
            Curso             curso  = new Curso();

            curso = (Curso)txtCurso.SelectedItem;
            foreach (var item in comunicadoComponent.Read())
            {
                foreach (var alumno in cursoAlumnoComponent.ObtenerAlumnodeCunCurso(curso.Id))
                {
                    if (item.persona.Id == alumno.Id)
                    {
                        result.Add(item);
                    }
                }
            }
            int n = 0;

            foreach (var item in result)
            {
                mgListaComunicado.Rows.Clear();
                n = mgListaComunicado.Rows.Add();
                mgListaComunicado.Rows[n].Cells[0].Value = item.Id;
                mgListaComunicado.Rows[n].Cells[1].Value = item.persona.nombre;
                mgListaComunicado.Rows[n].Cells[2].Value = item.persona.apellido;
                mgListaComunicado.Rows[n].Cells[3].Value = item.persona.DNI;
                mgListaComunicado.Rows[n].Cells[4].Value = item.visto;
                string dat = item.fecha.ToString("dd-MM-yyyy");
                mgListaComunicado.Rows[n].Cells[5].Value = dat;
                mgListaComunicado.Rows[n].Cells[6].Value = item.maestro.nombre + " " + item.maestro.apellido;
                n++;
            }
        }
Beispiel #2
0
        void llenarGrillaListado()
        {
            mgListaComunicado.Rows.Clear();
            ComunicadoComponent comunicadoComponent = new ComunicadoComponent();

            List <Comunicado> listaPersona = new List <Comunicado>();

            listaPersona = comunicadoComponent.Read();
            int n = 0;

            foreach (var item in listaPersona)
            {
                n = mgListaComunicado.Rows.Add();
                mgListaComunicado.Rows[n].Cells[0].Value = item.Id;
                mgListaComunicado.Rows[n].Cells[1].Value = item.persona.nombre;
                mgListaComunicado.Rows[n].Cells[2].Value = item.persona.apellido;
                mgListaComunicado.Rows[n].Cells[3].Value = item.persona.DNI;
                mgListaComunicado.Rows[n].Cells[4].Value = item.visto;
                string dat = item.fecha.ToString("dd-MM-yyyy");
                mgListaComunicado.Rows[n].Cells[5].Value = dat;
                mgListaComunicado.Rows[n].Cells[6].Value = item.maestro.nombre + " " + item.maestro.apellido;
                n++;
            }
        }