Exemplo n.º 1
0
        private async void beLoginoroutButton_Click(object sender, EventArgs e)
        {
            BeLogin bl = new BeLogin();

            if (!Boolean.Parse(this.isBeLoginLabel.Text))
            {
                if (String.IsNullOrWhiteSpace(this.user.Text) || String.IsNullOrWhiteSpace(this.password.Text))
                {
                    return;
                }
                bool b = await bl.Login(this.user.Text, this.password.Text);

                if (b)
                {
                    MessageBox.Show("ログインに成功しました");
                    this.isBeLoginLabel.Text     = "True";
                    this.SettingData.IsBeLogin   = true;
                    this.beLoginoroutButton.Text = "ログアウト";
                }
                else
                {
                    MessageBox.Show("ログインに失敗しました");
                    this.beLoginoroutButton.Text = "ログイン";
                    this.SettingData.IsBeLogin   = false;
                }
            }
            else
            {
                bl.Logout();
                this.isBeLoginLabel.Text = "False";
                MessageBox.Show("ログアウトに成功しました");
                this.SettingData.IsBeLogin   = false;
                this.beLoginoroutButton.Text = "ログイン";
            }
        }