예제 #1
0
        private void btnAlta_Click(object sender, EventArgs e)
        {
            Alumno alumno = new Alumno();

            alumno = (Alumno)txtAlumno.SelectedItem;
            Boletin boletin = new Boletin(alumno);

            Curso curso = new Curso();

            curso              = (Curso)txtCurso.SelectedItem;
            boletin.año        = curso.salaHorario.año;
            boletin.cutrimeste = int.Parse(txtCuatrimestre.Text);
            boletin.notas      = txtNota.Text;
            BoletinComponent boletinComponent = new BoletinComponent();

            if (boletinComponent.Create(boletin) == null)
            {
                ValidadoresComponent.ErrorAltaModificacado("Boletin", this);
            }
            else
            {
                ValidadoresComponent.Alta("Boletin", this);
                llenarGrillaBoletin();
            }
        }
예제 #2
0
        void llenarGrilla()
        {
            mgVer.Rows.Clear();
            int n = 0;
            BoletinComponent boletinComponent = new BoletinComponent();
            Curso            curso            = new Curso();

            curso = (Curso)txtCurso.SelectedItem;
            Boletin boletin = new Boletin(alumno);

            boletin.año = curso.salaHorario.año;

            foreach (var item in boletinComponent.ReadByAlumnoYAño(boletin))
            {
                n = mgVer.Rows.Add();

                mgVer.Rows[n].Cells[0].Value = item.Id;
                mgVer.Rows[n].Cells[1].Value = item.persona.nombre;
                mgVer.Rows[n].Cells[2].Value = item.persona.apellido;
                mgVer.Rows[n].Cells[3].Value = item.año;
                mgVer.Rows[n].Cells[4].Value = item.cutrimeste;
                mgVer.Rows[n].Cells[5].Value = item.notas;
                n++;
            }
        }
예제 #3
0
        private void btnVerBoletin_Click(object sender, EventArgs e)
        {
            PDFboletinComponent pDFboletinComponent = new PDFboletinComponent();
            Boletin             boletin             = new Boletin();
            BoletinComponent    boletinComponent    = new BoletinComponent();

            boletin = boletinComponent.ReadBy(int.Parse(mgVer.CurrentRow.Cells[0].Value.ToString()));
            pDFboletinComponent.AbrirPDF(boletin);
        }
예제 #4
0
        public void BorroaPDF(Boletin boletin)


        {
            string path = @"c:\Boletin\" + boletin.persona.DNI + @"\" + boletin.año + @"\" + boletin.cutrimeste + @"\" + boletin.persona.nombre + " " + boletin.persona.apellido + ".pdf";

            if (File.Exists(path))
            {
                string pdfPath = Path.Combine(Application.StartupPath, path);
                File.Delete(path);
            }
        }
예제 #5
0
    protected void btnGuardar_Click(object sender, EventArgs e)
    {
        Boletin          objBoletin     = new Boletin();
        OperacionBoletin objOperBoletin = new OperacionBoletin(ConfigurationManager.ConnectionStrings["estigioacademicoConnectionString"].ConnectionString);

        foreach (GridViewRow row in tbl_Estudiante.Rows)
        {
            if (row.RowType == DataControlRowType.DataRow)
            {
                CheckBox chkRow = (row.Cells[0].FindControl("chkEstudiante") as CheckBox);
                if (chkRow.Checked)
                {
                    foreach (GridViewRow rowIndicador in tbl_Indicadores.Rows)
                    {
                        if (rowIndicador.RowType == DataControlRowType.DataRow)
                        {
                            CheckBox chkRowIndicador = (rowIndicador.Cells[0].FindControl("chkIndicador") as CheckBox);
                            if (chkRowIndicador.Checked)
                            {
                                objBoletin.id_asignacion = int.Parse(clsEncriptar.Desencriptar(Page.RouteData.Values["Id"].ToString()));
                                objBoletin.id_estudiante = Convert.ToInt64(row.Cells[1].Text);
                                objBoletin.id_indicador  = int.Parse(rowIndicador.Cells[1].Text);
                                objBoletin.id_usuario    = int.Parse(Session["id_usuario"].ToString());
                                DataTable tbl_Boletin = objOperBoletin.ConsultarBoletin(objBoletin);
                                if (tbl_Boletin.Rows.Count == 0)
                                {
                                    objOperBoletin.InsertarBoletin(objBoletin);
                                }
                            }
                        }
                    }
                }
            }
        }
        Response.RedirectToRoute("General", new { Modulo = "Proceso", Entidad = "Indicador", Pagina = "Busqueda", Accion = "Agrego" });
    }
예제 #6
0
        public PDFBoletin ObtenerDatos(Boletin boletin)


        {
            //obtengo el alumno
            Alumno          alumno          = new Alumno();
            AlumnoComponent alumnoComponent = new AlumnoComponent();

            alumno = alumnoComponent.ReadBy(boletin.persona.Id);
            Boletin unBoletin = new Boletin(alumno);

            unBoletin.año        = boletin.año;
            unBoletin.cutrimeste = boletin.cutrimeste;
            unBoletin.notas      = boletin.notas;

            //Obtengo las asistencias
            AsistenciaComponent asistenciaComponent = new AsistenciaComponent();
            List <Asistencia>   listaAsitencia      = new List <Asistencia>();
            Asistencia          asistencia          = new Asistencia(alumno);

            asistencia.año = boletin.año;
            listaAsitencia = asistenciaComponent.ReadByAlumno(asistencia);

            //Obtengo las notas
            ExamenComponent examenComponent = new ExamenComponent();
            Examen          examen          = new Examen(alumno, null);
            DateTime        fi          = new DateTime(boletin.año, boletin.cutrimeste * 2 + 2, 1);
            DateTime        ff          = new DateTime(boletin.año, boletin.cutrimeste * 2 + 4, 30);
            List <Examen>   listaExamen = new List <Examen>();

            listaExamen = examenComponent.ReadByAlumnoYAñoUnique(examen, fi, ff);

            //Obtengo el curso
            CursoComponent cursoComponent = new CursoComponent();
            Curso          curso          = new Curso();

            curso = cursoComponent.ReadByPersona(alumno.Id);

            //Obtengo los maestros

            MaestroComponent maestroComponent = new MaestroComponent();
            List <Maestro>   listaMaestro     = new List <Maestro>();

            listaMaestro = maestroComponent.ObtenerAlumnodeCunCurso(curso.Id);

            PDFBoletin PDF = new PDFBoletin(unBoletin, listaAsitencia, listaExamen, curso, listaMaestro);

            PDF.boletin = boletin;

            PDF.asistencia   = 0;
            PDF.inAsistencia = 0;
            foreach (var item in PDF.listaAsitencia)
            {
                if (item.asistio)
                {
                    PDF.asistencia++;
                }
                else
                {
                    PDF.inAsistencia++;
                }
            }


            //Obtengo las notas



            MateriaExamen materiaExamen = new MateriaExamen();


            PDF.listaPromedio   = materiaExamen.obtenerPromedio(PDF.listaExamen, examenComponent.ReadByAlumnoYMateria(boletin.persona.Id, fi, ff));
            PDF.promediogeneral = Math.Round(materiaExamen.obtenerPromedioGeneral(PDF.listaExamen).promedio);



            //genero el patch


            PDF.path = @"c:\Boletin\" + boletin.persona.DNI + @"\" + boletin.año + @"\" + boletin.cutrimeste + @"\";

            VericarPath(PDF);

            return(PDF);
        }
예제 #7
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();
        }