コード例 #1
0
        public void IntoApp()
        {
            CurrentUser.SaveverifyResume("Stop");
            int storename = Convert.ToInt32(CurrentUser.GetPrefered());

            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);
            }
        }
コード例 #2
0
        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();
        }
コード例 #3
0
            public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState)
            {
                Stopwatch sr = new Stopwatch();;

                sr.Start();
                base.OnCreateView(inflater, container, savedInstanceState);
                var    view    = inflater.Inflate(Resource.Layout.LocationLayout, null);
                Button Top     = view.FindViewById <Button>(Resource.Id.btnTop);
                Button Middle  = view.FindViewById <Button>(Resource.Id.btnMiddle);
                Button Bottom  = view.FindViewById <Button>(Resource.Id.btnBottom);
                var    metrics = Resources.DisplayMetrics;
                int    height  = metrics.HeightPixels;

                height = height - (int)((360 * metrics.Density) / 3);
                height = height / 3;
                height = height + 2;
                Top.LayoutParameters.Height    = height;
                Middle.LayoutParameters.Height = height;
                Bottom.LayoutParameters.Height = height;


                if (tabName == "Locations")
                {
                    LoggingClass.LogInfo("Clicked on " + tabName, screenid);

                    try
                    {
                        Top.SetBackgroundResource(Resource.Drawable.wall1);
                        //Top.Text = "Wall";
                        //Top.SetTextColor(Color.White);
                        // Top.TextSize = 20;
                        Middle.SetBackgroundResource(Resource.Drawable.pp1);
                        //Middle.Text = "Pt. Pleasant Beach";
                        //Middle.SetTextColor(Color.White);
                        // Middle.TextSize = 20;
                        Bottom.SetBackgroundResource(Resource.Drawable.scacus1);
                        //Bottom.Text = "Secaucus";
                        //Bottom.SetTextColor(Color.White);
                        // Bottom.TextSize = 20;
                        OnPause(); { }
                        Top.Click += (sender, e) =>
                        {
                            ProgressIndicator.Show(_parent);
                            LoggingClass.LogInfo("Clicked on Wall", screenid);
                            var intent = new Intent(Activity, typeof(GridViewActivity));
                            intent.PutExtra("MyData", "Wall Store");

                            StartActivity(intent);
                        };
                        Middle.Click += (sender, e) =>
                        {
                            ProgressIndicator.Show(_parent);
                            LoggingClass.LogInfo("Clicked on Point Plesent", screenid);
                            var intent = new Intent(Activity, typeof(GridViewActivity));
                            intent.PutExtra("MyData", "Point Pleasant Store");
                            StartActivity(intent);
                        };
                        Bottom.Click += (sender, e) =>
                        {
                            AlertDialog.Builder aler = new AlertDialog.Builder(Activity);
                            aler.SetTitle("Secaucus Store");
                            aler.SetMessage("Coming Soon!");
                            aler.SetNegativeButton("Ok", delegate { });
                            LoggingClass.LogInfo("Clicked on Secaucus", screenid);
                            Dialog dialog = aler.Create();
                            dialog.Show();
                        };
                    }
                    catch (Exception exe)
                    {
                        LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                    }
                }
                if (tabName == "My Hangouts")
                {
                    LoggingClass.LogInfo("Clicked on " + tabName, screenid);
                    try
                    {
                        Button Bottom1 = view.FindViewById <Button>(Resource.Id.btnBottom1);
                        int    height1 = metrics.HeightPixels;
                        height1 = height1 - (int)((360 * metrics.Density) / 4);
                        height1 = height1 / 4;
                        height1 = height1 - 20;
                        Top.LayoutParameters.Height     = height1;
                        Middle.LayoutParameters.Height  = height1;
                        Bottom.LayoutParameters.Height  = height1;
                        Bottom1.LayoutParameters.Height = height1;

                        Top.SetBackgroundResource(Resource.Drawable.mt);
                        //Top.Text = "My Reviews";
                        //Top.SetTextColor(Color.White);
                        //Top.TextSize = 20;
                        Middle.SetBackgroundResource(Resource.Drawable.mr);
                        //Middle.Text = "My Tastings";
                        //Middle.SetTextColor(Color.White);
                        //Middle.TextSize = 20;
                        Bottom.SetBackgroundResource(Resource.Drawable.mf);
                        Bottom1.SetBackgroundResource(Resource.Drawable.ms);
                        //Bottom.Text = "My Favorites";
                        //Bottom.SetTextColor(Color.White);
                        //Bottom.TextSize = 20;
                        if (CurrentUser.getUserId() == "0" || CurrentUser.GetGuestId() != null)
                        {
                            AlertDialog.Builder aler = new AlertDialog.Builder(Activity, Resource.Style.MyDialogTheme);
                            aler.SetTitle("Sorry");
                            aler.SetMessage("This Feature is available for VIP Users only");
                            aler.SetPositiveButton("Login", delegate
                            {
                                var intent = new Intent(Activity, typeof(LoginActivity));
                                StartActivity(intent);
                            });
                            aler.SetNegativeButton("KnowMore", delegate
                            {
                                var uri    = Android.Net.Uri.Parse("https://hangoutz.azurewebsites.net/index.html");
                                var intent = new Intent(Intent.ActionView, uri);
                                StartActivity(intent);
                            });
                            aler.SetNeutralButton("Cancel", delegate
                            {
                            });
                            Dialog dialog1 = aler.Create();
                            dialog1.Show();
                            Top.Click += (sender, e) => {
                                Dialog dialog11 = aler.Create();
                                dialog1.Show();
                            };
                            Middle.Click += (sender, e) => {
                                Dialog dialog12 = aler.Create();
                                dialog1.Show();
                            };
                            Bottom.Click += (sender, e) => {
                                Dialog dialog13 = aler.Create();
                                dialog1.Show();
                            };
                            Bottom1.Click += (sender, e) => {
                                Dialog dialog13 = aler.Create();
                                dialog1.Show();
                            };
                        }
                        else
                        {
                            Top.Click += (sender, e) =>
                            {
                                ProgressIndicator.Show(_parent);
                                // AndHUD.Shared.Show(_parent, "Loading...", Convert.ToInt32(MaskType.Clear));
                                LoggingClass.LogInfo("Clicked on My Reviews", screenid);
                                var intent = new Intent(Activity, typeof(MyTastingActivity));
                                intent.PutExtra("MyData", "My Reviews");
                                StartActivity(intent);
                            };
                            Middle.Click += (sender, e) =>
                            {
                                ProgressIndicator.Show(_parent);
                                LoggingClass.LogInfo("Clicked on My Tastings", screenid);
                                var intent = new Intent(Activity, typeof(MyReviewActivity));
                                intent.PutExtra("MyData", "My Tastings");
                                StartActivity(intent);
                            };
                            Bottom.Click += (sender, e) =>
                            {
                                ProgressIndicator.Show(_parent);
                                LoggingClass.LogInfo("Clicked on My Favorites", screenid);
                                var intent = new Intent(Activity, typeof(MyFavoriteAvtivity));
                                intent.PutExtra("MyData", "My Favorites");
                                StartActivity(intent);
                            };
                            Bottom1.Click += (sender, e) =>
                            {
                                //ProgressIndicator.Show(_parent);
                                LoggingClass.LogInfo("Clicked on My Store", screenid);
                                CustomerResponse AuthServ = new CustomerResponse();
                                int storename             = Convert.ToInt32(CurrentUser.GetPrefered());
                                if (storename == 1)
                                {
                                    Intent intent = new Intent(Activity, typeof(GridViewActivity));
                                    intent.PutExtra("MyData", "Wall Store");
                                    ProgressIndicator.Show(Activity);

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

                                    ProgressIndicator.Show(Activity);
                                    StartActivity(intent);
                                }
                                else
                                {
                                    AlertDialog.Builder aler = new AlertDialog.Builder(Activity, Resource.Style.MyDialogTheme);
                                    //aler.SetTitle("Sorry");
                                    aler.SetMessage("Please Select your preferred store!");
                                    aler.SetNegativeButton("Ok", delegate { });
                                    Dialog dialog1 = aler.Create();
                                    dialog1.Show();
                                }
                            };
                        }
                    }
                    catch (Exception exe)
                    {
                        LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                    }

                    //};
                }
                if (tabName == "Explore")
                {
                    try
                    {
                        //Top.SetBackgroundResource(Resource.Drawable.myprofile);
                        //Top.Text = "My Profile";
                        //Top.SetTextColor(Color.White);
                        //Top.TextSize = 20;
                        //Middle.SetBackgroundResource(Resource.Drawable.sfondo_cantine);
                        //Middle.Text = "Wineries/Search Helper";
                        //Middle.TextSize = 20;
                        //Middle.SetTextColor(Color.White);
                        //Bottom.SetBackgroundResource(Resource.Drawable.sfondo_regioni);
                        //Bottom.Text = "Regions";
                        //Bottom.TextSize = 20;
                        //Bottom.SetTextColor(Color.White);
                        //Bottom.SetTextAppearance(Resource.Drawable.abc_btn_borderless_material);

                        //Top.Click += (sender, e) =>
                        //{

                        //    ProgressIndicator.Show(_parent);
                        //    LoggingClass.LogInfo("Clicked on My Profile",screenid);
                        //    var intent = new Intent(Activity, typeof(ProfileActivity));
                        //    intent.PutExtra("MyData", "My Profile");
                        //    StartActivity(intent);

                        //};
                        //Middle.Click += (sender, e) =>
                        //{
                        //    AlertDialog.Builder aler = new AlertDialog.Builder(Activity, Resource.Style.MyDialogTheme);
                        //    aler.SetTitle("Wineries Section");
                        //    aler.SetMessage("Coming Soon");
                        //    aler.SetNegativeButton("Ok", delegate { });
                        //    LoggingClass.LogInfo("Clicked on Wineries",screenid);
                        //    Dialog dialog = aler.Create();
                        //    dialog.Show();
                        //    //var intent = new Intent(Activity, typeof(LandscapeActivity));
                        //    //    intent.PutExtra("MyData", "Wineries");
                        //    //    StartActivity(intent);
                        //    //var intent = new Intent(Activity, typeof(AutoCompleteTextActivity));
                        //    ////intent.PutExtra("MyData", "Wineries");
                        //    //StartActivity(intent);
                        //};
                        //Bottom.Click += (sender, e) =>
                        //{
                        //    AlertDialog.Builder aler = new AlertDialog.Builder(Activity, Resource.Style.MyDialogTheme);
                        //    aler.SetTitle("Regions Section");
                        //    aler.SetMessage("Coming Soon");
                        //    aler.SetNegativeButton("Ok", delegate { });
                        //    LoggingClass.LogInfo("Clicked on Regions",screenid);
                        //    Dialog dialog = aler.Create();
                        //    dialog.Show();
                        //    //var intent = new Intent(Activity, typeof(PotraitActivity));
                        //    //intent.PutExtra("MyData", "Regions");
                        //    //StartActivity(intent);
                        //};
                    }
                    catch (Exception exe)
                    {
                        LoggingClass.LogError(exe.Message, screenid, exe.StackTrace.ToString());
                    }
                    //Top.Dispose();
                    //Bottom.Dispose();
                    //Middle.Dispose();
                }

                TokenModel devInfo         = new TokenModel();
                var        activityManager = (ActivityManager)this.Context.GetSystemService(Context.ActivityService);

                ActivityManager.MemoryInfo memInfo = new ActivityManager.MemoryInfo();
                activityManager.GetMemoryInfo(memInfo);

                System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Avail {0} - {1} MB", memInfo.AvailMem, memInfo.AvailMem / 1024 / 1024);
                System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Low {0}", memInfo.LowMemory);
                System.Diagnostics.Debug.WriteLine("GetDeviceInfo - Total {0} - {1} MB", memInfo.TotalMem, memInfo.TotalMem / 1024 / 1024);

                devInfo.AvailableMainMemory = memInfo.AvailMem;
                devInfo.IsLowMainMemory     = memInfo.LowMemory;
                devInfo.TotalMainMemory     = memInfo.TotalMem;
                sr.Stop();
                LoggingClass.LogTime("tab activity time", sr.Elapsed.TotalSeconds.ToString());
                return(view);
            }
