Exemplo n.º 1
0
        private async void LogIn_Load(object sender, EventArgs e)
        {
            var isLoggedIn = await Infrastructure.CheckIfLoggedIn();

            if (isLoggedIn.ErrorCode)
            {
                var metadetaErrorModel = await Infrastructure.GetMetadata();

                MetaDataResponse metadata = (MetaDataResponse)metadetaErrorModel.Object;


                Wine_Application wineApp = new Wine_Application(metadata);
                wineApp.Show();
                this.Hide();
            }
            else if (!string.IsNullOrEmpty(isLoggedIn.Message))
            {
                MessageBox.Show(isLoggedIn.Message, "Fel");
                btnLogin.Enabled         = true;
                btnSignUpInLogin.Enabled = true;
            }
            else
            {
                btnLogin.Enabled         = true;
                btnSignUpInLogin.Enabled = true;
            }
        }
Exemplo n.º 2
0
        private async void btnSignup_Click(object sender, EventArgs e)
        {
            var isSignedUp = await Infrastructure.SignUp(tbEmailSignup.Text, tbDisplayName.Text, tbPasswordSignUp.Text, tbRepeatPasswordSignUp.Text);

            if (isSignedUp.ErrorCode)
            {
                var metadetaErrorModel = await Infrastructure.GetMetadata();

                MetaDataResponse metadata = (MetaDataResponse)metadetaErrorModel.Object;

                Wine_Application wineApp = new Wine_Application(metadata);
                wineApp.Show();
                this.Hide();
            }
            else if (!string.IsNullOrEmpty(isSignedUp.Message))
            {
                MessageBox.Show(isSignedUp.Message, "Fel");
            }
        }
Exemplo n.º 3
0
        private async void btnLogin_Click(object sender, EventArgs e)
        {
            //tbEmailLogin.Text = "*****@*****.**";
            //tbPasswordLogin.Text = "123456";

            ErrorModel loggedInSuccessfully = await Infrastructure.LogInWithEmailAndPassword(tbEmailLogin.Text, tbPasswordLogin.Text);

            if (loggedInSuccessfully.ErrorCode)
            {
                var metadetaErrorModel = await Infrastructure.GetMetadata();

                MetaDataResponse metadata = (MetaDataResponse)metadetaErrorModel.Object;
                Wine_Application wineApp  = new Wine_Application(metadata);
                wineApp.Show();
                this.Hide();
            }
            else if (!string.IsNullOrEmpty(loggedInSuccessfully.Message))
            {
                MessageBox.Show(loggedInSuccessfully.Message, "Fel");
            }
        }