void parseJSONLogout(String jsonLogout)
        {
            try
            {
                var userProfileJSONObj = JsonConvert.DeserializeObject <LogoutClass>(jsonLogout);
                if (userProfileJSONObj.success == true)
                {
                    logoutObject         = new LogoutClass();
                    logoutObject.success = userProfileJSONObj.success;

                    this.logout_success = true;
                }
                else
                {
                    if (MessageBox.Show("Thông tin người dùng không hợp lệ!", "Thông báo", MessageBoxButton.OKCancel) == MessageBoxResult.OK)
                    {
                        NavigationService.GoBack();
                    }
                    this.logout_success = false;
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 2
0
        partial void LoginButton_TouchUpInside(UIButton sender)
        {
            UIAlertController alert;

            alert = UIAlertController.Create("Profile", "What would you like to do?", UIAlertControllerStyle.ActionSheet);

            UIAlertAction register;

            register = UIAlertAction.Create("Register", UIAlertActionStyle.Default, (obj) => RegisterClass.Alert(this));
            alert.AddAction(register);

            UIAlertAction login;

            login = UIAlertAction.Create("Login", UIAlertActionStyle.Default, (obj) => LoginClass.Alert(this));
            alert.AddAction(login);

            UIAlertAction logout;

            logout = UIAlertAction.Create("Logout", UIAlertActionStyle.Default, (obj) => LogoutClass.Logout(this));
            alert.AddAction(logout);

            UIAlertAction cancel;

            cancel = UIAlertAction.Create("Cancel", UIAlertActionStyle.Cancel, null);
            alert.AddAction(cancel);

            this.PresentViewController(alert, true, null);
        }
Ejemplo n.º 3
0
        private void ProfileAction(object sender, System.EventArgs e)
        {
            AlertDialog.Builder profileAlert = new AlertDialog.Builder(this);
            profileAlert.SetTitle("Profile");
            profileAlert.SetMessage("What would you like to do?");


            profileAlert.SetPositiveButton("Register", (senderAlert, arg) => RegisterClass.Alert(this));
            profileAlert.SetNeutralButton("Login", (sendingAlert, arg) => LoginClass.Alert(this));
            profileAlert.SetNegativeButton("Logout", async(sendingAlert, arg) => await LogoutClass.Logout(this));


            Dialog dialog = profileAlert.Create();

            dialog.Window.SetGravity(GravityFlags.Bottom);
            dialog.Show();
        }