Example #1
0
        public static void SetPreguntasReservadas()
        {
            ExamenList examenes = ExamenList.GetList(false);

            Pregunta.InitializeReservadas();

            foreach (ExamenInfo item in examenes)
            {
                //si no se ha emitido hay que marcar como reservadas sus preguntas
                if (item.FechaEmision.Date.Equals(DateTime.MaxValue.Date) ||
                    item.FechaEmision.Date.Equals(DateTime.MinValue.Date) ||
                    item.FechaEmision.Year.Equals(1970))
                {
                    //se obtienen los oids de las preguntas incluidas en el examen
                    string preguntas = item.MemoPreguntas;

                    while (preguntas != string.Empty)
                    {
                        int    indice = preguntas.IndexOf(";");
                        string oid    = preguntas.Substring(0, indice);
                        preguntas = preguntas.Substring(indice + 1);
                        long oid_pregunta = Convert.ToInt32(oid);

                        Pregunta.FormatReservada(oid_pregunta);
                    }
                }
            }
        }
Example #2
0
        public ExamenSelectForm(Form parent, ExamenList lista)
            : base(true, parent, lista)
        {
            InitializeComponent();
            _view_mode = molView.Select;

            DialogResult = DialogResult.Cancel;
        }
        protected void SetUnlinkedGridValues(string gridName)
        {
            switch (gridName)
            {
            case "Tabla":
            {
                ExamenList examenes = ExamenList.GetList(false);
                foreach (DataGridViewRow row in Tabla.Rows)
                {
                    if (row.IsNewRow)
                    {
                        continue;
                    }
                    Alumno_ExamenInfo info = (Alumno_ExamenInfo)row.DataBoundItem;
                    if (info != null)
                    {
                        ExamenInfo examen = examenes.GetItem(info.OidExamen);
                        if (examen != null)
                        {
                            if (info.Presentado)
                            {
                                if (examen.Desarrollo)
                                {
                                    string calif = string.Empty;
                                    if (info.Respuestas == null)
                                    {
                                        info = Alumno_ExamenInfo.Get(info.Oid, true);
                                    }

                                    foreach (Respuesta_Alumno_ExamenInfo item in info.Respuestas)
                                    {
                                        if (calif != string.Empty)
                                        {
                                            calif += " - ";
                                        }
                                        calif += item.Calificacion.ToString() + "%";
                                    }
                                    row.Cells["Calificacion"].Value = calif;
                                }
                                else
                                {
                                    row.Cells["Calificacion"].Value = info.Calificacion.ToString() + "%";
                                }
                            }
                            else
                            {
                                row.Cells["Calificacion"].Value = "NP";
                            }
                        }
                    }
                }
            } break;
            }
        }
Example #4
0
        public override void RefreshSecondaryData()
        {
            _examenes                 = ExamenList.GetList(false);
            _combo_examenes           = new Library.Instruction.HComboBoxSourceList(_examenes);
            Datos_Examenes.DataSource = _combo_examenes;
            PgMng.Grow();

            _combo_opciones = new Library.Instruction.HComboBoxSourceList();
            _combo_opciones.Add(new ComboBoxSource(1, ""));
            _combo_opciones.Add(new ComboBoxSource(2, "A"));
            _combo_opciones.Add(new ComboBoxSource(3, "B"));
            _combo_opciones.Add(new ComboBoxSource(4, "C"));
            Datos_Opciones.DataSource = _combo_opciones;
            PgMng.Grow();
        }
Example #5
0
        public ExamenMngForm(bool isModal, Form parent, ExamenList list)
            : base(isModal, parent, list)
        {
            InitializeComponent();
            SetView(molView.Normal);

            // Parche para poder abrir el formulario en modo diseño y no perder la configuracion de columnas
            DatosLocal_BS    = Datos;
            Tabla.DataSource = DatosLocal_BS;

            TablaBase        = Tabla;
            Datos.DataSource = ExamenList.NewList().GetSortedList();

            SortProperty = Numero.DataPropertyName;
        }
Example #6
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
                if (_entity == null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    ExamenList list = ExamenList.GetList(_filter_results);
                    list.AddItem(_entity.GetInfo(false));
                    _filter_results = list.GetSortedList();
                }
                break;

            case molAction.Edit:
            case molAction.Lock:
            case molAction.Unlock:
                if (_entity == null)
                {
                    return;
                }
                ActiveItem.CopyFrom(_entity);
                break;

            case molAction.Delete:
                if (ActiveItem == null)
                {
                    return;
                }
                List.RemoveItem(ActiveOID);
                if (FilterType == IFilterType.Filter)
                {
                    ExamenList list = ExamenList.GetList(_filter_results);
                    list.RemoveItem(ActiveOID);
                    _filter_results = list.GetSortedList();
                }
                break;
            }

            _entity = null;
            RefreshSources();
        }
Example #7
0
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "Exámenes");

            _selectedOid = ActiveOID;

            switch (DataType)
            {
            case EntityMngFormTypeData.Default:
                List = ExamenList.GetList(false);
                break;

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            PgMng.Grow(string.Empty, "Lista de Exámenes");
        }
