//on load, try to connect to database
        private void AssignmentPlanner_Load(object sender, EventArgs e)
        {
            //check if application directory exists and if not, create it
            Util.createApplicationDirectoryIfNotExists();

            //create database if it does not already exist
            if (Database.exists() == false) {
                CreateDatabaseForm createDB = new CreateDatabaseForm();
                createDB.ShowDialog();
                isDatabaseOpen = true;

                AddSemesterForm addSemester = new AddSemesterForm(true);
                addSemester.ShowDialog();

                bool gotoNext = addSemester.gotoAddProfessorPage();
                if (gotoNext == true) {
                    AddProfessorForm addProf = new AddProfessorForm(true);
                    addProf.ShowDialog();
                    gotoNext = addProf.gotoAddClassPage();
                }
                if (gotoNext == true) {
                    AddClassForm addClass = new AddClassForm();
                    addClass.ShowDialog();
                }
            }
            else {
                //try first connecting without a password
                if (Database.connect(null) == false) {

                    //if it fails, prompt the user for a password
                    DatabasePasswordForm dbPasswordForm = new DatabasePasswordForm();
                    dbPasswordForm.ShowDialog();

                    //continue looping while user has entered incorrect password or
                    //  until user quits, which will then terminate the program
                    while (Database.connect(dbPasswordForm.password) == false) {
                        DialogResult retry = MessageBox.Show("Incorrect Database Password. Try Again?", "Incorrect Password", MessageBoxButtons.RetryCancel, MessageBoxIcon.Exclamation);
                        if (retry == DialogResult.Retry) {
                            dbPasswordForm.ShowDialog();
                        }
                        else {
                            Environment.Exit(0);
                        }
                    }

                    //ensure database credentials are not stored in memory
                    dbPasswordForm.eraseCredentials();

                }

                isDatabaseOpen = true;

                if (PlannerSettings.Default.SyncEvents == true) {
                    GoogleCalendarSync.authenticate();
                }
            }

            enableDisableToolStripMenuItem.Checked = PlannerSettings.Default.SyncEvents;

            updateEvents();
            updateGrades();
            updateGPA();
            updateCalendar(eventsLoadedStartDate, eventsLoadedEndDate);
        }
 //launch for to add a semester
 private void addSemesterToolStripMenuItem_Click(object sender, EventArgs e)
 {
     AddSemesterForm form = new AddSemesterForm();
     form.ShowDialog();
 }