public detallePage(Models.mFugitivos fugitivo) { InitializeComponent(); Fugitivo = fugitivo; Title = Fugitivo.Name; img.Source = ImageSource.FromFile(Fugitivo.Photo); }
public mapPage(Models.mFugitivos fugitivo) { try { double lat = Convert.ToDouble(fugitivo.Lat); double lon = Convert.ToDouble(fugitivo.Lon); Position pos = new Position(lat, lon); MapSpan span = MapSpan.FromCenterAndRadius(pos, Distance.FromKilometers(3)); CustomMap capturadosMap = new CustomMap(span); capturadosMap.MapType = MapType.Street; capturadosMap.IsShowingUser = false; Pin pin = new Pin(); pin.Type = PinType.Place; pin.Position = pos; pin.Label = fugitivo.Name; capturadosMap.Circle = new MapCircle { Position = pos, Radius = 100 }; capturadosMap.Pins.Add(pin); StackLayout verticalStackLayout = new StackLayout { Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.FillAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; verticalStackLayout.Children.Add(capturadosMap); Content = verticalStackLayout; } catch (Exception ex) { throw ex; } }
public async void bagregar_Clicked(object sender, EventArgs e) { Extras.databaseManager db = new Extras.databaseManager(); Models.mFugitivos fugitivos = new Models.mFugitivos(); fugitivos.Name = enewname.Text; fugitivos.Capturado = false; int result = db.insertItem(fugitivos); if (result == 1) { await DisplayAlert("Agregado", "Se ha agregado el fugitivo a la base de datos", "Aceptar"); MessagingCenter.Send <Page>(this, "Update"); await Navigation.PopAsync(); } db.closeConnection(); }
public int updateItem(Models.mFugitivos item) { int result = db.Update(item); return(result); }
public int insertItem(Models.mFugitivos item) { int result = db.Insert(item); return(result); }
public void listItemTapped_Tapped(object sender, ItemTappedEventArgs args) { Models.mFugitivos fugitivo = (Models.mFugitivos)args.Item; Navigation.PushAsync(new Views.detallePage(fugitivo)); }
public capturarPage(Models.mFugitivos fugitivo) { Fugitivo.Name = fugitivo.Name; Fugitivo.ID = fugitivo.ID; fugitivoSuelto = new Label { Text = "El fugitivo sigue suelto...", FontSize = 20, HorizontalOptions = LayoutOptions.Center }; bcapturar = new Button { Text = "Capturar", WidthRequest = 200, BorderColor = Color.Black, BorderWidth = 1, HorizontalOptions = LayoutOptions.Center }; beliminar = new Button { Text = "Eliminar", WidthRequest = 200, BorderColor = Color.Black, BorderWidth = 1, HorizontalOptions = LayoutOptions.Center }; imageContainer = new StackLayout { Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.Center, WidthRequest = 100, HeightRequest = 100, BackgroundColor = Color.Gray }; img = new Image { Aspect = Aspect.AspectFill, WidthRequest = 100, HeightRequest = 100 }; bfoto = new Button { Text = "Tomar foto", HorizontalOptions = LayoutOptions.Center, WidthRequest = 200 }; verticalStackLayout = new StackLayout { Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; bcapturar.Clicked += Bcapturar_Clicked; beliminar.Clicked += Beliminar_Clicked; bfoto.Clicked += Bfoto_Clicked; Title = this.Fugitivo.Name; imageContainer.Children.Add(img); verticalStackLayout.Children.Add(fugitivoSuelto); verticalStackLayout.Children.Add(imageContainer); verticalStackLayout.Children.Add(bfoto); verticalStackLayout.Children.Add(bcapturar); verticalStackLayout.Children.Add(beliminar); Content = verticalStackLayout; }
public capturarPage(Models.mFugitivos fugitivo) { Fugitivo.Name = fugitivo.Name; Fugitivo.ID = fugitivo.ID; fugitivoSuelto = new Label { Text = "El fugitivo sigue suelto .....", FontSize = 20, HorizontalOptions = LayoutOptions.Center }; bcapturar = new Button { Text = "CAPTURAR", WidthRequest = 200, BorderColor = Color.Black, BorderWidth = 1, HorizontalOptions = LayoutOptions.Center, IsEnabled = false }; beliminar = new Button { Text = "ELIMINAR", WidthRequest = 200, BorderColor = Color.Black, BorderWidth = 1, HorizontalOptions = LayoutOptions.Center }; imageContainer1 = new StackLayout { Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.Center, WidthRequest = 100, HeightRequest = 100, BackgroundColor = Color.Gray }; imageContainer2 = new StackLayout { Orientation = StackOrientation.Vertical, HorizontalOptions = LayoutOptions.Center, WidthRequest = 100, HeightRequest = 100, BackgroundColor = Color.White }; img = new Image { Aspect = Aspect.Fill, WidthRequest = 100, HeightRequest = 100, //Source = "http://loremflickr.com/600/600/nature?filename=simple.jpg" }; cImg = new CachedImage() { HorizontalOptions = LayoutOptions.Center, VerticalOptions = LayoutOptions.Center, WidthRequest = 300, HeightRequest = 300, CacheDuration = TimeSpan.FromDays(30), DownsampleToViewSize = true, Source = "http://loremflickr.com/600/600/nature?filename=simple.jpg" }; bfoto = new Button { Text = "Tomar Foto", HorizontalOptions = LayoutOptions.Center, WidthRequest = 200 }; verticalStackLayout = new StackLayout { Orientation = StackOrientation.Vertical, VerticalOptions = LayoutOptions.CenterAndExpand, HorizontalOptions = LayoutOptions.FillAndExpand }; bcapturar.Clicked += Bcapturar_Clicked; beliminar.Clicked += Beliminar_Clicked; bfoto.Clicked += Bfoto_Clicked; Title = Fugitivo.Name; imageContainer1.Children.Add(img); imageContainer2.Children.Add(cImg); verticalStackLayout.Children.Add(fugitivoSuelto); verticalStackLayout.Children.Add(imageContainer1); //verticalStackLayout.Children.Add(imageContainer2); verticalStackLayout.Children.Add(bfoto); verticalStackLayout.Children.Add(bcapturar); verticalStackLayout.Children.Add(beliminar); Content = verticalStackLayout; }