コード例 #1
0
ファイル: LogIn.cs プロジェクト: Osama-aj/examensArbete
        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;
            }
        }
コード例 #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");
            }
        }
コード例 #3
0
ファイル: LogIn.cs プロジェクト: Osama-aj/examensArbete
        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");
            }
        }