private async void SendOTPButton_Click(object sender, EventArgs e) { message.Text = ""; Validations validation = new Validations(); MessageDialog messageDialog = new MessageDialog(); messageDialog.ShowLoading(); if (!validation.IsValidEmail(username.Text.Trim())) { message.Text = "Please enter username to send one time pin"; messageDialog.HideLoading(); return; } int pin = Convert.ToInt32(GetRandomNumber(5)); await ViewModel.SetOPTForUsersync(username.Text.Trim(), pin); if (ViewModel.Respond.ErrorOccurred) { message.Text = ViewModel.Respond.Error.Message; changePasswordButton.Visibility = ViewStates.Gone; } else { messageDialog.SendToast("One time pin is sent successfully."); changePasswordButton.Visibility = ViewStates.Visible; string smsMessase = string.Format("Send Me: Confirmation OTP:{0}. Change password", pin); messageDialog.SendSMS(ViewModel.Respond.User.Courier.MobileNumber.Trim(), smsMessase); } messageDialog.HideLoading(); }
private void ItemClick(object sender, AdapterView.ItemClickEventArgs e) { var quote = quotesViewModel.Quotes[e.Position]; AlertDialog.Builder builder = new AlertDialog.Builder(this); // 2. Chain together various setter methods to set the dialog characteristics builder.SetMessage("Please note that the quote might change base on courier rates.") .SetTitle("Contact Me") .SetPositiveButton("Call Me", delegate { var request = Request; string smstext = string.Format("Send Me: Hi {0}, {1} would like you to contact him/her regarding your courier service.Request Details : Pick Up Location - {2}. Drop Location - {3}. Contact Person - {4}. Email - {5}. Mobile Number - {6}", quote.CourierName, request.Name, request.FromLocation.Description, request.Tolocation.Description, request.Name, request.Email, Request.MobileNumber); MessageDialog messageDialog = new MessageDialog(); messageDialog.SendSMS(quote.CourierMobileNumber, smstext); }).SetNegativeButton("Not Now", delegate { }); // 3. Get the AlertDialog from create() AlertDialog dialog = builder.Create(); dialog.Show(); }
void SendSMSButton_Click(object sender, EventArgs e) { if (!ValidateForm()) { return; } MessageDialog messageDialog = new MessageDialog(); messageDialog.SendSMS(message.Text.Trim()); //messageDialog.SendEmail(message.Text.Trim()); message.Text = ""; }