Example #1
0
 private void metroButton6_Click(object sender, EventArgs e)
 {
     if (mgAlumno.CurrentRow.Cells[0].Value == null)
     {
         MetroMessageBox.Show(this, "Sellecione un maestro", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
     }
     else
     {
         EspecialidadComponent especialidadPersonaComponent = new EspecialidadComponent();
         foreach (var item in especialidadPersonaComponent.ReadByPersona(int.Parse(mgAlumno.CurrentRow.Cells[0].Value.ToString())))
         {
             if (item.especialidad == "Maestro")
             {
                 FrmHorarioMaestroGrado frmEspecialidad = new FrmHorarioMaestroGrado();
                 frmEspecialidad.legajo = int.Parse(mgAlumno.CurrentRow.Cells[0].Value.ToString());
                 frmEspecialidad.ShowDialog();
             }
             else
             {
                 FrmHorarioProfe frmEspecialidad = new FrmHorarioProfe();
                 frmEspecialidad.legajo = int.Parse(mgAlumno.CurrentRow.Cells[0].Value.ToString());
                 frmEspecialidad.ShowDialog();
             }
             break;
         }
     }
 }
Example #2
0
        void llenargrilla()
        {
            CursoHorarioComponent cursoHorario = new CursoHorarioComponent();
            int n = 0;

            List <MaestroHorario> maestroHorarios = new List <MaestroHorario>();
            int legajo = 0;

            foreach (var item in cursoHorario.ReadByCurso(curso))
            {
                maestroHorarios.Add(item.maestroHorario);
            }

            for (int i = 0; i < 5; i++)
            {
                n = mgCalendario.Rows.Add();
                mgCalendario.Rows[n].Cells[0].Value = i + 1;
                string maestro = "";

                foreach (var item in maestroHorarios)
                {
                    if (item.hora == 0)
                    {
                        maestro = item.persona.nombre + " " + item.persona.apellido + Environment.NewLine + "Clase";
                    }
                    if (true)
                    {
                    }
                }

                mgCalendario.Rows[n].Cells[1].Value = maestro;
                mgCalendario.Rows[n].Cells[2].Value = maestro;
                mgCalendario.Rows[n].Cells[3].Value = maestro;
                mgCalendario.Rows[n].Cells[4].Value = maestro;
                mgCalendario.Rows[n].Cells[5].Value = maestro;
            }



            foreach (var item in maestroHorarios)
            {
                string maestro = "";
                if (item.hora != 0)
                {
                    EspecialidadComponent especialidadPersona = new EspecialidadComponent();
                    foreach (var ep in especialidadPersona.ReadByPersona(item.persona.Id))
                    {
                        maestro = item.persona.nombre + " " + item.persona.apellido + Environment.NewLine + ep.especialidad;
                        break;
                    }


                    mgCalendario.Rows[item.hora - 1].Cells[item.diaSemana].Value = maestro;
                }
            }
        }
Example #3
0
        private void llenarGrilla()

        {
            int n = 0;

            mgEspecialidades.Rows.Clear();
            EspecialidadComponent especialidadComponent = new EspecialidadComponent();

            foreach (var item in especialidadComponent.ReadByPersona(legajo))
            {
                n = mgEspecialidades.Rows.Add();
                mgEspecialidades.Rows[n].Cells[0].Value = item.Id;
                mgEspecialidades.Rows[n].Cells[1].Value = item.especialidad;
            }
        }
Example #4
0
        public void GenerarPDF(Boletin boletin)

        {
            PDFBoletin PDF = new PDFBoletin();

            PDF = ObtenerDatos(boletin);

            //creamos el pdf

            Document doc = new Document(PageSize.LETTER);
            // Indicamos donde vamos a guardar el documento
            PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(@PDF.path + boletin.persona.nombre + " " + boletin.persona.apellido + ".pdf", FileMode.Create));

            doc.Open();


            iTextSharp.text.Font _standardFont = new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.HELVETICA, 12, iTextSharp.text.Font.NORMAL, BaseColor.BLACK);

            //agrego el logo
            string imagePath = @"C:\Imagenes\logo.png";

            iTextSharp.text.Image img = iTextSharp.text.Image.GetInstance(imagePath);
            img.Alignment = Element.ALIGN_CENTER;
            img.ScaleToFit(180f, 250f);

            doc.Add(img);
            Paragraph titulo = new Paragraph("Jardin de infantes Crear y Ser");

            titulo.Alignment = Element.ALIGN_CENTER;
            doc.Add(titulo);
            doc.Add(Chunk.NEWLINE);
            doc.Add(Chunk.NEWLINE);


            Paragraph nombre = new Paragraph("Nombre: " + boletin.persona.nombre + " " + boletin.persona.apellido);

            titulo.Alignment = Element.ALIGN_LEFT;
            doc.Add(nombre);
            doc.Add(Chunk.NEWLINE);

            Paragraph sala = new Paragraph("Sala: " + PDF.curso.nombre + "                   Año: " + boletin.año + "                   Cutrimestre: " + boletin.cutrimeste);

            doc.Add(sala);
            doc.Add(Chunk.NEWLINE);
            doc.Add(Chunk.NEWLINE);
            doc.Add(Chunk.NEWLINE);
            doc.Add(Chunk.NEWLINE);
            foreach (var item in PDF.maestro)
            {
                EspecialidadComponent especialidadComponent = new EspecialidadComponent();

                Paragraph maestro = new Paragraph("Maestro: " + item.nombre + " " + item.apellido + " " + "    Especialidad:" + especialidadComponent.ReadByPersona(item.Id)[0].especialidad);
                titulo.Alignment = Element.ALIGN_LEFT;
                doc.Add(maestro);
                doc.Add(Chunk.NEWLINE);
                doc.Add(Chunk.NEWLINE);
                doc.Add(Chunk.NEWLINE);
                doc.Add(Chunk.NEWLINE);
            }


            //obtener Asistencias


            Paragraph asistencia = new Paragraph("Total Asistencias: " + PDF.asistencia + "                      Total de Inasistencias: " + PDF.inAsistencia);

            titulo.Alignment = Element.ALIGN_CENTER;
            doc.Add(asistencia);
            doc.Add(Chunk.NEWLINE);


            PdfPTable tabla = new PdfPTable(3);

            tabla.WidthPercentage = 100;

            // Configuramos el título de las columnas de la tabla
            PdfPCell clNombre = new PdfPCell(new Phrase("Materia", _standardFont));

            clNombre.BorderWidth       = 0;
            clNombre.BorderWidthBottom = 0.75f;

            PdfPCell clApellido = new PdfPCell(new Phrase("Nota", _standardFont));

            clApellido.BorderWidth       = 0;
            clApellido.BorderWidthBottom = 0.75f;

            PdfPCell clPais = new PdfPCell(new Phrase("Fecha", _standardFont));

            clPais.BorderWidth       = 0;
            clPais.BorderWidthBottom = 0.75f;


            // Añadimos las celdas a la tabla
            foreach (var item in PDF.listaPromedio)
            {
                tabla.AddCell(clNombre);
                tabla.AddCell(clApellido);
                tabla.AddCell(clPais);

                clNombre             = new PdfPCell(new Phrase(item.materia.materia, _standardFont));
                clNombre.BorderWidth = 0;

                clApellido             = new PdfPCell(new Phrase(item.promedio.ToString(), _standardFont));
                clApellido.BorderWidth = 0;

                clPais             = new PdfPCell(new Phrase(item.examen.fecha.ToString("dd-MM-yyyy"), _standardFont));
                clPais.BorderWidth = 0;

                // Añadimos las celdas a la tabla
                tabla.AddCell(clNombre);
                tabla.AddCell(clApellido);
                tabla.AddCell(clPais);
            }



            doc.Add(tabla);
            doc.Add(Chunk.NEWLINE);
            doc.Add(Chunk.NEWLINE);
            Paragraph general = new Paragraph("Promedio general: " + PDF.promediogeneral);

            titulo.Alignment = Element.ALIGN_CENTER;
            doc.Add(general);
            doc.Add(Chunk.NEWLINE);


            Paragraph Observaciones = new Paragraph("Observaciones: " + boletin.notas);

            titulo.Alignment = Element.ALIGN_CENTER;
            doc.Add(Observaciones);



            doc.Close();
        }