public MainForm() { InitializeComponent(); logIn = new LogIn(); GetMovies(); GetUsers(); LoadRecentMovies(); showButton.Hide(); addMovie = new MovieSearch(); }
private void logButton_Click(object sender, EventArgs e) { if (currentUser != null) { //log out action currentUser = null; logButton.Text = "Log in"; userBox.Text = "No user logged in"; } else { logIn = new LogIn(Users); //logIn.Show(); var dialogResult = logIn.ShowDialog(); logButton.Text = "Log out"; if (dialogResult != System.Windows.Forms.DialogResult.Cancel) { currentUser = logIn.SelectedUser; userBox.Text = logIn.SelectedUser.getUserName(); if (logIn.UserRegistered == true) //if we have a new user/users registered Users = logIn.GetModifiedUserList; } } }