Beispiel #1
0
        public override void UpdateList()
        {
            switch (_current_action)
            {
            case molAction.Add:
                if (_entity == null)
                {
                    return;
                }
                List.AddItem(_entity.GetInfo(false));
                if (FilterType == IFilterType.Filter)
                {
                    ParteAsistenciaList listA = ParteAsistenciaList.GetList(_filter_results);
                    listA.AddItem(_entity.GetInfo(false));
                    _filter_results = listA.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)
                {
                    ParteAsistenciaList listD = ParteAsistenciaList.GetList(_filter_results);
                    listD.RemoveItem(ActiveOID);
                    _filter_results = listD.GetSortedList();
                }
                break;
            }

            _entity = null;
            RefreshSources();
        }
Beispiel #2
0
        /// <summary>
        /// Toma la lista de bancos de la base de datos y rellena la tabla.
        /// </summary>
        protected override void RefreshMainData()
        {
            PgMng.Grow(string.Empty, "ParteAsistencia");

            _selectedOid = ActiveOID;

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

            case EntityMngFormTypeData.ByParameter:
                _sorted_list = List.GetSortedList();
                break;
            }
            PgMng.Grow(string.Empty, "Lista de Partes de Asistencia");
        }
        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;
            }
        }