private void button1_Click(object sender, EventArgs e) { ConquestionServiceClient client = new ConquestionServiceClient(); Player foundPlayer = client.RetrievePlayer(textBox1.Text); if (textBox1.Text != null && textBox1.Text != String.Empty) { if (foundPlayer == null) { Player newPlayer = client.CreatePlayer(new Player { Name = textBox1.Text }); PC.Player = newPlayer; this.Hide(); (new JoinGame()).Show(); } else { this.Hide(); PC.Player = foundPlayer; (new JoinGame()).Show(); } } else { MessageBox.Show("Name can not be empty!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } }