Exemple #1
0
        private void TextBusquedaClientes_TextChanged(object sender, Android.Text.TextChangedEventArgs e)
        {
            var auxclientes = clientes.Where(x => x.NombreCompleto.ToUpper().Contains(textBusquedaClientes.Text.ToUpper())).ToList();

            var data = new ListItemCollection <ListItemValueCliente>();

            foreach (var cli in auxclientes)
            {
                data.Add(new ListItemValueCliente(cli));
            }

            var sortedData = data.GetSortedData();

            adapterClientes = CrearAdapter(sortedData);
            adapterClientes.NotifyDataSetChanged();
            listViewClientes.Adapter = adapterClientes;
        }
        private void TextBusquedaHospedaje_TextChanged(object sender, Android.Text.TextChangedEventArgs e)
        {
            var aux = hospedajes.Where(x => x.Nombre.ToUpper().Contains(textBusquedaHospedaje.Text.ToUpper())).ToList();

            var data = new ListItemCollection <ListItemValueHospedaje>();

            foreach (var cli in aux)
            {
                data.Add(new ListItemValueHospedaje(cli));
            }

            var sortedData = data.GetSortedData();

            adapterHospedajes          = CrearAdapter(sortedData);
            listViewHospedajes.Adapter = adapterHospedajes;
            adapterHospedajes.NotifyDataSetChanged();
        }
Exemple #3
0
 protected override void OnActivityResult(int requestCode, [GeneratedEnum] Result resultCode, Intent data)
 {
     base.OnActivityResult(requestCode, resultCode, data);
     if (resultCode == Result.Ok)
     {
         bool     guardado   = data.GetBooleanExtra("Guardado", false);
         MCliente clienteAux = JsonConvert.DeserializeObject <MCliente>(data.GetStringExtra("cliente"));
         if (guardado)
         {
             var db = new SQLite.SQLiteConnection(sqlPath);
             clientes = db.Table <MCliente>().OrderBy(x => x.Nombre).ToList();
             var dataAux = new ListItemCollection <ListItemValueCliente>();
             foreach (var cli in clientes)
             {
                 dataAux.Add(new ListItemValueCliente(cli));
             }
             var sortedData = dataAux.GetSortedData();
             adapterClientes = CrearAdapter(sortedData);
             adapterClientes.NotifyDataSetChanged();
             listViewClientes.Adapter  = adapterClientes;
             textBusquedaClientes.Text = clienteAux.NombreCompleto;
         }
     }
 }