Example #1
0
        private void frmExamen_Load(object sender, EventArgs e)
        {
            RecorridoForm.CambiarIdioma(this);


            llenarGrillaMateria();
            CursoComponent cursoComponent = new CursoComponent();

            txtCurso.DataSource    = cursoComponent.ReadByAño(DateTime.Now.Year);
            txtCurso.DisplayMember = "nombre";
            txtCurso.ValueMember   = "Id";
            EspecialidadComponent especialidadComponent = new EspecialidadComponent();

            txtEspecialidad.DataSource    = especialidadComponent.Read();
            txtEspecialidad.ValueMember   = "Id";
            txtEspecialidad.DisplayMember = "especialidad";
            int año = DateTime.Now.Year;

            DateTime min = new DateTime(año, 3, 1);

            txtFecha.MinDate = min;
            txtFecha.MaxDate = DateTime.Now;
            SalaHorarioComponent salaHorario = new SalaHorarioComponent();

            txtAño.DataSource    = salaHorario.SoloAño();
            txtAño.DisplayMember = "Año";
        }
Example #2
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 #3
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 #4
0
        private void llenarCombo()
        {
            EspecialidadComponent especialidadComponent = new EspecialidadComponent();
            List <Especialidad>   especialidad          = new List <Especialidad>();

            especialidad = especialidadComponent.EspecialidadesDisponibles(legajo);
            txtEspecialidadAlta.DisplayMember = "especialidad";
            txtEspecialidadAlta.ValueMember   = "Id";
            txtEspecialidadAlta.DataSource    = especialidad;
        }
        void llenarCombo()

        {
            EspecialidadComponent cursoHorarioComponent = new EspecialidadComponent();

            txtEspecialidad.DataSource    = cursoHorarioComponent.EspecialidadesDisponibles(curso);
            txtEspecialidad.DisplayMember = "Especialidad";
            txtEspecialidad.ValueMember   = "Id";
            txtEspecialidad.SelectedIndex = 0;
        }
Example #6
0
        private void frmMateria_Load(object sender, EventArgs e)
        {
            RecorridoForm.CambiarIdioma(this);
            EspecialidadComponent especialidadComponent = new EspecialidadComponent();

            txtEspecialidad.DataSource    = especialidadComponent.Read();
            txtEspecialidad.DisplayMember = "especialidad";
            txtEspecialidad.ValueMember   = "Id";
            llenargrilla();
        }
Example #7
0
        private void llenarEspecialidad()
        {
            EspecialidadComponent especialidadComponent = new EspecialidadComponent();
            List <Especialidad>   especialidad          = new List <Especialidad>();

            especialidad = especialidadComponent.Read();


            txtEspecialidadAlta.DisplayMember = "especialidad";
            txtEspecialidadAlta.ValueMember   = "Id";
            txtEspecialidadAlta.DataSource    = especialidad;
        }
Example #8
0
        void llenarGrillaEspecialidades()
        {
            int n = 0;

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

            foreach (var item in especialidadComponent.Read())
            {
                n = mgEspecialidades.Rows.Add();
                mgEspecialidades.Rows[n].Cells[0].Value = item.Id;
                mgEspecialidades.Rows[n].Cells[1].Value = item.especialidad;
            }
        }
Example #9
0
        public void QuitarEspecialidad(Maestro entity)
        {
            MaestroDAC maestroDAC = new MaestroDAC();

            EspecialidadComponent especialidadComponent = new EspecialidadComponent();
            List <Especialidad>   especialidad          = new List <Especialidad>();

            especialidad.Add(especialidadComponent.ReadBy(entity.especialidades[0].especialidad));
            List <Documento> documentos = new List <Documento>();

            documentos = entity.documentos;
            Maestro maestro = new Maestro(especialidad, documentos);

            maestro.Id = entity.Id;
            maestroDAC.QuitarEspecialidad(maestro);
        }
