Beispiel #1
0
 public RegisterPage(PagesControler pagesControler, LayoutControler layoutControler, AuthenticationControler authenticationControler)
 {
     _pagesControler          = pagesControler;
     _layoutControler         = layoutControler;
     _authenticationControler = authenticationControler;
     InitializeComponent();
 }
Beispiel #2
0
        private async Task <bool> Register()
        {
            if (!registerUser.Checked && !registerShop.Checked)
            {
                errorText.Text = "Choose User/Shop Login";
                return(false);
            }
            AuthenticationControler authenticationControler = new AuthenticationControler();
            await authenticationControler.Register(_program._httpControler, registerName.Text, registerPass.Text, registerUser.Checked);

            return(true);
        }
Beispiel #3
0
        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);
        }
Beispiel #4
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);
        }