Esempio n. 1
0
        private async void ButtonLogin_Click(object sender, EventArgs e)
        {
            if (TextBoxUsername.Text == null || TextBoxUsername.Text.Length == 0 ||
                TextBoxPassword.Text == null || TextBoxPassword.Text.Length == 0)
            {
                ErrorDialog errorDialog = new ErrorDialog("Lỗi đăng nhập", "Vui lòng nhập tài khoản và mật khẩu!");
                errorDialog.ShowDialog();
                return;
            }
            var response = await HTTPClientManager.Shared().Login(TextBoxUsername.Text, TextBoxPassword.Text);

            if (response.success)
            {
                // process to profile screen
            }
            else
            {
                // show error dialog
                ErrorDialog errorDialog = new ErrorDialog("Lỗi đăng nhập", response.message);
                errorDialog.ShowDialog();
            }
        }
Esempio n. 2
0
 public AppStatus()
 {
     isAuthorized = HTTPClientManager.Shared().hasToken;
 }
Esempio n. 3
0
 private void ButtonLogout_Click(object sender, EventArgs e)
 {
     HTTPClientManager.Shared().Logout();
     TablePanelRight.Controls.RemoveAt(1);
     ButtonLogout.Visible = false;
 }