public void OnPopupUnitsCallbackVarios(object sender, EventArgs e) { try { var x = sender as PopupVarios; var iva = x.iva; if (iva != null) { txtTantoPorcierto.Text = iva.Porcentaje.ToString(); RepositorySatApp database = new RepositorySatApp(); var nuevoIva = database.ObtenerRecargoIva(iva.Codigo); nuevaLinea.Recargo = nuevoIva.Recargo; nuevaLinea.Iva = iva.Porcentaje; database.CerrarConexion(); } else { Application.Current.MainPage.DisplayAlert("Aviso", "Forma de Pago incorrecta.", "OK"); } } catch (Exception ex) { Application.Current.MainPage.DisplayAlert("Aviso ", ex.Message, " OK"); } }