Example #8
0
        public static void FormatFechaDisponibilidad()
        {
            PreguntaExamenList preguntasexamen = PreguntaExamenList.GetList(false);
            PreguntaList       preguntas       = PreguntaList.GetList(false);
            ExamenList         examenes        = ExamenList.GetList(false);

            foreach (PreguntaInfo item in preguntas)
            {
                DateTime fecha_disponibilidad = DateTime.MaxValue;

                foreach (PreguntaExamenInfo pexamen in preguntasexamen)
                {
                    //la pregunta se encuentra en un examen emitido
                    if (item.Oid == pexamen.OidPregunta)
                    {
                        ExamenInfo examen = examenes.GetItem(pexamen.OidExamen);

                        DateTime fecha = examen.FechaExamen.AddMonths(6);

                        if (fecha_disponibilidad.Equals(DateTime.MaxValue) ||
                            (!fecha_disponibilidad.Equals(DateTime.MaxValue) &&
                             fecha.Date > fecha_disponibilidad.Date))
                        {
                            fecha_disponibilidad = fecha;
                        }
                    }
                }

                if (fecha_disponibilidad.Date.Equals(DateTime.MaxValue.Date))
                {
                    fecha_disponibilidad = item.FechaAlta;
                }

                if (!item.FechaDisponibilidad.Date.Equals(fecha_disponibilidad.Date))
                {
                    Pregunta.FormatDisponibilidad(item.Oid, fecha_disponibilidad);
                }
            }
        }
        protected override void SetUnlinkedGridValues(string gridName)
        {
            switch (gridName)
            {
            case "Examenes_Grid":
            {
                ExamenList examenes = ExamenList.GetList(false);
                foreach (DataGridViewRow row in Examenes_Grid.Rows)
                {
                    if (row.IsNewRow)
                    {
                        continue;
                    }
                    Alumno_Examen info = (Alumno_Examen)row.DataBoundItem;
                    if (info != null)
                    {
                        ExamenInfo examen = examenes.GetItem(info.OidExamen);
                        if (examen != null)
                        {
                            row.Cells["Examen"].Value = examen.Titulo;
                            if (info.Presentado)
                            {
                                if (examen.Desarrollo)
                                {
                                    string calif = string.Empty;
                                    foreach (Respuesta_Alumno_Examen item in info.Respuestas)
                                    {
                                        if (calif != string.Empty)
                                        {
                                            calif += " - ";
                                        }
                                        calif += item.Calificacion.ToString() + "%";
                                    }
                                    row.Cells["Calificacion"].Value = calif;
                                }
                                else
                                {
                                    row.Cells["Calificacion"].Value = info.Calificacion.ToString();
                                }
                            }
                            else
                            {
                                row.Cells["Calificacion"].Value = "NP";
                            }
                        }
                    }
                }
            } break;

            case "Practicas_Grid":
            {
                //ClasePracticaList practicas = ClasePracticaList.GetList();
                foreach (DataGridViewRow row in Practicas_Grid.Rows)
                {
                    if (row.IsNewRow)
                    {
                        continue;
                    }
                    Alumno_Practica info = (Alumno_Practica)row.DataBoundItem;
                    if (info != null)
                    {
                        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;

            case "Faltas_Grid":
            {
                ParteAsistenciaList partes = ParteAsistenciaList.GetList(false);
                foreach (DataGridViewRow row in Faltas_Grid.Rows)
                {
                    if (row.IsNewRow)
                    {
                        continue;
                    }
                    Alumno_Parte info = (Alumno_Parte)row.DataBoundItem;
                    if (info != null)
                    {
                        ParteAsistenciaInfo item = partes.GetItem(info.OidParte);
                        if (item != null)
                        {
                            row.Cells["Clase"].Value = item.Texto;
                            row.Cells["Fecha"].Value = item.Fecha;
                            row.Cells["Hora"].Value  = item.HoraInicio;
                        }
                    }
                }
            }
            break;
            }
        }
Example #10
0
 private void GetPreguntasReservadas()
 {
     preguntas_incluidas = ExamenList.GetPreguntasReservadas(_entity);
 }
Example #11
0
 protected void GetPreguntasReservadas()
 {
     preguntas_mismo_dia = ExamenList.GetPreguntasReservadas(Entity);
 }
Example #12
0
        protected new SortedBindingList <ExamenInfo> Localize(object value, string column_name)
        {
            SortedBindingList <ExamenInfo> list = null;
            ExamenList sourceList = null;

            switch (FilterType)
            {
            case IFilterType.None:
                if (List == null)
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS);
                    return(null);
                }
                sourceList = List;
                break;

            case IFilterType.Filter:
                if (FilteredList == null)
                {
                    MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS);
                    return(null);
                }
                sourceList = FilteredList;
                break;

            default:
                sourceList = List;
                break;
            }

            FCriteria criteria = null;
            string    related  = "none";

            switch (column_name)
            {
            default:
                criteria = GetCriteria(column_name, value, null, _operation);
                break;
            }

            switch (related)
            {
            case "none":
                list = sourceList.GetSortedSubList(criteria);
                break;
            }

            if (list.Count == 0)
            {
                MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS);
                return(sourceList.GetSortedList());
            }

            DatosSearch.DataSource = list;
            DatosSearch.MoveFirst();

            AddFilterItem(column_name, value);

            Tabla.Focus();

            return(list);
        }