private void LoginForm_Load(object sender, EventArgs e) { save = true; deleted = false; addsuccess = false; MovieLibraryMain.close = true; LoginHandler.ReadUsers(); MovieLibraryMain.listOfUser = new List <LoginData>(); MovieLibraryMain.listOfUser = LoginHandler.ReadUsers(); DisplayUsers(MovieLibraryMain.listOfUser); }
private void btnSave_Click(object sender, EventArgs e) { save = true; deleted = false; addsuccess = false; var confirmResult = MessageBox.Show("Would you like to save the database to the file?\nIt will overwrite the previous database.", "Confirm Save!", MessageBoxButtons.YesNo); if (confirmResult == DialogResult.Yes) { LoginHandler.WriteUser(MovieLibraryMain.listOfUser); } else { MessageBox.Show("The data wasn't saved!"); } }
/// <summary> /// The constructor method of the interface, which initalizes the components needed for the system. /// Also sets the default index for the "User Type" combobox to Students. /// </summary> public LoginInterface() { InitializeComponent(); comboBox_userType.SelectedIndex = 0; loginHandler = new LoginHandler(); }