コード例 #1
0
        public async void ConfirmButtonPressed()
        {
            Busy = true;
            var resp = await _authApi.AuthenticateAsync(_loginUsername, _loginPassword);

            await LoginViewModel.DoLogin(this, resp, _loginMgr, _authApi);

            Busy = false;
        }
コード例 #2
0
        public async void OnLogInButtonPressed()
        {
            Busy = true;
            try
            {
                var resp = await _authApi.AuthenticateAsync(Account.UserId, EditingPassword);

                await LoginViewModel.DoLogin(this, resp, _loginMgr, _authApi);
            }
            finally
            {
                Busy = false;
            }
        }
コード例 #3
0
        public async void OnLogInButtonPressed()
        {
            if (!IsInputValid)
            {
                return;
            }

            Busy = true;
            try
            {
                var resp = await _authApi.AuthenticateAsync(EditingUsername, EditingPassword);

                await DoLogin(this, resp, _loginMgr, _authApi);
            }
            finally
            {
                Busy = false;
            }
        }
コード例 #4
0
ファイル: LoginForm.cs プロジェクト: st-1297/DotNetAsp
        /// <summary>
        /// 開始ボタン
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void btnExecute_Click(object sender, EventArgs e)
        {
            try
            {
                this.Cursor             = Cursors.WaitCursor;
                this.btnExecute.Enabled = false;

                int id;
                if (!int.TryParse(this.txtUserId.Text, out id))
                {
                    MessageBox.Show("ユーザーIDは数字です");
                    return;
                }
                var password = this.txtUserPswd.Text;


                var result = await AuthApi.AuthenticateAsync(new UserAuthInfo(id, password));

                if (!result)
                {
                    MessageBox.Show("認証に失敗しました。\nIDおよびパスワードを再度確認してください。");

                    return;
                }

                //--- 使用頻度の高いデータをキャッシュ
                //await this.GetMasterDataCacheAsync();

                this.DialogResult = DialogResult.OK;
                this.Close();
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
            finally
            {
                this.Cursor             = Cursors.Arrow;
                this.btnExecute.Enabled = true;
            }
        }