private void Arbol_TV_AfterCheck(object sender, TreeViewEventArgs e)
 {
     if (e.Node.Level == 0)
     {
         foreach (TreeNode t in e.Node.Nodes)
         {
             t.Checked = e.Node.Checked;
         }
     }
     else
     {
         if (e.Node.Level == 1)
         {
             AlumnoInfo alumno = e.Node.Tag as AlumnoInfo;
             foreach (Alumno_PromocionInfo item in alumno.Promociones)
             {
                 foreach (TreeNode t in Arbol_TV.Nodes)
                 {
                     PromocionInfo promocion = t.Tag as PromocionInfo;
                     if (promocion.Oid == item.OidPromocion)
                     {
                         foreach (TreeNode n in t.Nodes)
                         {
                             if ((n.Tag as AlumnoInfo).Oid == alumno.Oid && n.Checked != e.Node.Checked)
                             {
                                 n.Checked = e.Node.Checked;
                             }
                         }
                         break;
                     }
                 }
             }
         }
     }
 }
Exemple #2
0
 /// <summary>
 /// Asigna los valores del grid que no están asociados a propiedades
 /// </summary>
 protected override void SetUnlinkedGridValues(string gridName)
 {
     switch (gridName)
     {
     case "Alumnos_Grid":
     {
         foreach (DataGridViewRow row in Alumnos_Grid.Rows)
         {
             if (row.IsNewRow)
             {
                 continue;
             }
             Alumno_Parte info = (Alumno_Parte)row.DataBoundItem;
             if (info != null)
             {
                 AlumnoInfo alumno = _alumnos.GetItem(info.OidAlumno);
                 if (alumno != null)
                 {
                     row.Cells["Alumno"].Value = alumno.Apellidos + ", " + alumno.Nombre;
                     row.Cells["Numero"].Value = alumno.NExpediente.ToString();
                 }
             }
         }
     } break;
     }
 }
        /// <summary>
        /// Asigna los valores del grid que no están asociados a propiedades
        /// </summary>
        protected override void SetUnlinkedGridValues(string gridName)
        {
            switch (gridName)
            {
            case "Alumnos_Grid":
            {
                foreach (DataGridViewRow row in Alumnos_Grid.Rows)
                {
                    if (row.IsNewRow)
                    {
                        continue;
                    }
                    Alumno_Practica info = (Alumno_Practica)row.DataBoundItem;
                    if (info != null)
                    {
                        AlumnoInfo alumno = _alumnos.GetItem(info.OidAlumno);
                        if (alumno != null)
                        {
                            row.Cells["Alumno"].Value = alumno.Apellidos + ", " + alumno.Nombre;
                            row.Cells["Numero"].Value = alumno.NExpediente.ToString();
                        }

                        if (info.Calificacion == Resources.Labels.NO_APTO_LABEL)
                        {
                            if (info.Falta)
                            {
                                info.Calificacion    = Resources.Labels.FALTA_ASISTENCIA_LABEL;
                                row.DefaultCellStyle = FaltaStyle;
                            }
                            else
                            {
                                row.DefaultCellStyle = NoAptaStyle;
                            }
                        }
                        else
                        {
                            if (info.Calificacion == Resources.Labels.FALTA_ASISTENCIA_LABEL)
                            {
                                row.DefaultCellStyle = FaltaStyle;
                            }
                            else
                            {
                                if (info.Calificacion == Resources.Labels.APTO_LABEL)
                                {
                                    row.DefaultCellStyle = AptaStyle;
                                }
                            }
                        }

                        if (info.Recuperada)
                        {
                            row.DefaultCellStyle = AptaStyle;
                        }
                    }
                }
            } break;
            }
        }
Exemple #4
0
        /// <summary>
        /// Implementa Save_button_Click
        /// </summary>
        protected override void SubmitAction()
        {
            AlumnoInfo    alumno    = TodosAlumno_CkB.Checked ? null : _alumno;
            PromocionInfo promocion = TodosPromocion_CkB.Checked ? null : _promocion;

            string filtro = GetFilterValues();

            AlumnoReportMng reportMng = new AlumnoReportMng(AppContext.ActiveSchema, string.Empty, filtro);

            AlumnoList    alumnos = GetAlumnoList(alumno, promocion);
            PromocionList promos  = GetPromocionList(promocion);

            if (Documentos_CLB.GetItemCheckState(0) == CheckState.Checked)
            {
                MatriculaPromocionRpt rpt = reportMng.GetMatriculaPromocionReport(alumnos, promos);

                if (rpt != null)
                {
                    ReportViewer.SetReport(rpt);
                    ReportViewer.ShowDialog();
                }
                else
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_DATA_REPORTS);
                }
            }

            /*if (Documentos_CLB.GetItemCheckState(1) == CheckState.Checked)
             * {
             *  MatriculaPromocionRpt rpt = reportMng.GetMatriculaPromocionReport(list, promocion);
             *
             *  if (rpt != null)
             *  {
             *      ReportViewer.SetReport(rpt);
             *      ReportViewer.ShowDialog();
             *  }
             *  else
             *      MessageBox.Show(moleQule.Face.Resources.Messages.NO_DATA_REPORTS);
             * }*/

            if (Documentos_CLB.GetItemCheckState(2) == CheckState.Checked)
            {
                DocumentacionRpt rpt = reportMng.GetDocumentacionReport(alumnos, promos);

                if (rpt != null)
                {
                    ReportViewer.SetReport(rpt);
                    ReportViewer.ShowDialog();
                }
                else
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_DATA_REPORTS);
                }
            }
            _action_result = DialogResult.OK;
        }
