public async void EmailVerification()
		{
			try
			{
				DeviceToken Dt = new DeviceToken();
				if (CurrentUser.GetId() != null)
				{
					Dt = await svc.VerifyMail(CurrentUser.GetId());
				}
				if (Dt.VerificationStatus == 1)
				{
					CurrentUser.Store(cr.customer.CustomerID.ToString(), cr.customer.FirstName + cr.customer.LastName);
					CurrentUser.PutStore(cr.customer.PreferredStore);
					if (RootTabs == null || _window == null)
					{
						RootTabs = CurrentUser.RootTabs;
						_window = CurrentUser.window;
						nav = new UINavigationController(RootTabs);
						AddNavigationButtons(nav);
						_window.RootViewController = nav;
						LoggingClass.LogInfo("The User logged in with user id: " + CurrentUser.RetreiveUserId(), screenid);
					}
					else
					{
						nav = new UINavigationController(RootTabs);
						AddNavigationButtons(nav);
						_window.RootViewController = nav;
						LoggingClass.LogInfo("The User logged in with user id: " + CurrentUser.RetreiveUserId(), screenid);
					}
					BTProgressHUD.Dismiss();
				}
				else
				{
					try
					{
						BTProgressHUD.ShowErrorWithStatus("Your email is not verified plesase check email and verify.", 5000);
						View.AddSubview(btnResend);
					}
					catch (Exception ex)
					{
						LoggingClass.LogError(ex.Message, screenid, ex.StackTrace);
					}
				}
			}
			catch (Exception Exe)
			{
				LoggingClass.LogError(Exe.Message, screenid, Exe.StackTrace);
			}
		}
Beispiel #2
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();
		}
Beispiel #3
0
		public async void EmailVerification(Boolean start)
		{
			try
			{
				DeviceToken Dt = new DeviceToken();
				if (CurrentUser.GetId() != null)
				{
					Dt = await svc.VerifyMail(CurrentUser.GetId());
					try
					{
						if (cr.customer == null)
						{
							cr = await svc.GetCustomerDetails(Convert.ToInt32(CurrentUser.GetId()));
						}
					}
					catch (Exception exe)
					{
						//LoggingClass.LogError(exe.Message, screenid, exe.StackTrace);
					}
				}
				if (Dt.VerificationStatus == 1)
				{
					CurrentUser.Store(cr.customer.CustomerID.ToString(), cr.customer.FirstName + cr.customer.LastName);
					CurrentUser.PutStore(cr.customer.PreferredStore);
					if (RootTabs == null || _window == null)
					{
						RootTabs = CurrentUser.RootTabs;
						_window = CurrentUser.window;
						nav = new UINavigationController(RootTabs);
						AddNavigationButtons(nav);
						_window.RootViewController = nav;
						LoggingClass.LogInfo("The User logged in with user id: " + CurrentUser.RetreiveUserId(), screenid);
					}
					else
					{
						nav = new UINavigationController(RootTabs);
						AddNavigationButtons(nav);
						_window.RootViewController = nav;
						LoggingClass.LogInfo("The User logged in with user id: " + CurrentUser.RetreiveUserId(), screenid);
					}
					BTProgressHUD.Dismiss();
				}
				else
				{
					if (start == false)
					{
						try
						{
							BTProgressHUD.ShowErrorWithStatus("Your email is not verified plesase check email and verify.", 5000);
							View.AddSubview(btnResend);
						}
						catch (Exception ex)
						{
							//LoggingClass.LogError(ex.Message, screenid, ex.StackTrace);
						}
					}
				}
			}
			catch (Exception Exe)
			{
					//UIAlertView alert = new UIAlertView()
					//{
					//Title = Exe.Message+"\n"+Exe.StackTrace,
					//	//Message = "Coming Soon..."
					//};

					//alert.AddButton("OK");
					//alert.Show();
				LoggingClass.LogError(Exe.Message, screenid, Exe.StackTrace);
			}
		}