コード例 #1
0
ファイル: LoginPanel.cs プロジェクト: Ptysiek/ppz
        private async Task <bool> Login(bool user)
        {
            if (loginName.Text.Length == 0 || loginPass.Text.Length == 0)
            {
                var error = "Credentials not given ";
                ErrorText.Text = error;
                return(false);
            }
            AuthenticationControler authenticationControler = new AuthenticationControler();
            string result = await authenticationControler.Login(_program._httpControler, loginName.Text, loginPass.Text, user);

            if (result.Length == 0)
            {
                return(true);
            }
            ErrorText.Text = result;
            return(false);
        }
コード例 #2
0
        private async Task <bool> Login()
        {
            if (!registerUser.Checked && !registerShop.Checked)
            {
                errorText.Text = "Choose User/Shop Login";
                return(false);
            }
            AuthenticationControler authenticationControler = new AuthenticationControler();
            var result = await authenticationControler.Login(_program._httpControler, registerName.Text, registerPass.Text, registerUser.Checked);

            if (result.Length == 0)
            {
                return(true);
            }
            errorText.Text = result;
            Console.WriteLine(authenticationControler.errorCode);
            Console.WriteLine(authenticationControler.error);
            return(false);
        }