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; } }