public ParteAsistenciaSelectForm(Form parent, ParteAsistenciaList list) : base(true, parent, list) { InitializeComponent(); _view_mode = molView.Select; DialogResult = DialogResult.Cancel; }
protected new SortedBindingList <ParteAsistenciaInfo> Localize(FilterItem item) { SortedBindingList <ParteAsistenciaInfo> list = null; ParteAsistenciaList sourceList = null; switch (FilterType) { case IFilterType.None: if (List == null) { MessageBox.Show(Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = List; break; case IFilterType.Filter: if (FilteredList == null) { MessageBox.Show(Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = FilteredList; break; default: sourceList = List; break; } if (item.FilterProperty == IFilterProperty.All) { FCriteria criteria = GetCriteria(string.Empty, item.Value, null, item.Operation); list = sourceList.GetSortedSubList(criteria, _properties_list); } else { FCriteria criteria = GetCriteria(item.Column, item.Value, null, item.Operation); list = sourceList.GetSortedSubList(criteria, _properties_list); } if (list.Count == 0) { MessageBox.Show(Face.Resources.Messages.NO_RESULTS); return(sourceList.GetSortedList()); } DatosSearch.DataSource = list; DatosSearch.MoveFirst(); AddFilterLabel(item); return(list); }
public ParteAsistenciaMngForm(bool isModal, Form parent, ParteAsistenciaList list) : base(isModal, parent, list) { InitializeComponent(); SetView(molView.Normal); _sort_property = Fecha.Name; // 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 = ParteAsistenciaList.NewList().GetSortedList(); base.SortProperty = Fecha.DataPropertyName; }
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(); }
/// <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; } }