Example #10
0
        public List <Materia> ReadByEspecialidad(int legajo)
        {
            MateriaDAC     materiaDAC = new MateriaDAC();
            List <Materia> result     = new List <Materia>();

            foreach (var item in materiaDAC.ReadByEspecialidad(legajo))
            {
                EspecialidadComponent especialidadComponent = new EspecialidadComponent();
                Especialidad          especialidad          = new Especialidad();
                especialidad = especialidadComponent.ReadBy(item.especialidad.Id);
                Materia materia = new Materia(especialidad);
                materia.Id      = item.Id;
                materia.materia = item.materia;
                result.Add(materia);
            }
            return(result);
        }
Example #11
0
        public void AgregarEspecialidad(Maestro entity)


        {
            MaestroDAC maestroDAC = new MaestroDAC();

            foreach (var item in entity.especialidades)
            {
                List <Especialidad>   especialidad          = new List <Especialidad>();
                EspecialidadComponent especialidadComponent = new EspecialidadComponent();
                item.Id = especialidadComponent.ReadBy(item.especialidad).Id;
                especialidad.Add(item);
                Maestro maestro = new Maestro(especialidad);
                maestro.Id = entity.Id;
                maestroDAC.AgregarEspecialidad(maestro);
            }
        }
Example #12
0
        private void btnBuscar_Click(object sender, EventArgs e)
        {
            if (txtBuscar.Text == "")
            {
                MetroMessageBox.Show(this, "El campo buscar esta vacio", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
            int n = 0;

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

            foreach (var item in especialidadComponent.buscar(txtBuscar.Text))
            {
                n = mgEspecialidades.Rows.Add();
                mgEspecialidades.Rows[n].Cells[0].Value = item.Id;
                mgEspecialidades.Rows[n].Cells[1].Value = item.especialidad;
            }
        }
Example #13
0
        public Materia ReadBy(int id)
        {
            MateriaDAC materiaDAC = new MateriaDAC();
            Materia    materia    = new Materia();

            materia = materiaDAC.ReadBy(id);

            EspecialidadComponent especialidadComponent = new EspecialidadComponent();
            Especialidad          especialidad          = new Especialidad();

            especialidad = especialidadComponent.ReadBy(materia.especialidad.Id);
            Materia result = new Materia(especialidad);

            result.Id      = materia.Id;
            result.materia = materia.materia;

            return(result);
        }
Example #14
0
        private void btnModificarEsp_Click(object sender, EventArgs e)
        {
            if (mgEspecialidades.CurrentRow.Cells[0].Value != null)
            {
                EspecialidadComponent especialidadComponent = new EspecialidadComponent();
                Especialidad          especialidad          = new Especialidad();
                especialidad.Id           = int.Parse(mgEspecialidades.CurrentRow.Cells[0].Value.ToString());
                especialidad.especialidad = txtEspecialidad.Text;
                especialidadComponent.Update(especialidad);
                llenarGrillaEspecialidades();

                llenarEspecialidad();
                RecorridoForm.LimpiarTXT(this);
            }
            else
            {
                MetroMessageBox.Show(this, "Sellecione una especialidad", "Error", MessageBoxButtons.OK, MessageBoxIcon.Warning);
            }
        }
Example #15
0
        private void btnAltaEsp_Click(object sender, EventArgs e)
        {
            if (verificarCamposEspecialidad())
            {
                EspecialidadComponent especialidadComponent = new EspecialidadComponent();
                Especialidad          especialidad          = new Especialidad();
                especialidad.especialidad = txtEspecialidad.Text;
                if (especialidadComponent.Create(especialidad) == null)
                {
                    ValidadoresComponent.ErrorAltaModificacado("Especialidad", this);
                }
                else
                {
                    RecorridoForm.LimpiarTXT(this);

                    llenarEspecialidad();
                    llenarGrillaEspecialidades();
                    RecorridoForm.LimpiarTXT(this);
                }
            }
        }
Example #16
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();
        }