コード例 #4
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            CheckInternetConnection();
            Stopwatch st = new Stopwatch();

            st.Start();
            //for direct login
            //CurrentUser.SaveUserName("Mohana Android","48732");
            //Preinfo("8902519310330");
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.login);
            var TaskA = new System.Threading.Tasks.Task(() =>
            {
                BlobWrapper.DownloadImages(Convert.ToInt32(CurrentUser.getUserId()));
            });

            TaskA.Start();
            ImageButton BtnScanner    = FindViewById <ImageButton>(Resource.Id.btnScanner);
            Button      BtnGuestLogin = FindViewById <Button>(Resource.Id.btnGuestLogin);

            LoggingClass.LogInfo("Opened the app", screenid);

            BtnScanner.Click += async delegate
            {
                try
                {
                    MobileBarcodeScanner.Initialize(Application);
                    var scanner = new ZXing.Mobile.MobileBarcodeScanner();
                    scanner.UseCustomOverlay = false;
                    var result = await scanner.Scan();//"8902519310330";//await scanner.Scan();

                    if (result.Text != null)
                    {
                        LoggingClass.LogInfo("User Tried to login with " + result, screenid);
                        Preinfo(result.Text);
                        CurrentUser.SaveCardNumber(result.Text);
                    }
                }
                catch (Exception exe)
                {
                    LoggingClass.LogError(exe.Message, screenid, exe.StackTrace);
                }
                BtnScanner.Click -= null;
            };

            BtnGuestLogin.Click += async delegate
            {
                //await svc.InsertUpdateGuest(CurrentUser.getAuthToken());
                CurrentUser.SaveUserName("Guest", "0");


                Intent intent = new Intent(this, typeof(TabActivity));
                ProgressIndicator.Show(this);
                LoggingClass.LogInfo("User Tried to login with Guest Login ", screenid);
                StartActivity(intent);
                await svc.InsertUpdateGuest("Didn't get the token");
            };
            TxtScanresult             = FindViewById <TextView>(Resource.Id.txtScanresult);
            BtnLogin                  = FindViewById <Button>(Resource.Id.btnLogin);
            BtnResend                 = FindViewById <Button>(Resource.Id.btnResend);
            BtnContinue               = FindViewById <Button>(Resource.Id.btnContinue);
            BtnUpdateEmail            = FindViewById <Button>(Resource.Id.btnUpdateEmail);
            BtnResend.Visibility      = ViewStates.Invisible;
            BtnLogin.Visibility       = ViewStates.Invisible;
            BtnContinue.Visibility    = ViewStates.Invisible;
            BtnUpdateEmail.Visibility = ViewStates.Invisible;
            if (IsPlayServicesAvailable())
            {
                var TaskB = new System.Threading.Tasks.Task(() =>
                {
                    var intent = new Intent(this, typeof(RegistrationIntentService));
                    StartService(intent);
                });
                TaskB.Start();
            }
            if (CurrentUser.getUserName() == null ||
                CurrentUser.getUserName() == "")
            {
                SendRegistrationToAppServer(CurrentUser.getDeviceToken());
                if (CurrentUser.GetCardNumber() != null)
                {
                    Preinfo(CurrentUser.GetCardNumber());
                }
            }
            else if (CurrentUser.GetGuestId() != null || CurrentUser.getUserId() == "0")
            {
                Intent intent = new Intent(this, typeof(TabActivity));
                ProgressIndicator.Show(this);
                LoggingClass.LogInfo("User Tried to login with Guest Login ", screenid);
                StartActivity(intent);
            }
            else
            {
                int storename = Convert.ToInt32(CurrentUser.GetPrefered());
                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);
                }
            }
            var telephonyDeviceID             = string.Empty;
            var telephonySIMSerialNumber      = string.Empty;
            TelephonyManager telephonyManager = (TelephonyManager)this.ApplicationContext.GetSystemService(Context.TelephonyService);

            if (telephonyManager != null)
            {
                if (!string.IsNullOrEmpty(telephonyManager.DeviceId))
                {
                    telephonyDeviceID = telephonyManager.DeviceId;
                }
                if (!string.IsNullOrEmpty(telephonyManager.SimSerialNumber))
                {
                    telephonySIMSerialNumber = telephonyManager.SimSerialNumber;
                }
            }
            var androidID  = Android.Provider.Settings.Secure.GetString(this.ApplicationContext.ContentResolver, Android.Provider.Settings.Secure.AndroidId);
            var deviceUuid = new UUID(androidID.GetHashCode(), ((long)telephonyDeviceID.GetHashCode() << 32) | telephonySIMSerialNumber.GetHashCode());
            var DeviceID   = deviceUuid.ToString();

            CurrentUser.SaveDeviceID(DeviceID);
        }
