private void ButtonEnter_Click(object sender, EventArgs e) { // Check we got user name if (!ValidateUserName()) { return; } // Check user name if (!CheckUserNameExistAndIsTeacher()) { return; } // Get all teacher courses var courses = m_clientActions.GetCoursesForTeacher(TextboxUserName.Text); var chooseCourseForm = new ChooseCourseForm(courses, TextboxUserName.Text); this.Hide(); chooseCourseForm.ShowDialog(); TextboxUserName.Text = string.Empty; this.Show(); }