protected new SortedBindingList <Pregunta> Localize(FilterItem item) { SortedBindingList <Pregunta> list = null; Preguntas 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(); AddFilterItem(item); return(list); }
protected new SortedBindingList <Pregunta> Localize(object value, string column_name) { SortedBindingList <Pregunta> list = null; Preguntas sourceList = null; switch (FilterType) { case IFilterType.None: if (List == null) { MessageBox.Show(moleQule.Face.Resources.Messages.NO_RESULTS); return(null); } sourceList = List; //_filter_values = string.Empty; 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(Resources.Messages.NO_RESULTS); return(sourceList.GetSortedList()); } DatosSearch.DataSource = list; DatosSearch.MoveFirst(); AddFilterItem(column_name, value); Tabla.Focus(); return(list); }