Exemple #5
0
        private void Cliente_BT_Click(object sender, EventArgs e)
        {
            AlumnoSelectForm form = new AlumnoSelectForm(this);

            if (form.ShowDialog() == DialogResult.OK)
            {
                _alumno        = form.Selected as AlumnoInfo;
                Alumno_TB.Text = _alumno.Nombre;
            }
        }
 public NotaDesarrolloAlumnoInputForm(bool IsModal, Examen item, int index, AlumnoInfo alumno)
     : base(IsModal)
 {
     InitializeComponent();
     _entity = item;
     _index  = index;
     if (alumno != null)
     {
         Source_GB.Text = alumno.Apellidos + ", " + alumno.Nombre;
     }
     SetFormData();
     this.Text = Resources.Labels.NOTA_ALUMNO_TITLE;
 }
        private void Matricular_B_Click(object sender, EventArgs e)
        {
            if (_entity.FechaCaducidad < DateTime.Today)
            {
                MessageBox.Show(Resources.Messages.CONVOCATORIA_FINALIZADA);
                return;
            }

            AlumnoSelectForm formAlumno = new AlumnoSelectForm(this);

            if (formAlumno.ShowDialog() == DialogResult.OK)
            {
                AlumnoInfo alumno = formAlumno.Selected as AlumnoInfo;

                if (_entity.Alumnos.GetItemByAlumno(alumno.Oid) != null)
                {
                    MessageBox.Show(Resources.Messages.ALUMNO_YA_MATRICULADO);
                    return;
                }

                AlumnoClienteList aclientes = AlumnoClienteList.GetListByAlumno(alumno.Oid, false);

                if (aclientes.Count == 0)
                {
                    MessageBox.Show(Resources.Messages.NO_CLIENT_ASSOCIATED);
                    return;
                }
                else if (aclientes.Count == 1)
                {
                    _entity.Alumnos.NewItem(_entity, aclientes[0]);
                }
                else
                {
                    List <string> oids = new List <string>();
                    foreach (AlumnoClienteInfo item in aclientes)
                    {
                        oids.Add(item.OidCliente.ToString());
                    }

                    ClienteList      clientes     = ClienteList.GetListByList(oids, false);
                    ClientSelectForm formClientes = new ClientSelectForm(this, clientes);

                    if (formClientes.ShowDialog() == DialogResult.OK)
                    {
                        ClienteInfo cliente = formClientes.Selected as ClienteInfo;
                        _entity.Alumnos.NewItem(_entity, alumno, cliente);
                    }
                }
            }
        }
Exemple #8
0
        protected void SetNota(TreeNode node)
        {
            if (node.Level == 0)
            {
                return;
            }

            int        index  = _entity.Alumnos.IndexOf((Alumno_Examen)node.Tag);
            AlumnoInfo alumno = _alumnos.GetItem(((Alumno_Examen)node.Tag).OidAlumno);

            if (_entity.Desarrollo)
            {
                if (_entity.Alumnos[index].Respuestas.Count == 0)
                {
                    foreach (PreguntaExamen item in _entity.PreguntaExamens)
                    {
                        Respuesta_Alumno_Examen resp = Respuesta_Alumno_Examen.NewChild(_entity.Alumnos[index]);
                        resp.Orden             = item.Orden;
                        resp.OidPreguntaExamen = item.Oid;
                        _entity.Alumnos[index].Respuestas.Add(resp);
                    }
                }

                NotaDesarrolloAlumnoInputForm form = new NotaDesarrolloAlumnoInputForm(true, _entity, index, alumno);
                form.ShowDialog();
            }
            else
            {
                NotaAlumnoInputForm form = new NotaAlumnoInputForm(true, _entity, index, alumno);
                form.ShowDialog();
            }

            for (int i = Arbol_TV.Nodes.Count - 1; i >= 0; i--)
            {
                Arbol_TV.Nodes[i].Remove();
            }

            if (_promociones.Count > 0)
            {
                foreach (PromocionInfo item in _promociones)
                {
                    SetAlumnosValues(null, item);
                }
            }

            Arbol_TV.ExpandAll();
        }
        public RegistroNotasAlumnoForm(bool isModal, Form parent, long oid_alumno)
            : base(isModal, parent, null)
        {
            InitializeComponent();
            //_view_mode = molView.Select;
            SetView(molView.Normal);
            _item = AlumnoInfo.Get(oid_alumno, false);
            //_item.LoadChilds(typeof(Alumno_Examen), true);
            //List = _item.AlumnoExamens;
            // Parche para poder abrir el formulario en modo diseño y no perder la configuracion de columnas
            DatosLocal_BS    = Datos;
            Tabla.DataSource = DatosLocal_BS;
            SetMainDataGridView(Tabla);

            Datos.DataSource = Alumno_ExamenList.NewList().GetSortedList();

            base.SortProperty = FechaExamen.DataPropertyName;

            this.Text = Resources.Labels.NOTAS_ALUMNOS;
        }
 /// <summary>
 /// Asigna los valores del grid que no están asociados a propiedades
 /// </summary>
 protected override void SetUnlinkedGridValues(string gridName)
 {
     switch (gridName)
     {
     case "Alumnos_Grid":
     {
         foreach (DataGridViewRow row in Alumnos_Grid.Rows)
         {
             if (row.IsNewRow)
             {
                 continue;
             }
             AlumnoInfo info = (AlumnoInfo)row.DataBoundItem;
             if (info != null)
             {
                 row.Cells["Nombre"].Value = info.Apellidos + ", " + info.Nombre;
             }
         }
     } break;
     }
 }