コード例 #5
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);


            SetContentView(Resource.Layout.Hangouts);
            Button Top     = FindViewById <Button>(Resource.Id.btnTop);
            Button Middle  = FindViewById <Button>(Resource.Id.btnMiddle);
            Button Bottom  = FindViewById <Button>(Resource.Id.btnBottom);
            Button Bottom1 = FindViewById <Button>(Resource.Id.btnBottom1);
            var    metrics = Resources.DisplayMetrics;
            int    height  = 0;// = metrics.HeightPixels;

            height = (metrics.HeightPixels) - (int)((360 * metrics.Density) / 3);
            height = height / 4;
            height = height - 10;
            Top.LayoutParameters.Height     = height;
            Middle.LayoutParameters.Height  = height;
            Bottom.LayoutParameters.Height  = height;
            Bottom1.LayoutParameters.Height = height;
            Top.SetBackgroundResource(Resource.Drawable.mt);
            Middle.SetBackgroundResource(Resource.Drawable.mr);
            Bottom.SetBackgroundResource(Resource.Drawable.mf);
            Bottom1.SetBackgroundResource(Resource.Drawable.ms);
            if (CurrentUser.getUserId() == null || CurrentUser.getUserId() == "0")
            {
                AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                aler.SetTitle("Sorry");
                aler.SetMessage("This Feature is available only for VIP Users ");
                aler.SetNegativeButton("KnowMore", delegate
                {
                    var uri    = Android.Net.Uri.Parse("https://hangoutz.azurewebsites.net/index.html");
                    var intent = new Intent(Intent.ActionView, uri);
                    StartActivity(intent);
                });
                aler.SetNeutralButton("Cancel", delegate
                {
                });
                Dialog dialog1 = aler.Create();
                dialog1.Show();
                Top.Click += (sender, e) =>
                {
                    Dialog dialog11 = aler.Create();
                    dialog1.Show();
                };
                Middle.Click += (sender, e) =>
                {
                    Dialog dialog12 = aler.Create();
                    dialog1.Show();
                };
                Bottom.Click += (sender, e) =>
                {
                    Dialog dialog13 = aler.Create();
                    dialog1.Show();
                };
                Bottom1.Click += (sender, e) =>
                {
                    Dialog dialog13 = aler.Create();
                    dialog1.Show();
                };
            }
            else
            {
                Top.Click += (sender, e) =>
                {
                    ProgressIndicator.Show(this);
                    var intent = new Intent(this, typeof(MyTastingActivity));
                    intent.PutExtra(AppConstants.MyData, AppConstants.MyTastings);
                    StartActivity(intent);
                };
                Middle.Click += (sender, e) =>
                {
                    ProgressIndicator.Show(this);
                    var intent = new Intent(this, typeof(MyReviewActivity));
                    intent.PutExtra(AppConstants.MyData, AppConstants.MyReviews);
                    StartActivity(intent);
                };
                Bottom.Click += (sender, e) =>
                {
                    ProgressIndicator.Show(this);
                    var intent = new Intent(this, typeof(MyFavoriteAvtivity));
                    intent.PutExtra(AppConstants.MyData, AppConstants.MyFavorites);
                    StartActivity(intent);
                };
                Bottom1.Click += (sender, e) =>
                {
                    CustomerResponse AuthServ = new CustomerResponse();
                    int storename             = Convert.ToInt32(CurrentUser.GetPrefered());
                    if (storename == 1)
                    {
                        Intent intent = new Intent(this, typeof(GridViewActivity));
                        intent.PutExtra(AppConstants.MyData, AppConstants.WallStore);
                        ProgressIndicator.Show(this);

                        StartActivity(intent);
                    }
                    else if (storename == 2)
                    {
                        Intent intent = new Intent(this, typeof(GridViewActivity));
                        intent.PutExtra(AppConstants.MyData, AppConstants.PointPleasantStore);
                        ProgressIndicator.Show(this);
                        StartActivity(intent);
                    }
                    else if (storename == 3)
                    {
                        Intent intent = new Intent(this, typeof(GridViewActivity));
                        intent.PutExtra(AppConstants.MyData, AppConstants.SecaucusStore);
                        ProgressIndicator.Show(this);
                        StartActivity(intent);
                    }
                    else
                    {
                        AlertDialog.Builder aler = new AlertDialog.Builder(this, Resource.Style.MyDialogTheme);
                        aler.SetMessage("Please Select your preferred store!");
                        aler.SetNegativeButton("Ok", delegate { });
                        Dialog dialog1 = aler.Create();
                        dialog1.Show();
                    }
                };
            }
        }
コード例 #6
0
        public async void EmailVerification()
        {
            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());
                        int storename = Convert.ToInt32(CurrentUser.GetPrefered());
                        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
                    {
                        AlertDialog.Builder aler = new AlertDialog.Builder(this);
                        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));
                    };
                }
                else
                {
                    AlertDialog.Builder aler = new AlertDialog.Builder(this);
                    aler.SetTitle("Sorry");
                    aler.SetMessage("Your email is not verified plesase 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();
        }