Esempio n. 1
0
        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);
                }
            }
        }
Esempio n. 2
0
        private void AgregarMarcadoresCentros()
        {
            CentroInformacion centros = new CentroInformacion();

            seguroPopularMapView.Delegate = new MapDelegate(this, 2);
            foreach (CentroAfiliacion centro in centros.GetAllCentrosAfiliacion())
            {
                seguroPopularMapView.AddAnnotations(new MKPointAnnotation()
                {
                    Title      = centro.Nombre,
                    Coordinate = new CLLocationCoordinate2D(Double.Parse(centro.Latitud), Double.Parse(centro.Longitud)),
                    Subtitle   = centro.Horario
                });
            }
        }
Esempio n. 3
0
        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();
            };
        }