Пример #1
0
        public async void ShowInfo(CustomerResponse AuthServ)
        {
            int count = 0;
            int cou   = 0;

            AndHUD.Shared.Show(this, "Please Wait...", Convert.ToInt32(MaskType.Clear));
            try
            {
                if (AuthServ.customer.Email != "" && AuthServ.customer.Email != null)
                {
                    TxtScanresult.Text = AuthServ.ErrorDescription;    // " Hi " + AuthServ.customer.FirstName + authen.customer.LastName + ",\n We have sent an email at  " + authen.customer.Email + ".\n Please verify email to continue login. \n If you have not received email Click Resend Email.\n To get Email Id changed, contact store.";

                    TxtScanresult.SetTextColor(Android.Graphics.Color.Black);
                    BtnResend.Visibility      = ViewStates.Visible;
                    BtnLogin.Visibility       = ViewStates.Visible;
                    BtnContinue.Visibility    = ViewStates.Gone;
                    BtnUpdateEmail.Visibility = ViewStates.Gone;
                    BtnResend.Click          += async delegate
                    {
                        try
                        {
                            if (count == 0)
                            {
                                AndHUD.Shared.Show(this, "Sending verification email to " + AuthServ.customer.Email, Convert.ToInt32(MaskType.Clear));
                                count = 1;
                                LoggingClass.LogInfo("Resend email " + AuthServ.customer.Email, screenid);
                                await svc.ResendEMail(CurrentUser.GetCardNumber());

                                AndHUD.Shared.ShowSuccess(this, "Sent", MaskType.Clear, TimeSpan.FromSeconds(2));
                                AndHUD.Shared.Dismiss();
                            }
                        }
                        catch (Exception ex)
                        {
                        }
                    };
                    count           = 0;
                    BtnLogin.Click += delegate
                    {
                        LoggingClass.LogInfo("Clicked on Login " + AuthServ.customer.CardNumber, screenid);

                        AndHUD.Shared.Show(this, "Checking Email Verification", Convert.ToInt32(MaskType.Clear));
                        EmailVerification();
                    };
                }
                else
                {
                    TxtScanresult.Text = AuthServ.ErrorDescription;
                    TxtScanresult.SetTextColor(Android.Graphics.Color.Red);
                }
                AndHUD.Shared.Dismiss();
            }

            catch (Exception ex)
            {
                LoggingClass.LogError(ex.Message, screenid, ex.StackTrace);
            }

            AndHUD.Shared.Dismiss();
        }
Пример #2
0
        public async void ShowInfo(CustomerResponse AuthServ)
        {
            AndHUD.Shared.Show(this, "Please Wait", Convert.ToInt32(MaskType.Clear));
            try
            {
                //    AuthServ = await svc.AuthencateUser("test", Cardnumber, CurrentUser.GetDeviceID());
                //    LoggingClass.LogInfo("User Tried to login with " + Cardnumber , screenid);
                //if (Cardnumber != null)
                // { CurrentUser.SaveCardNumber(Cardnumber); }

                //    //if (authen.customer.CustomerID != 0)
                //if (AuthServ != null)
                //{
                if (AuthServ.customer.Email != "" && AuthServ.customer.Email != null)
                {
                    TxtScanresult.Text = AuthServ.ErrorDescription;    // " Hi " + AuthServ.customer.FirstName + authen.customer.LastName + ",\n We have sent an email at  " + authen.customer.Email + ".\n Please verify email to continue login. \n If you have not received email Click Resend Email.\n To get Email Id changed, contact store.";

                    TxtScanresult.SetTextColor(Android.Graphics.Color.Black);
                    BtnResend.Visibility      = ViewStates.Visible;
                    BtnLogin.Visibility       = ViewStates.Visible;
                    BtnContinue.Visibility    = ViewStates.Invisible;
                    BtnUpdateEmail.Visibility = ViewStates.Invisible;
                    BtnResend.Click          += async delegate
                    {
                        try
                        {
                            AndHUD.Shared.Show(this, "Sending verification email to" + AuthServ.customer.Email, Convert.ToInt32(MaskType.Clear));
                            LoggingClass.LogInfo("Resend email " + AuthServ.customer.Email, screenid);
                            await svc.ResendEMail(CurrentUser.GetCardNumber());

                            AndHUD.Shared.ShowSuccess(this, "Sent", MaskType.Clear, TimeSpan.FromSeconds(2));
                            AndHUD.Shared.Dismiss();
                        }
                        catch (Exception ex)
                        {
                        }
                    };
                    BtnLogin.Click += delegate
                    {
                        //ProgressIndicator.Show(this);

                        LoggingClass.LogInfo("Clicked on Login " + AuthServ.customer.CardNumber, screenid);
                        AndHUD.Shared.Show(this, "Checking Email Verification", Convert.ToInt32(MaskType.Clear));
                        EmailVerification();
                    };
                }
                else
                {
                    TxtScanresult.Text = AuthServ.ErrorDescription;
                    TxtScanresult.SetTextColor(Android.Graphics.Color.Red);
                }
                //}
                //else
                //{
                //    TxtScanresult.Text = "Sorry. Your Card number is not matching our records.\n Please re-scan Or Try app as Guest Log In.";
                //    BtnResend.Visibility = ViewStates.Invisible;
                //    BtnLogin.Visibility = ViewStates.Invisible;
                //    TxtScanresult.SetTextColor(Android.Graphics.Color.Red);
                //    AndHUD.Shared.Dismiss();
                //}
                AndHUD.Shared.Dismiss();
            }
            catch (Exception ex)
            {
                LoggingClass.LogError(ex.Message, screenid, ex.StackTrace);
            }
            AndHUD.Shared.Dismiss();
        }