// If class is selected from list, loads existing class form, closes current. private void ViewClass(object sender, EventArgs e) { if (classListBox.SelectedItems.Count != 0) { int classNo = -1; if (AbandonChanges()) classNo = Convert.ToInt32(classListBox.SelectedItems[0].Text); if (classNo >= 0) { ClassListForm showList = new ClassListForm(ActiveCategory.ClubID, ActiveCategory.Year, classNo); showList.Visible = true; this.Close(); } } }
private void ViewClass(object sender, EventArgs e) { int classNo = -1; if (classListBox.SelectedItems.Count != 0 && !IsNew) classNo = Convert.ToInt32(classListBox.SelectedItems[0].Text); if (classNo >= 0) { ClassListForm classList = new ClassListForm(Year.ClubID, Year.Year, classNo); classList.FormClosing += new FormClosingEventHandler(this.RefreshOnClose); classList.Visible = true; } }
// Loads new class form, closes current. private void NewClass(object sender, EventArgs e) { if (AbandonChanges()) { ClassListForm classList = new ClassListForm(ActiveCategory.ClubID, ActiveCategory.Year); classList.Visible = true; this.Close(); } }
private void NewClass(object sender, EventArgs e) { if (!IsNew) { ClassListForm classList = new ClassListForm(Year.ClubID, Year.Year); classList.FormClosing += new FormClosingEventHandler(this.RefreshOnClose); classList.Visible = true; } }