public async void EmailVerification()
        {
            DeviceToken DO = new DeviceToken();

            try
            {
                DO = await sc.CheckMail(CurrentUser.getUserId());
            }
            catch (Exception exe)
            {
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
            }
            if (DO.VerificationStatus == 1)
            {
                Intent intent = new Intent(this, typeof(TabActivity));
                StartActivity(intent);
            }
            else
            {
                AlertDialog.Builder alert = new AlertDialog.Builder(this);
                alert.SetTitle("Sorry");
                alert.SetMessage("Please verify your mail id");
                alert.SetNegativeButton("Ok", delegate { });
                Dialog dialog = alert.Create();
                dialog.Show();
            }
        }
        public async void EmailVerification(Boolean Load)
        {
            if (Load == true)
            {
                AndHUD.Shared.Show(this, "Checking Email Verification", Convert.ToInt32(MaskType.Clear));
            }
            DeviceToken DO = new DeviceToken();

            try
            {
                //  DO = await svc.CheckMail(AuthServ.customer.CustomerID.ToString());
                DO = await svc.CheckMail(CurrentUser.GetInternalCustometID());

                if (DO.VerificationStatus == 1)
                {
                    //  if (AuthServ.customer != null && AuthServ.customer.CustomerID != 0)
                    if (CurrentUser.GetInternalCustometID() != null && Convert.ToInt32(CurrentUser.GetInternalCustometID()) != 0)
                    {
                        // LoggingClass.LogInfo("The User logged in with user id: " + CurrentUser.getUserId(), screenid);

                        SendRegistrationToAppServer(CurrentUser.getDeviceToken());
                        // CurrentUser.SavePrefered(AuthServ.customer.PreferredStore);
                        int storename = Convert.ToInt32(CurrentUser.GetPrefered());///AuthServ.customer.PreferredStore;
                        if (storename == 1)
                        {
                            Intent intent = new Intent(this, typeof(GridViewActivity));
                            intent.PutExtra("MyData", "Wall Store");
                            ProgressIndicator.Show(this);

                            StartActivity(intent);
                        }
                        else if (storename == 2)
                        {
                            Intent intent = new Intent(this, typeof(GridViewActivity));
                            intent.PutExtra("MyData", "Point Pleasant Store");

                            ProgressIndicator.Show(this);
                            StartActivity(intent);
                        }
                        else if (storename == 3)
                        {
                            Intent intent = new Intent(this, typeof(GridViewActivity));
                            intent.PutExtra("MyData", AppConstants.SecaucusStore);

                            ProgressIndicator.Show(this);
                            StartActivity(intent);
                        }
                        else
                        {
                            Intent intent = new Intent(this, typeof(Login));
                            ProgressIndicator.Show(this);
                            StartActivity(intent);
                        }
                        LoggingClass.LogInfoEx("User verified and Logging" + "---->" + CurrentUser.GetCardNumber(), screenid);
                        AndHUD.Shared.Dismiss();
                        AndHUD.Shared.ShowSuccess(Parent, "Success!", MaskType.Clear, TimeSpan.FromSeconds(2));
                    }
                    else
                    {
                        AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                        aler.SetTitle("Sorry");
                        aler.SetMessage("You entered wrong details or authentication failed");
                        aler.SetNegativeButton("Ok", delegate { });
                        Dialog dialog1 = aler.Create();
                        dialog1.Show();
                    };
                }
                else
                {
                    AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                    aler.SetMessage("Your email is not verified. please check email and verify.");
                    aler.SetNegativeButton("Ok", delegate { });
                    Dialog dialog = aler.Create();
                    dialog.Show();
                }
                AndHUD.Shared.Dismiss();
            }

            catch (Exception exe)
            {
                AndHUD.Shared.Dismiss();
                LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
            }
            AndHUD.Shared.Dismiss();
            //BtnLogin.Dispose();
            //BtnResend.Dispose();
            //BtnContinue.Dispose();
            //BtnUpdateEmail.Dispose();
            //update.Dispose();
        }
Beispiel #3
0
        public async void EmailVerification()
        {
            int count = 0;

            if (count == 0)
            {
                AndHUD.Shared.Show(this, "Checking Email Verification", Convert.ToInt32(MaskType.Clear));
                AuthServ = await svc.AuthencateUser("test", CurrentUser.GetCardNumber(), CurrentUser.GetDeviceID());

                DeviceToken DO = new DeviceToken();
                try
                {
                    DO = await svc.CheckMail(AuthServ.customer.CustomerID.ToString());

                    if (DO.VerificationStatus == 1)
                    {
                        if (AuthServ.customer != null && AuthServ.customer.CustomerID != 0)
                        {
                            LoggingClass.LogInfo("The User logged in with user id: " + CurrentUser.getUserId(), screenid);
                            CurrentUser.SaveUserName(AuthServ.customer.FirstName + AuthServ.customer.LastName, AuthServ.customer.CustomerID.ToString());
                            SendRegistrationToAppServer(CurrentUser.getDeviceToken());
                            CurrentUser.SavePrefered(AuthServ.customer.PreferredStore);
                            int storename = AuthServ.customer.PreferredStore;
                            if (storename == 1)
                            {
                                Intent intent = new Intent(this, typeof(GridViewActivity));
                                intent.PutExtra("MyData", "Wall Store");
                                ProgressIndicator.Show(this);

                                StartActivity(intent);
                            }
                            else if (storename == 2)
                            {
                                Intent intent = new Intent(this, typeof(GridViewActivity));
                                intent.PutExtra("MyData", "Point Pleasant Store");

                                ProgressIndicator.Show(this);
                                StartActivity(intent);
                            }
                            else
                            {
                                Intent intent = new Intent(this, typeof(TabActivity));
                                ProgressIndicator.Show(this);
                                StartActivity(intent);
                            }
                            LoggingClass.LogInfoEx("User verified and Logging" + "---->" + CurrentUser.GetCardNumber(), screenid);
                            AndHUD.Shared.Dismiss();
                            AndHUD.Shared.ShowSuccess(Parent, "Success!", MaskType.Clear, TimeSpan.FromSeconds(2));
                        }
                        else
                        {
                            int count12 = 0;
                            if (count12 == 0)
                            {
                                AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                                aler.SetTitle("Sorry");
                                aler.SetMessage("You entered wrong details or authentication failed");
                                aler.SetNegativeButton("Ok", delegate { });
                                Dialog dialog1 = aler.Create();
                                dialog1.Show();
                                //   AndHUD.Shared.ShowErrorWithStatus(this, "You entered wrong details or authentication failed", MaskType.Clear, TimeSpan.FromSeconds(2));
                            }
                            count12 = 1;
                        };
                    }
                    else
                    {
                        AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                        //aler.SetTitle("Sorry");
                        aler.SetMessage("Your email is not verified. please check email and verify.");
                        aler.SetNegativeButton("Ok", delegate { });
                        Dialog dialog = aler.Create();
                        dialog.Show();
                        //  AndHUD.Shared.ShowErrorWithStatus(this, "Your email is not verified plesase check email and verify.", MaskType.Clear, TimeSpan.FromSeconds(2));
                    }
                    //ProgressIndicator.Hide();
                    AndHUD.Shared.Dismiss();
                }

                catch (Exception exe)
                {
                    LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                }
                AndHUD.Shared.Dismiss();
            }
            count = 1;
        }