Exemple #11
0
        /// <summary>
        /// Abre el formulario para borrar item
        /// <returns>void</returns>
        /// </summary>
        public override void DeleteObject(long oid)
        {
            if (MessageBox.Show(moleQule.Face.Resources.Messages.DELETE_CONFIRM,
                                moleQule.Face.Resources.Labels.ADVISE_TITLE,
                                MessageBoxButtons.YesNoCancel,
                                MessageBoxIcon.Question) == DialogResult.Yes)
            {
                try
                {
                    AlumnoInfo alumno = AlumnoInfo.Get(oid, true);
                    if (alumno.AlumnoPartes.Count > 0)
                    {
                        MessageBox.Show(Resources.Messages.ALUMNO_CON_PARTES_DE_FALTAS);
                        _action_result = DialogResult.Ignore;
                        return;
                    }

                    //Se elimina la foto
                    Images.Delete(List.GetItem(oid).Foto, Controler.FOTOS_ALUMNOS_PATH);

                    Alumno.Delete(oid);
                    _action_result = DialogResult.OK;

                    //Se eliminan todos los formularios de ese objeto
                    foreach (ItemMngBaseForm form in _list_active_form)
                    {
                        if (form.Oid == oid)
                        {
                            form.Dispose();
                            break;
                        }
                    }
                }
                catch (Csla.DataPortalException ex)
                {
                    MessageBox.Show(iQExceptionHandler.GetiQException(ex).Message);
                }
            }
        }
Exemple #12
0
        private void Imprimir_BT_Click(object sender, EventArgs e)
        {
            ExamenReportMng reportMng = new ExamenReportMng(AppContext.ActiveSchema);

            ExamenInfo info = _entity.GetInfo(true);

            foreach (PromocionInfo promo in _promociones)
            {
                List <Alumno_ExamenInfo> lista = new List <Alumno_ExamenInfo>();

                foreach (Alumno_ExamenInfo item in info.Alumnos)
                {
                    AlumnoInfo alumno    = _alumnos.GetItem(item.OidAlumno);
                    bool       pertenece = false;

                    foreach (Alumno_PromocionInfo pr in alumno.Promociones)
                    {
                        if (pr.OidPromocion == promo.Oid)
                        {
                            pertenece = true;
                            break;
                        }
                    }

                    if (alumno != null && pertenece)
                    {
                        lista.Add(item);
                    }
                }

                if (lista.Count > 0)
                {
                    ReportViewer.SetReport(reportMng.GetDetailReport(info,
                                                                     lista, promo,
                                                                     moleQule.Library.Common.CompanyInfo.Get(AppContext.ActiveSchema.Oid)));
                    ReportViewer.ShowDialog();
                }
            }
        }
Exemple #13
0
        protected AlumnoList GetAlumnoList(AlumnoInfo alumno, PromocionInfo promocion)
        {
            List <AlumnoInfo> alumnos = new List <AlumnoInfo>();
            AlumnoList        list;

            if (alumno != null)
            {
                alumnos.Add(alumno);
                list = AlumnoList.GetList(alumnos);
            }
            else
            {
                if (promocion != null)
                {
                    list = AlumnoList.GetListByPromocion(promocion.Oid, false);
                }
                else
                {
                    list = AlumnoList.GetList(false);
                }
            }

            return(list);
        }
