private void button2_Click(object sender, EventArgs e) { if (BTForm1 == null) { BTForm1 = new Budget_Tracker.Forms.Form1(); BTForm1.Show(); BTForm1.Visible = true; } else { BTForm1.Show(); BTForm1.Visible = true; } }
// Logs the user out public void Logout() { // Log out the user (SQL) Globals._SC.Update("UPDATE [Account Information] SET LoggedIn = 0 WHERE AccountNumber = " + Globals._LoggedInUser.AccountNumber); Globals._LoggedInUser = null; // Clear all field values textBox1.Text = ""; textBox2.Text = ""; textBox3.Text = ""; textBox4.Text = ""; textBox5.Text = ""; textBox6.Text = ""; textBox7.Text = ""; textBox8.Text = ""; // reset the profile window dimensions to starting size this.Size = new Size(584, 616); this.pictureBox3.Image = Login_System.Properties.Resources.Arrow_Left; //clear friends list flowLayoutPanel1.Controls.Clear(); // Hide this form / Show login form/ close any other forms this.Visible = false; LoginWindowForm.Visible = true; CW.Dispose(); CW = null; if (BTForm1 != null) { BTForm1.Dispose(); BTForm1 = null; } // reset piechartstats to zero Utilities.PieChartStats.PayCheck = 0; Utilities.PieChartStats.Refund = 0; Utilities.PieChartStats.OtherGain = 0; Utilities.PieChartStats.Rent = 0; Utilities.PieChartStats.Transportation = 0; Utilities.PieChartStats.Entertainment = 0; Utilities.PieChartStats.OtherExpense = 0; Utilities.PieChartStats.Groceries = 0; }