Example #1
0
		public void UpdateEmail(string Message)
		{
			string Email;
			BTProgressHUD.Dismiss();
			UIAlertView alert = new UIAlertView()
			{
				Title = Message,
				//Message = Message
			};
			alert.AlertViewStyle = UIAlertViewStyle.PlainTextInput;
			alert.GetTextField(0).Placeholder = "*****@*****.**";
			alert.AddButton("Cancel");
			alert.AddButton("Update");
			alert.Clicked += async (senderalert, buttonArgs) =>
			{
				
				if (buttonArgs.ButtonIndex == 1)
				{
					
					Email = alert.GetTextField(0).Text;
					if (Email == null && Email == "")
					{
						//BTProgressHUD.ShowErrorWithStatus("Email is invalid",3000);
						UpdateEmail("Entered email id is invalid,Please enter again");
					}
					else if (Email.Contains("@") != true && Email.Contains(".") != true)
					{
                        UpdateEmail("Entered email id is invalid,Please enter again");
					}
					else
					{
						//BTProgressHUD.ShowSuccessWithStatus("We're sending mail to the updated mail");
						BtnTest1.Hidden = true;
						BtnTest2.Hidden = true;
						CurrentUser.PutEmail(Email);
						if (emailnotpresent)
						{
							if (screenheight <= 568)
							{
								y = y - 80;
							}
						}
						cr=await svc.UpdateMail(alert.GetTextField(0).Text, CurrentUser.GetId());
						LoggingClass.LogInfo(CurrentUser.GetCardNumber() + " Updated mail id to" + Email, screenid);
						BTProgressHUD.Show(LoggingClass.txtpleasewait);
						//Console.WriteLine(y);
						ShowInfo(cr, false);
					}

					//Console.WriteLine(updatedEmail);
					//Update service;
					//alert.CancelButtonIndex = 0;
				}
			} ;
			//alert.DismissWithClickedButtonIndex(0, true);
			//alert.AlertViewStyle = UIAlertViewStyle.PlainTextInput;
			alert.Show();
		}