Exemple #14
0
        private void generarEtiquetasToolStripMenuItem_Click(object sender, EventArgs e)
        {
            //Vemos cuantas líneas tiene el archivo para declarar el arreglo
            System.IO.StreamReader file = new System.IO.StreamReader("Archivos-Salones/Salones.csv");
            file.ReadLine();
            //procesamos cada fila para saber la capacidad del mismo
            int numSalones = 0;

            while ((linea = file.ReadLine()) != null)
            {
                valores         = linea.Split(',');
                filas_columnas  = valores[2] + ";" + valores[3];
                capacidad       = Convert.ToInt32(valores[2]) * Convert.ToInt32(valores[3]);
                capacidadTotal += capacidad;
                Salones.Add(new ListaSalones()
                {
                    id             = valores[0],
                    nombre         = valores[1],
                    capacidad      = capacidad,
                    capacidadAUX   = capacidad,
                    filas_columnas = filas_columnas
                });
                numSalones++;//CALCULO DE SALONES
            }

            //Leemos el archivo "Entrada" para saber cuantos alumnos hay de cada escuela y agruparlos
            file = new System.IO.StreamReader("Archivos-Salones/Entrada.csv");
            file.ReadLine();
            //Se lee la siguiente línea y se compara hasta que se termine de leer el archivo
            while ((linea = file.ReadLine()) != null)
            {
                valores = linea.Split(',');
                //Agregamos todos los valores del archivo a la lista
                Escuelas.Add(new NombreEscuelas()
                {
                    nombre = valores[0]
                });
            }


            //Vemos cuantas escuelas hay en total, cuantos alumnos tienen cada una
            //y van de mayor a menor
            var query = from escuela in Escuelas
                        group escuela by escuela.nombre into nuevoGrupo
                        orderby nuevoGrupo.Count() descending
                        select nuevoGrupo;

            foreach (var group in query)
            {
                Escuelas[i].nombre          = group.Key;
                Escuelas[i].capacidad       = Escuelas[i].capacidadAUX = group.Count();
                Escuelas[i].estado          = 0;
                Escuelas[i].capacidadxSalon = new double[Salones.Count()];
                for (j = 0; j < Salones.Count(); j++)
                {
                    auxAlumno = Math.Round((double)Escuelas[i].capacidad / capacidadTotal * Salones[j].capacidad);
                    //si todavía hay alumnos de esa escuela, se asigna
                    if (Escuelas[i].capacidadAUX >= auxAlumno)
                    {
                        //Preguntamos si todavía hay espacio en ese salón
                        if (Salones[j].capacidadAUX > auxAlumno)
                        {
                            //preguntamos si la escuela sólo tiene un participante
                            if (Escuelas[i].capacidad == 1)
                            {//de ser así, se asigna al primer salón y se pasa al siguiente
                                Escuelas[i].capacidadxSalon[j] = 1;
                                Salones[j].capacidadAUX        = Salones[j].capacidadAUX - 1;
                                capacidadTotal           = capacidadTotal - 1;
                                Escuelas[i].capacidadAUX = Escuelas[i].capacidadAUX - 1;
                                break;
                            }
                            Escuelas[i].capacidadxSalon[j] = auxAlumno;
                            capacidadTotal           = capacidadTotal - (int)auxAlumno;
                            Escuelas[i].capacidadAUX = Escuelas[i].capacidadAUX - (int)auxAlumno;
                            Salones[j].capacidadAUX  = Salones[j].capacidadAUX - (int)auxAlumno;
                            //MessageBox.Show("Escuela "+Escuelas[i].capacidad+((double)Salones[j].capacidad / capacidadTotal * Escuelas[i].capacidad).ToString());
                        }
                    }
                }
                i++;
            }

            AlumnosPorEscuelaPorSalon = new int[i];
            //prueba para ver que todo este saliendo de acuerdo al plan
            tablaAlgoritmo tabla = new tablaAlgoritmo();
            int            cantidadDeEscuelas = 0;

            for (i = 0; i < Escuelas.Count(); i++)
            {
                if (Escuelas[i].capacidadxSalon != null)
                {
                    capacidadTotal = i;
                    tabla.dataGridView1.Rows.Add(Escuelas[i].nombre, "Partcipantes: " + Escuelas[i].capacidad,
                                                 Escuelas[i].capacidadxSalon[0] + "/" + Escuelas[i].capacidadxSalon[1] + "/" +
                                                 Escuelas[i].capacidadxSalon[2] + "/" + Escuelas[i].capacidadxSalon[3] + "/" +
                                                 Escuelas[i].capacidadxSalon[4] + "/" + Escuelas[i].capacidadxSalon[5] + "/" +
                                                 Escuelas[i].capacidadxSalon[6]);
                    cantidadDeEscuelas++;
                }
                else
                {
                    break;
                }
            }
            tabla.Show();
            // Inicializamos el documento PDF
            Document doc = new Document(PageSize.LETTER);

            PdfWriter.GetInstance(doc, new FileStream("Archivos-Salones/ListaSalones.pdf", FileMode.Create)); // asignamos el nombre de archivo hola.pdf
            // Importante Abrir el documento
            doc.Open();
            // Creamos un titulo personalizado con tamaño de fuente 18 y color Azul
            Paragraph title, tit, titulo;

            AlumnoInfo[,] listaDeAlumnosPorSalon = new AlumnoInfo[Salones.Count(), maxDeSalones];

            //FUNCION DE PROGRAMA-----------------------------------------------------------------------------------------------------
            //LISTADO DE ESTUDIANTES POR SALON CON LA CANTIDAD CORRESPONDIENTE-----------------------------------------------------------------------------------------------------
            for (int m = 0; m < cantidadDeEscuelas; m++)
            {
                System.IO.StreamReader listaAlumnos = new System.IO.StreamReader("Archivos-Salones/Entrada.csv");
                listaAlumnos.ReadLine();
                for (int n = 0; n < numSalones; n++)
                {
                    int alumnosEnLalistaDelSalon = 0;
                    //Se valida si hay alumnos antes para ingresar después del último
                    while (listaDeAlumnosPorSalon[n, alumnosEnLalistaDelSalon] != null)
                    {
                        alumnosEnLalistaDelSalon++;
                    }
                    //Variable que indica cuantos de esa escuela ya han sido seleccionados.
                    int seleccionados = 0;
                    while ((Escuelas[m].capacidadxSalon[n] != 0) && ((linea = listaAlumnos.ReadLine()) != null))
                    {
                        valores = linea.Split(',');
                        if (valores[0] == Escuelas[m].nombre)
                        {
                            listaDeAlumnosPorSalon[n, seleccionados + alumnosEnLalistaDelSalon] = new AlumnoInfo(valores[0], valores[2], valores[1]);;
                            seleccionados++;
                        }
                        if (Escuelas[m].capacidadxSalon[n] == seleccionados)
                        {
                            break;
                        }
                    }
                }
            }
            //ALGORTIMO PARA ACOMODAR A LOS ESTUDIANTES SIN QUE SEAN DE LA MISMA ESCUELA----------------------------------------------
            //Array que contiene la informacion Folio/AlumnoNombre/AsientoEnElSalon
            AlumnoInfo_Asiento[,] asientosInfo = new AlumnoInfo_Asiento[Salones.Count(), maxDeSalones];
            System.IO.StreamReader fileSalon = new System.IO.StreamReader("Archivos-Salones/Salones.csv");
            fileSalon.ReadLine();
            //SALONES--------------------------------------------
            int[,] salonesFilasColumnas = new int[numSalones, 2];
            for (int n = 0; n < numSalones; n++)
            {
                int alumnoPosicion   = 0; //Posicion en la lista de alumnos del salon
                int asientosPosicion = 0; //Posicion en los asientos del salon
                linea = fileSalon.ReadLine();
                String[] salonesInfo = linea.Split(',');
                salonesFilasColumnas[n, 0] = Convert.ToInt32(salonesInfo[2]);
                salonesFilasColumnas[n, 1] = Convert.ToInt32(salonesInfo[3]);

                int cantidadDeAlumnosEnElSalon = 0;//Variable para saber cuantos alumnos hay en el salon actual.
                while (listaDeAlumnosPorSalon[n, alumnoPosicion] != null)
                {
                    cantidadDeAlumnosEnElSalon++;
                    alumnoPosicion++;
                }
                alumnoPosicion = 0;
                int       numDeVuletasRepetidas = 0;
                int       auxAsientosPosicion   = 0;
                int       posicionAux           = 0;
                ArrayList posicionesSaltadas    = new ArrayList();

                while (asientosPosicion != cantidadDeAlumnosEnElSalon)
                {
                    int[] puntosCardinales;
                    bool  auxUsado = false;
                    //Obtenemos lo puntos cardinales a la posicion del asiento(arriba, derecha, abajo, izquierda)
                    if (posicionesSaltadas.Count == 0 && auxAsientosPosicion == 0)
                    {
                        puntosCardinales = crearPuntosCardinales(asientosPosicion, Convert.ToInt32(salonesInfo[3]));
                    }
                    else
                    {
                        puntosCardinales = crearPuntosCardinales((int)posicionesSaltadas[0] + auxAsientosPosicion, Convert.ToInt32(salonesInfo[3]));
                        posicionAux      = (int)posicionesSaltadas[0] + auxAsientosPosicion;
                        auxUsado         = true;
                    }

                    //Obtenermos si estan ocupados, si lo están saber de que escuela es
                    String[] nombresDeEscuelasCardinales = new string[4];
                    //SE ASIGNAN LOS NOMBRES DE LAS ESCUELAS CARDINALES AL ASIENTO------------------------------------------------------------------------
                    for (int m = 0; m < 4; m++)
                    {
                        if (puntosCardinales[m] >= 0)                         //Indica que el asiento existe
                        {
                            if (asientosInfo[n, puntosCardinales[m]] != null) //Hay alguien en los puntos cardinales
                            {
                                nombresDeEscuelasCardinales[m] = asientosInfo[n, puntosCardinales[m]].getAlumnoInfo().getEscuela();
                            }
                            else
                            {
                                nombresDeEscuelasCardinales[m] = " ";
                            }
                            if (m == 1 && puntosCardinales[m] > 0 && ((puntosCardinales[m]) % Convert.ToInt32(salonesInfo[3]) == 0))
                            {
                                nombresDeEscuelasCardinales[m] = " ";
                            }
                            if (m == 3 && (puntosCardinales[m] + 1) % Convert.ToInt32(salonesInfo[3]) == 0)
                            {
                                nombresDeEscuelasCardinales[m] = " ";
                            }
                        }
                        else//El asiento no existe
                        {
                            nombresDeEscuelasCardinales[m] = " ";
                        }
                    }

                    //ASIGNACIÓN DE LOS ASIENTOS----------------------------------------------------------------------------------------------
                    //SE VALIDAN PRIMERO SI SON DISTINTAS ESCUELAS LAS CARDINALES-------------------------------------------------------------
                    int validaciones = 0;
                    for (int k = 0; k < 4; k++)
                    {
                        if (sonDistintaEscuela(nombresDeEscuelasCardinales[k], listaDeAlumnosPorSalon[n, alumnoPosicion].getEscuela()))
                        {
                            validaciones++;
                        }
                        else
                        {
                            break;
                        }
                    }
                    if (validaciones == 4)
                    //LAS ESCUELAS CARDINALES SON DISTINTAS, AHORA VER SI NO FUE ASIGNADO CON ANTERIORIDAD------------------------------------
                    {
                        int validacionEnLista = 0;
                        for (int k = 0; k < asientosPosicion; k++)//asientosPosicion
                        {
                            if (listaDeAlumnosPorSalon[n, alumnoPosicion].getNombre() != asientosInfo[n, k].getAlumnoInfo().getNombre())
                            {
                                validacionEnLista++;
                            }
                            else
                            {
                                break;
                            }
                        }
                        if (auxUsado)
                        {
                            for (int k = asientosPosicion; k < posicionAux; k++)
                            {
                                if (asientosInfo[n, k] == null)
                                {
                                    if (k == posicionAux)
                                    {
                                        validacionEnLista++;
                                    }
                                    break;
                                }
                                if (listaDeAlumnosPorSalon[n, alumnoPosicion].getNombre() != asientosInfo[n, k].getAlumnoInfo().getNombre())
                                {
                                    validacionEnLista++;
                                }
                            }
                        }
                        if (validacionEnLista == asientosPosicion)
                        {
                            if (auxUsado)
                            {
                                if (auxAsientosPosicion != 0)
                                {
                                    asientosInfo[n, (int)posicionesSaltadas[0] + auxAsientosPosicion] = new AlumnoInfo_Asiento(listaDeAlumnosPorSalon[n, alumnoPosicion], ((int)posicionesSaltadas[0] + auxAsientosPosicion + 1));
                                    auxAsientosPosicion = 0;
                                    asientosPosicion++;
                                    numDeVuletasRepetidas = 0;
                                }
                                else
                                {
                                    asientosInfo[n, (int)posicionesSaltadas[0]] = new AlumnoInfo_Asiento(listaDeAlumnosPorSalon[n, alumnoPosicion], ((int)posicionesSaltadas[0] + 1));
                                    posicionesSaltadas.Remove(posicionesSaltadas[0]);
                                    asientosPosicion++;
                                    numDeVuletasRepetidas = 0;
                                }
                            }
                            else
                            {
                                asientosInfo[n, asientosPosicion] = new AlumnoInfo_Asiento(listaDeAlumnosPorSalon[n, alumnoPosicion], (asientosPosicion + 1));
                                asientosPosicion++;
                                numDeVuletasRepetidas = 0;
                            }
                        }
                    }

                    alumnoPosicion++;
                    //Se reinicia la lista para que se recorra de nuevo
                    if (alumnoPosicion == cantidadDeAlumnosEnElSalon)
                    {
                        numDeVuletasRepetidas++;
                        alumnoPosicion = 0;
                        if (n == 4 && asientosPosicion == 23)
                        {
                        }
                    }
                    if (numDeVuletasRepetidas > 1)
                    {
                        auxAsientosPosicion++;
                        //Se agrega la posicion saltada a un array
                        posicionesSaltadas.Add(asientosPosicion);
                        numDeVuletasRepetidas = 0;
                    }
                }
            }
            //CREANDO LA LISTA DE ESTUDIANTES POR SALON(PDF)--------------------------------------------------------------------------
            for (int n = 0; n < numSalones; n++)
            {
                filas    = Salones[n].filas_columnas.Split(';')[0];
                columnas = Salones[n].filas_columnas.Split(';')[1];
                int capac = Int32.Parse(filas) * Int32.Parse(columnas);

                //Lista salon
                title      = new Paragraph();
                title.Font = FontFactory.GetFont(FontFactory.TIMES_BOLD, 18f, BaseColor.BLACK);

                //Orden visual
                tit      = new Paragraph();
                tit.Font = FontFactory.GetFont(FontFactory.TIMES_BOLD, 18f, BaseColor.BLACK);

                //etiquetas

                titulo      = new Paragraph();
                titulo.Font = FontFactory.GetFont(FontFactory.TIMES_BOLD, 18f, BaseColor.BLACK);
                //var boldFont = FontFactory.GetFont(FontFactory.TIMES_BOLD, 12);

                title.Add("Lista de alumnos del salón " + Salones[n].nombre);
                doc.Add(title);
                doc.Add(new Paragraph(" "));

                //Cambiar tamaño
                PdfPTable table = new PdfPTable(4);
                table.SetTotalWidth(new float[] { 10f, 10f, 40f, 10f });
                PdfPCell salon = new PdfPCell(new Phrase("No.", FontFactory.GetFont(FontFactory.TIMES_BOLD, 12f, BaseColor.BLACK)));
                salon.HorizontalAlignment = 1;
                table.AddCell(salon);
                salon = new PdfPCell(new Phrase("Folio", FontFactory.GetFont(FontFactory.TIMES_BOLD, 12f, BaseColor.BLACK)));
                salon.HorizontalAlignment = 1;
                table.AddCell(salon);
                salon = new PdfPCell(new Phrase("Nombre", FontFactory.GetFont(FontFactory.TIMES_BOLD, 12f, BaseColor.BLACK)));
                salon.HorizontalAlignment = 1;
                table.AddCell(salon);
                salon = new PdfPCell(new Phrase("Lugar", FontFactory.GetFont(FontFactory.TIMES_BOLD, 12f, BaseColor.BLACK)));
                salon.HorizontalAlignment = 1;
                table.AddCell(salon);

                PdfPTable etiq = new PdfPTable(3);

                int alumnoPosicion = 0;
                while (listaDeAlumnosPorSalon[n, alumnoPosicion] != null)
                {
                    alumnoPosicion++;
                }
                int alumnos        = alumnoPosicion;
                int saltosAsientos = 0;

                //Unicamente la Lista de Alumnos del salon
                AlumnoInfo_Asiento[] listaOrdenadaDeAlumnos = new AlumnoInfo_Asiento[alumnos];

                for (int p = 0; p < alumnos; p++)
                {
                    while (asientosInfo[n, p + saltosAsientos] == null)
                    {
                        saltosAsientos++;
                    }
                    listaOrdenadaDeAlumnos[p] = asientosInfo[n, p + saltosAsientos];

                    //Escribiendo lista


                    //String numero = Convert.ToString(p + 1);
                    //salon = new PdfPCell(new Phrase(numero, FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK)));
                    //salon.HorizontalAlignment = 1;
                    //table.AddCell(salon);

                    //salon = new PdfPCell(new Phrase(asientosInfo[n, p + saltosAsientos].getAlumnoInfo().getMatricula(), FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK)));
                    //salon.HorizontalAlignment = 1;
                    //table.AddCell(salon);

                    //salon = new PdfPCell(new Phrase(asientosInfo[n, p + saltosAsientos].getAlumnoInfo().getNombre(), FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK)));
                    //salon.HorizontalAlignment = 1;
                    //table.AddCell(salon);

                    //salon = new PdfPCell(new Phrase("" + asientosInfo[n, p + saltosAsientos].getAsiento(), FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK)));
                    //salon.HorizontalAlignment = 1;
                    //table.AddCell(salon);


                    //Fin de lista

                    //Etiquetas
                    //Cambiar tamaño en fontTimes__
                    Phrase phraseEtiquetasF = new Phrase();
                    phraseEtiquetasF.Add(
                        new Chunk("Folio: \n", FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK))
                        );
                    phraseEtiquetasF.Add(
                        new Chunk(asientosInfo[n, p + saltosAsientos].getAlumnoInfo().getMatricula() + "\n", FontFactory.GetFont(FontFactory.TIMES_BOLD, 52f, BaseColor.BLACK))
                        );
                    phraseEtiquetasF.Add(glue);
                    phraseEtiquetasF.Add(
                        new Chunk(" " + asientosInfo[n, p + saltosAsientos].getAsiento(), FontFactory.GetFont(FontFactory.TIMES_ROMAN, 9f, BaseColor.BLACK))
                        );
                    salon = new PdfPCell(phraseEtiquetasF);
                    salon.HorizontalAlignment = 1;
                    etiq.AddCell(salon);
                    alumnoPosicion++;
                    //Fin etiquetas
                }

                for (int a = 0; a < listaOrdenadaDeAlumnos.Length; a++)
                {
                    for (int b = 0; b < listaOrdenadaDeAlumnos.Length - a - 1; b++)
                    {
                        String alumno1 = RemoveDiacritics(listaOrdenadaDeAlumnos[b].getAlumnoInfo().getNombre());
                        String alumno2 = RemoveDiacritics(listaOrdenadaDeAlumnos[b + 1].getAlumnoInfo().getNombre());
                        if (alumno1.CompareTo(alumno2) > 0)
                        {
                            AlumnoInfo_Asiento aux = listaOrdenadaDeAlumnos[b];
                            listaOrdenadaDeAlumnos[b]     = listaOrdenadaDeAlumnos[b + 1];
                            listaOrdenadaDeAlumnos[b + 1] = aux;
                        }
                    }
                }
                for (int p = 0; p < alumnos; p++)
                {
                    //Escribiendo lista
                    String numero = Convert.ToString(p + 1);
                    salon = new PdfPCell(new Phrase(numero, FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK)));
                    salon.HorizontalAlignment = 1;
                    table.AddCell(salon);

                    salon = new PdfPCell(new Phrase(listaOrdenadaDeAlumnos[p].getAlumnoInfo().getMatricula(), FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK)));
                    salon.HorizontalAlignment = 1;
                    table.AddCell(salon);
                    //Matricula
                    salon = new PdfPCell(new Phrase(listaOrdenadaDeAlumnos[p].getAlumnoInfo().getNombre(), FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK)));
                    salon.HorizontalAlignment = 1;
                    table.AddCell(salon);
                    //Nombre
                    salon = new PdfPCell(new Phrase("" + listaOrdenadaDeAlumnos[p].getAsiento(), FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK)));
                    salon.HorizontalAlignment = 1;
                    table.AddCell(salon);
                    //Número de asiento
                    //Fin de lista
                }

                //Unicamente el orden visual del salon ------------------------------------------------------------------------------------
                PdfPTable ordenVisual = new PdfPTable(salonesFilasColumnas[n, 1]);
                Phrase    phrase      = new Phrase();
                phrase.Add(
                    new Chunk("PIZARRA", FontFactory.GetFont(FontFactory.TIMES_BOLD, 12f, BaseColor.BLACK))
                    );
                salon                     = new PdfPCell(phrase);
                salon.Colspan             = salonesFilasColumnas[n, 1];
                salon.HorizontalAlignment = 1;
                ordenVisual.AddCell(salon);
                for (int l = 0; l < salonesFilasColumnas[n, 0]; l++)
                {
                    for (int m = 0; m < salonesFilasColumnas[n, 1]; m++)
                    {
                        if (asientosInfo[n, l *salonesFilasColumnas[n, 1] + m] != null)
                        {
                            Phrase phraseOrden = new Phrase();
                            phraseOrden.Add(
                                new Chunk("Folio: \n", FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK))
                                );
                            phraseOrden.Add(
                                new Chunk(asientosInfo[n, l * salonesFilasColumnas[n, 1] + m].getAlumnoInfo().getMatricula() + " \n", FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK))
                                );
                            phraseOrden.Add(glue);
                            phraseOrden.Add(
                                new Chunk(asientosInfo[n, l * salonesFilasColumnas[n, 1] + m].getAsiento() + " \n", FontFactory.GetFont(FontFactory.TIMES_ROMAN, 9f, BaseColor.BLACK))
                                );

                            salon = new PdfPCell(phraseOrden);
                            salon.HorizontalAlignment = 1;
                            ordenVisual.AddCell(salon);
                        }
                        else
                        {
                            Phrase phraseOrden = new Phrase();
                            Chunk  glue        = new Chunk(new VerticalPositionMark());
                            phraseOrden.Add(
                                new Chunk("Lugar vacío \n", FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12f, BaseColor.BLACK))
                                );
                            phraseOrden.Add(
                                new Chunk(" \n", fontTimes12)
                                );
                            phraseOrden.Add(glue);
                            phraseOrden.Add(
                                new Chunk(" " + (l * salonesFilasColumnas[n, 1] + m + 1), FontFactory.GetFont(FontFactory.TIMES_ROMAN, 9f, BaseColor.BLACK))
                                );

                            salon = new PdfPCell(phraseOrden);
                            salon.HorizontalAlignment = 1;
                            ordenVisual.AddCell(salon);
                        }
                    }
                }
                //Fin de orden visual------------------------------------------------------------------------------------------------------
                doc.Add(table);
                doc.Add(new Paragraph(" "));

                //Inicio de una nueva página
                doc.NewPage();
                tit.Add(" " + Salones[n].nombre + " - Orden visual");
                doc.Add(tit);
                doc.Add(new Paragraph(" "));
                ordenVisual.TotalWidth      = 500f;
                ordenVisual.WidthPercentage = 100;
                ordenVisual.LockedWidth     = true;
                doc.Add(ordenVisual);

                //Unicamente Etiquetas
                doc.Add(new Paragraph("  "));
                doc.NewPage();
                titulo.Add(" " + Salones[n].nombre + " - etiquetas");
                doc.Add(titulo);
                doc.Add(new Paragraph(" "));
                etiq.TotalWidth      = 500f;
                etiq.WidthPercentage = 100;
                etiq.LockedWidth     = true;

                int pAux = alumnos;
                while (pAux % 3 != 0)
                {
                    etiq.AddCell(" ");
                    pAux++;
                }
                doc.Add(etiq);
                doc.Add(new Paragraph("  "));
                doc.NewPage();
            }
            doc.Add(new Paragraph(" "));
            doc.Close();
        }
