Exemple #1
0
        private void BackButton_Click(object sender, EventArgs e)
        {
            this.Hide();
            var startupPage = new StartupPage();

            startupPage.ShowDialog();
        }
Exemple #2
0
        private void RegisterButton_Click(object sender, EventArgs e)
        {
            try
            {
                var username = this.UsernameField.Text;
                var password = this.PasswordField.Text;
                var confirm  = this.PasswordConfirmationField.Text;
                if (password != confirm)
                {
                    throw new InvalidPasswordException();
                }

                Program.infoController.CreateAccount(username, password);
                MessageBox.Show("Successfully register! Now just sign in.");
                this.Hide();
                var startupPage = new StartupPage();
                startupPage.ShowDialog();
            }
            catch (InvalidPasswordException)
            {
                MessageBox.Show("Your passwords do not match!");
            }
            catch (FaultException <UsernameAlreadyExistsFault> )
            {
                MessageBox.Show("That username already exists! Try a different one.");
            }
            catch (CommunicationException)
            {
                MessageBox.Show("Unable to connect to server!\nPlease try again Later.");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unforseen error!, " + ex.Message);
            }
        }
        private void RegisterButton_Click(object sender, EventArgs e)
        {
            try
            {
                var username = this.UsernameField.Text;
                var password = this.PasswordField.Text;
                var confirm = this.PasswordConfirmationField.Text;
                if (password != confirm)
                {
                    throw new InvalidPasswordException();
                }

                Program.infoController.CreateAccount(username, password);
                MessageBox.Show("Successfully register! Now just sign in.");
                this.Hide();
                var startupPage = new StartupPage();
                startupPage.ShowDialog();
            }
            catch (InvalidPasswordException)
            {
                MessageBox.Show("Your passwords do not match!");
            }
            catch (FaultException<UsernameAlreadyExistsFault>)
            {
                MessageBox.Show("That username already exists! Try a different one.");
            }
            catch (CommunicationException)
            {
                MessageBox.Show("Unable to connect to server!\nPlease try again Later.");
            }
            catch (Exception ex)
            {
                MessageBox.Show("Unforseen error!, " + ex.Message);
            }
        }
Exemple #4
0
 private void LogoutButton_Click(object sender, EventArgs e)
 {
     try
     {
         Program.infoController.LogoutPlayer(Program.infoController.profile.id);
         this.Hide();
         var startupPage = new StartupPage();
         startupPage.ShowDialog();
     }
     catch (CommunicationException)
     {
         MessageBox.Show("Unable to connect to server!\nPlease try again Later.");
         this.Hide();
         var startupPage = new StartupPage();
         startupPage.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Unforseen error!, " + ex.Message);
         this.Hide();
         var startupPage = new StartupPage();
         startupPage.ShowDialog();
     }
 }
Exemple #5
0
 private void LogoutButton_Click(object sender, EventArgs e)
 {
     try
     {
         Program.infoController.LogoutPlayer(Program.infoController.profile.id);
         this.Hide();
         var startupPage = new StartupPage();
         startupPage.ShowDialog();
     }
     catch (CommunicationException)
     {
         MessageBox.Show("Unable to connect to server!\nPlease try again Later.");
         this.Hide();
         var startupPage = new StartupPage();
         startupPage.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show("Unforseen error!, " + ex.Message);
         this.Hide();
         var startupPage = new StartupPage();
         startupPage.ShowDialog();
     }
 }
 private void BackButton_Click(object sender, EventArgs e)
 {
     this.Hide();
     var startupPage = new StartupPage();
     startupPage.ShowDialog();
 }