Beispiel #1
0
 public static void Ordenar(TipoObjeto typeObject, ref IList collection, TipoOrden sortType,
                            string property)
 {
     if (typeObject == TipoObjeto.CentroCosto)
     {
         List <CentroCosto> list = (List <CentroCosto>)collection;
         GenericEntityAction <CentroCosto> .Sort(ref list, sortType, property);
     }
 }
Beispiel #2
0
        protected override void OnSortAction()
        {
            KeyValuePair <string, string> value = ((KeyValuePair <string, string>)cboLista.SelectedItem);
            TipoOrden sortType = rbAsc.Checked ? TipoOrden.Ascendente : TipoOrden.Descendente;
            var       list     = (List <Persona>) this.Source;

            GenericEntityAction <Persona> .Sort(ref list, sortType, value.Key);

            this.Source           = list;
            dgvListado.DataSource = null;
            dgvListado.DataSource = this.Source;
        }
Beispiel #3
0
        public static void Sort(ref List <T> collection, TipoOrden sortType,
                                string property)
        {
            if (!string.IsNullOrEmpty(property) && collection != null &&
                collection.Count > 0)
            {
                Type t = collection[0].GetType();

                if (sortType == TipoOrden.Ascendente)
                {
                    collection = collection.OrderBy(a => t.InvokeMember(property,
                                                                        BindingFlags.GetProperty, null, a, null)).ToList();
                }
                else
                {
                    collection = collection.OrderByDescending(a => t.InvokeMember(property,
                                                                                  BindingFlags.GetProperty, null, a, null)).ToList();
                }
            }
        }
Beispiel #4
0
 private void limpiarTipoOrden(object sender, RoutedEventArgs e)
 {
     TipoOrden.Clear();
 }
Beispiel #5
0
 public CamposOrden(string campo, TipoOrden tipoOrden)
 {
     this.campo     = campo;
     this.tipoOrden = tipoOrden;
 }
Beispiel #6
0
 private void TipoOrdenLabel_OnTapped(object sender, EventArgs e)
 {
     TipoOrden.Focus();
 }