Exemple #15
0
 public AlumnoInfo_Asiento(AlumnoInfo alumno, int asiento)
 {
     this.alumno  = alumno;
     this.asiento = asiento;
 }
 protected override void GetFormSourceData(long oid)
 {
     _entity  = AlumnoInfo.GetForForm(oid, true);
     _mf_type = ManagerFormType.MFView;
 }
Exemple #17
0
        /// <summary>
        /// Abre el formulario para borrar item
        /// <returns>void</returns>
        /// </summary>
        public override void DeleteObject(long oid)
        {
            //if (MessageBox.Show(moleQule.Face.Resources.Messages.DELETE_CONFIRM,
            //                    moleQule.Face.Resources.Labels.ADVISE_TITLE,
            //                    MessageBoxButtons.YesNoCancel,
            //                    MessageBoxIcon.Question) == DialogResult.Yes)
            //{
            try
            {
                AlumnoInfo alumno = AlumnoInfo.Get(oid, true);
                if (alumno.AlumnoPartes.Count > 0)
                {
                    foreach (Alumno_ParteInfo item in alumno.AlumnoPartes)
                    {
                        if (item.Falta || item.Retraso)
                        {
                            MessageBox.Show(Resources.Messages.ALUMNO_CON_PARTES_DE_FALTAS);
                            _action_result = DialogResult.Ignore;
                            return;
                        }
                    }
                }
                if (alumno.AlumnosPracticas.Count > 0)
                {
                    foreach (Alumno_PracticaInfo item in alumno.AlumnosPracticas)
                    {
                        if (item.Calificacion != "SIN CALIFICAR")
                        {
                            MessageBox.Show(Resources.Messages.ALUMNO_CON_PRACTICAS);
                            _action_result = DialogResult.Ignore;
                            return;
                        }
                    }
                }
                if (alumno.AlumnoExamens.Count > 0)
                {
                    MessageBox.Show(Resources.Messages.ALUMNO_CON_EXAMENES);
                    _action_result = DialogResult.Ignore;
                    return;
                }

                //Se elimina la foto
                Images.Delete(List.GetItem(oid).Foto, AppController.FOTOS_ALUMNOS_PATH);

                Alumno.Delete(oid);
                _action_result = DialogResult.OK;

                //Se eliminan todos los formularios de ese objeto
                foreach (ItemMngBaseForm form in _list_active_form)
                {
                    if (form.Oid == oid)
                    {
                        form.Dispose();
                        break;
                    }
                }
            }
            catch (Csla.DataPortalException ex)
            {
                MessageBox.Show(iQExceptionHandler.GetiQException(ex).Message);
            }
            //}
        }