public async void SearchClient2(string text) { if (text != "" && text != null) { var a = listlocationAux.Where(p => p.Titulo.ToLower().Contains(text.ToLower())).ToList(); Debug.WriteLine(a.Count()); if (a != null) { ListLocation.Clear(); Debug.WriteLine(a.Count()); foreach (var item in a) { ListLocation.Add(item); } } } else { foreach (var item in listlocationAux) { ListLocation.Add(item); } } }
public BindableCollection <Location> Get_AllLocation() { ListLocation.Clear(); sql = $"SELECT * FROM DIADIEM"; DataTable dt = Connection.GetALL_Data(sql); foreach (DataRow row in dt.Rows) { Location location = new Location(); location.LocationID = row["MADD"].ToString(); location.TripID = row["MACD"].ToString(); location.Number = row["STT"].ToString(); location.LocationName = row["TENDD"].ToString(); ListLocation.Add(location); } return(ListLocation); }
public async void LoadClientes() { try { var clientes = await apiService.GetMyClient(); Locations = new ObservableCollection <TKCustomMapPin>(); LocationsSearch.Clear(); ListLocation.Clear(); clientes.Count(); if (clientes != null && clientes.Count > 0) { Point p = new Point(0.48, 0.96); foreach (var cliente in clientes) { var Pincliente = new TKCustomMapPin { Image = "pin.png", Position = new Xamarin.Forms.Maps.Position(cliente.Latitud, cliente.Longitud), Anchor = p, Title = "Razón Social: " + cliente.RazonSocial, Subtitle = "Dirección: " + cliente.Direccion, ShowCallout = true, }; var itemcliente = new ListRequest { Titulo = "Razón Social: " + cliente.RazonSocial, Subtitulo = cliente.Direccion + " " + cliente.Telefono, idCliente = cliente.IdCliente, }; Locations.Add(Pincliente); ListLocation.Add(itemcliente); listlocationAux.Add(itemcliente); } } } catch (Exception ex) { Debug.WriteLine(ex.Message); } }
public async void LoadClientes() { try { var clientes = await apiService.GetAllClients(); Locations.Clear(); ListLocation.Clear(); clientes.Count(); if (clientes != null && clientes.Count > 0) { foreach (var cliente in clientes) { var Pincliente = new TKCustomMapPin { Image = "pin.png", Position = new Xamarin.Forms.Maps.Position(cliente.Lat, cliente.Lon), Title = cliente.Nombre, Subtitle = "Dirección: " + cliente.Direccion, ShowCallout = true, }; var itemcliente = new ListRequest { Titulo = cliente.Nombre, Subtitulo = cliente.PersonaContacto + " " + cliente.Telefono, }; Locations.Add(Pincliente); ListLocation.Add(itemcliente); } } } catch { } }