public async void ActualizarNewSms(Esms esms) { var result = await esms.Enviar(); Mensaje = string.Empty; if (result.ErrorCode == "null") { esms.image = SMSImageInfo.ic_check_ok_18pt_3x.ToString(); await _Global.CurrentAccount.MakeTransaction_Manualcharge(esms.monto, "sms a " + esms.NumeroTelefono); } else { esms.image = SMSImageInfo.ic_error_outline_red_18pt_3x.ToString(); } var grupo = ItemsGrouped.First(x => x.First().NumeroTelefono == esms.NumeroTelefono); grupo.Remove(esms); _Global.GrupoSMS.ListaSMS.Remove(esms); esms.isSend = true; _Global.GrupoSMS.ListaSMS.Add(esms); grupo.Add(esms); esms.Ingresar(); ActualizarLista(); }
public async void lblRecuperar_Tapped(object sender, EventArgs e) { if (txtLogin.Text == "" || txtLogin.Text == null) { await DisplayAlert("TeleYuma", "Ingrese el usuario.", "ok"); return; } lblVerPaswword.Text = "Recuperando...."; var Account = await _Global.CurrentAccount.getAccountByLogin(txtLogin.Text); if (Account) { var body = "La clave de su cuenta en TeleYuma es " + _Global.CurrentAccount.password; var smsConfirmacio = new Esms { Mensaje = body, NumeroTelefono = _Global.CurrentAccount.phone1, RemitenteNumero = "TeleYumaApp recupera clave" }; var respuesta = await smsConfirmacio.Enviar(); if (respuesta.ErrorCode is null || respuesta.ErrorCode == "0") { await DisplayAlert("TeleYuma", "El sistema le ha enviado un sms con su clave", "OK"); } else { await DisplayAlert("TeleYuma", "El sistema no pudo recuperar su clave, contácte con el sopórte técnico", "OK"); } }
public async void EnviarExecute(object parameter) { var date = DateTime.Now; var fecha = date.Month + "/" + date.Day + "/" + date.Year; var hora = DateTime.Now.ToString("hh:mm tt").Replace(".", "").ToUpper(); var id = 1; try { id = _Global.GrupoSMS.sms.Id; } catch { } var newSms = new Esms { Id = id + 1, Fecha = fecha, Hora = hora, // IsNew = false, isSend = false, Firma = "", NumeroTelefono = _Global.GrupoSMS.numero, NombreContacto = _Global.GrupoSMS.nombreContacto, monto = monto, Mensaje = Mensaje, i_account = _Global.CurrentAccount.i_account, Phone1 = _Global.CurrentAccount.phone1, Token = "AFAfytf56AR56AY67T76g67guysdf67", ItemHeight = ItemHeight }; newsms = newSms; if (newSms.monto > _Global.CurrentAccount.balance) { CurrentPage.DisplayAlert("TeleYuma", "No tiene sufuciente balance para mandar este mensaje", "ok"); return; } _Global.GrupoSMS.ListaSMS.Add(newSms); ActualizarNewSms(newSms); try { ItemsGrouped.First(x => x.First().NumeroTelefono == newsms.NumeroTelefono).Add(newsms); } catch { ActualizarLista(); } ListView.ScrollTo(newSms, ScrollToPosition.MakeVisible, false); Mensaje = string.Empty; }
public async void ActualizarNewSms(Esms esms) { var result = await esms.Enviar(); Mensaje = string.Empty; if (result.ErrorCode is null || result.ErrorCode == "0") { esms.image = SMSImageInfo.ic_check_ok_18pt_3x.ToString(); await _Global.CurrentAccount.MakeTransaction_Manualcharge(esms.monto, "sms a " + esms.NumeroTelefono); }
public async Task <MessageResponse> SendSms() { codigo_verificacion = _Global.CodigoVerificacion; var telefono = _Global.CurrentAccount.phone1; var body = "TeleYuma,Para comprobar que es el propetario del telefono que esta registrando ingrese los siguientes digitos:" + codigo_verificacion; var smsConfirmacio = new Esms { Mensaje = body, NumeroTelefono = telefono, RemitenteNumero = "TeleYumaApp verificar telefono" }; return(await smsConfirmacio.Enviar()); }
public void SetNotification(Esms sms) { Intent notiIntent = new Intent(MainActivity.CurrentContext, typeof(MainActivity)); notiIntent.PutExtra("sms", "1"); PendingIntent pendingIntent = PendingIntent.GetActivity(MainActivity.CurrentContext, 0, notiIntent, PendingIntentFlags.UpdateCurrent); NotificationCompat.Builder notification = new NotificationCompat.Builder(MainActivity.CurrentContext, MainActivity.CHANNEL_ID) .SetContentTitle("Service") .SetContentIntent(pendingIntent) .SetAutoCancel(true) .SetContentText("El servicio de notificaciones está ejecutandose.") .SetSmallIcon(Resource.Drawable.ic_announcement_black_48dp); // Get the notification manager: NotificationManager notificationManager = MainActivity.CurrentContext.GetSystemService(Context.NotificationService) as NotificationManager; // Publish the notification: notificationManager.Notify(sms.Id, notification.Build()); }
public async void IMG_ENVIAR_Tapped(object sender, EventArgs e) { if (txtPais.Text == "" || txtPais.Text == null) { await DisplayAlert("TeleYuma", "Seleccione el País", "OK"); return; } if (txtTelefono.Text == "" || txtTelefono.Text == null) { await DisplayAlert("TeleYuma", "Seleccione el Télefono", "OK"); return; } if (txtSms.Text == "" || txtSms.Text == null) { await DisplayAlert("TeleYuma", "Ingrese el mensaje que desea enviar", "OK"); return; } if (_Global.CurrentAccount.balance < Convert.ToDecimal(monto)) { await DisplayAlert("TeleYuma", "No tiene saldo en la cuenta para mandar el mensaje", "OK"); await this.Navigation.PopAsync(); return; } numero = _Global.PaisSeleccionado.PrefijoTelefonico + txtTelefono.Text; var date = DateTime.Now; var fecha = date.Month + "/" + date.Day + "/" + date.Year; var hora = DateTime.Now.ToString("hh:mm tt").Replace(".", "").ToUpper(); var id = 0; if (_Global.GrupoSMS.ListaSMS.Count > 0) { id = _Global.GrupoSMS.sms.Id; } var newSms = new Esms { Id = id + 1, Fecha = fecha, Hora = hora, Firma = "", NumeroTelefono = numero, RemitenteNumero = "", PrefijoPais = _Global.PaisSeleccionado.PrefijoTelefonico, isSend = false, monto = monto, Mensaje = txtSms.Text, i_account = _Global.CurrentAccount.i_account, Phone1 = _Global.CurrentAccount.phone1, Token = "AFAfytf56AR56AY67T76g67guysdf67", ItemHeight = ItemHeight }; _Global.GrupoSMS.ListaSMS.Add(newSms); //newSms.Enviar(); //_Global.Post<Esms>("sms", newSms); var contGrupos = 0; try { _Global.GrupoSMS = _Global.GruposDeListasSMS.First(x => x.numero == numero); contGrupos = _Global.GruposDeListasSMS.Where(x => x.numero == numero).ToList().Count; } catch (Exception) { } var pages = Navigation.NavigationStack.ToList(); if (contGrupos > 0) { try { //Quitar NewSMS del navegation foreach (var page in pages) { if (page.GetType() == typeof(SMS.NewSMS)) { Navigation.RemovePage(page); } } _Global.GrupoSMS.ListaSMS.Add(newSms); await this.Navigation.PushAsync(_Global.Vistas.EnviarSMS); _Global.VM.VMMensaje.ActualizarLista(); } catch (Exception) { } } else { try { _Global.GrupoSMS = new GrupoSMS { numero = numero, ListaSMS = new List <Esms>() }; _Global.GrupoSMS.ListaSMS.Add(newSms); //Quitar NewSMS del navegation foreach (var page in pages) { if (page.GetType() == typeof(SMS.NewSMS)) { Navigation.RemovePage(page); } } await this.Navigation.PushAsync(_Global.Vistas.EnviarSMS); _Global.VM.VMMensaje.ActualizarLista(); } catch (Exception ex) { ; } } _Global.VM.VMMensaje.ActualizarNewSms(newSms); return; }