private async void BtnUpdateEmail_Click(string Message)
        {
            try
            {
                txtmail.SetTextColor(Color.Black);

                if (txtmail.Text == null || txtmail.Text == "")
                {
                    TxtScanresult.SetTextColor(Android.Graphics.Color.Red);
                    TxtScanresult.Text = "Please enter your email.";
                }
                else if (txtmail.Text.Contains("@") != true && txtmail.Text.Contains(".") != true)
                {
                    TxtScanresult.SetTextColor(Android.Graphics.Color.Red);
                    TxtScanresult.Text = "Please enter valid email.";
                }
                else
                {
                    AndHUD.Shared.Show(this, "Updating...Please Wait...", Convert.ToInt32(MaskType.Clear));
                    AuthServ = await svc.UpdateMail(txtmail.Text, AuthServ.customer.CustomerID.ToString());

                    ShowInfo(AuthServ);
                    AndHUD.Shared.Dismiss();
                }
            }
            catch (Exception ex)
            {
            }
        }
Exemple #2
0
        private void BtnUpdateEmail_Click(string Message)
        {
            try
            {
                AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                LoggingClass.LogInfo("Entered Incorrect Details", screenid);
                aler.SetTitle(Message);

                EditText txtEmail = new EditText(this);
                txtEmail.SetTextColor(Color.Black);
                txtEmail.FocusableInTouchMode = true;
                aler.SetView(txtEmail);
                aler.SetPositiveButton("Update", async delegate
                {
                    int count = 0;
                    if (count == 0)
                    {
                        if (txtEmail.Text == null && txtEmail.Text == "")
                        {
                            //BTProgressHUD.ShowErrorWithStatus("Email is invalid",3000);
                            BtnUpdateEmail_Click("Entered email id is invalid,Please enter again");
                        }
                        else if (txtEmail.Text.Contains("@") != true && txtEmail.Text.Contains(".") != true)
                        {
                            BtnUpdateEmail_Click("Entered email id is invalid,Please enter again");
                        }
                        else
                        {
                            AndHUD.Shared.Show(this, "Updating...Please Wait...", Convert.ToInt32(MaskType.Clear));
                            //BTProgressHUD.ShowSuccessWithStatus("We're sending mail to the updated mail");
                            //CurrentUser.PutEmail(txtEmail.Text);
                            AuthServ = await svc.UpdateMail(txtEmail.Text, AuthServ.customer.CustomerID.ToString());
                            ShowInfo(AuthServ);
                            AndHUD.Shared.Dismiss();

                            //AndHUD.Shared.ShowSuccess(Parent, "Updated!", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                    }
                    count = 1;
                });

                aler.SetNegativeButton("Cancel", (senderAlert, args) =>
                {
                    int cou = 0;
                    if (cou == 0)
                    {
                        Toast.MakeText(this, "Cancelled!", ToastLength.Short).Show();
                    }
                    cou = 1;
                });

                Dialog dialog = aler.Create();
                dialog.Show();
            }
            catch (Exception ex) { }
        }