private async void cmdOk_Clicked(object sender, EventArgs e) { try { gridProgress.IsVisible = true; await Task.Run(async() => { DCEMVDemoServerClient client = SessionSingleton.GenDCEMVServerApiClient(); using (SessionSingleton.HttpClient) { CallBackUrl callbackUrl = await client.ProfileRegisterPostAsync(txtEmail.Text, txtPassword.Text); Device.BeginInvokeOnMainThread(() => { txtEmail.Text = callbackUrl.Url; //ClosePage(); }); } }); } catch (Exception ex) { await App.Current.MainPage.DisplayAlert("Error", ex.Message, "OK"); } finally { gridProgress.IsVisible = false; } }
public async Task <bool> SendReport(int id) { try { var msg = string.Format("فاکتور جدیدی با شماره {0}، ثبت شده است لطفا بررسی نمایید.", id); var result = CallBackUrl.Get <int>("http://www.0098sms.com/sendsmslink.aspx?FROM=30002659262310&TO=09384117217&TEXT=" + msg + "&USERNAME=xsms6427&PASSWORD=92245373&DOMAIN=0098"); Console.WriteLine(result); var bot = await Models.Bot.GetBotClientAsync(); var List = _BotUserService.Get(3); foreach (var item in List) { if (item.ChatId > 0) { bot.SendTextMessageAsync(item.ChatId, msg); } } return(true); } catch (Exception) { return(false); } }