public override void CalloutAccessoryControlTapped(MKMapView mapView, MKAnnotationView view, UIControl control) { CentroInformacion centros = new CentroInformacion(); if (opcion == 1) { var resultados = centros.GetAllUnidadesSalud().Where(unidad => unidad.Nombre == view.Annotation.GetTitle() && unidad.Latitud == view.Annotation.Coordinate.Latitude.ToString() && unidad.Longitud == view.Annotation.Coordinate.Longitude.ToString()); DetallesUnidadViewController detailUnidad = parent.Storyboard.InstantiateViewController("detallesUnidad") as DetallesUnidadViewController; if (detailUnidad != null) { detailUnidad.unidadSelected = resultados.ElementAt(0); parent.NavigationController.ShowViewController(detailUnidad, parent); } } else if (opcion == 2) { var resultados = centros.GetAllCentrosAfiliacion().Where(centro => centro.Nombre == view.Annotation.GetTitle() && centro.Latitud == view.Annotation.Coordinate.Latitude.ToString() && centro.Longitud == view.Annotation.Coordinate.Longitude.ToString()); DetallesCentroViewController detailCentro = parent.Storyboard.InstantiateViewController("detallesCentro") as DetallesCentroViewController; if (detailCentro != null) { detailCentro.centroSelected = resultados.ElementAt(0); parent.NavigationController.ShowViewController(detailCentro, parent); } } }
void tapUnidadSalud() { CentroInformacion centros = new CentroInformacion(); var resultados = centros.GetAllUnidadesSalud().Where(unidad => unidad.Clues == clues); DetallesUnidadViewController detailUnidad = this.Storyboard.InstantiateViewController("detallesUnidad") as DetallesUnidadViewController; if (detailUnidad != null) { detailUnidad.unidadSelected = resultados.ElementAt(0); this.NavigationController.ShowViewController(detailUnidad, this); } }
private void AgregarMarcadoresUnidades() { CentroInformacion centros = new CentroInformacion(); seguroPopularMapView.Delegate = new MapDelegate(this, 1); foreach (UnidadSalud unidad in centros.GetAllUnidadesSalud()) { seguroPopularMapView.AddAnnotations(new MKPointAnnotation() { Title = unidad.Nombre, Coordinate = new CLLocationCoordinate2D(Double.Parse(unidad.Latitud), Double.Parse(unidad.Longitud)), Subtitle = unidad.Unidad }); } }
public override void ViewDidLoad() { CentroInformacion informacion = new CentroInformacion(); if (opcionSelected == 1) { listUnidades = informacion.GetAllUnidadesSalud(); searchItemsUnidades = listUnidades; } else if (opcionSelected == 2) { listCentros = informacion.GetAllCentrosAfiliacion(); searchItemsCentros = listCentros; } centrosSearchView.SizeToFit(); centrosSearchView.AutocorrectionType = UITextAutocorrectionType.No; centrosSearchView.AutocapitalizationType = UITextAutocapitalizationType.None; centrosSearchView.TextChanged += (sender, e) => { //this is the method that is called when the user searches searchTable(); }; }