Example #1
0
        private void uxSignInButton_Click(object sender, EventArgs e)
        {
            string email    = uxEmailTextBox.Text;
            string password = uxPasswordTextBox.Text;

            // call method to login
            if (controller.ValidateUser(email, password))
            {
                Program.currentUser = controller.GetUser(email);
                if (Program.currentUser.UserType == 0)
                {
                    Hide();
                    var coachWelcome = new CoachWelcome();
                    coachWelcome.Closed += (s, args) => Close();
                    coachWelcome.Show();
                }
                else
                {
                    Hide();
                    var runnerWelcome = new uxRunnerHomePage();
                    runnerWelcome.Closed += (s, args) => Close();
                    runnerWelcome.Show();
                }
            }
            else
            {
                uxErrorLabel.Text = "Invalid Email/Password";
            }
        }
Example #2
0
 public static void GoHome(Form f)
 {
     f.Hide();
     if (currentUser.UserType == 1)
     {
         var homepage = new uxRunnerHomePage();
         homepage.Closed += (s, args) => f.Close();
         homepage.Show();
     }
     else
     {
         var homepage = new CoachWelcome();
         homepage.Closed += (s, args) => f.Close();
         homepage.Show();
     }
 }