Пример #1
0
        private void enroll_Click(object sender, EventArgs e)
        {
            var enrollCtrl = new EnrollController();
            var enrollGui  = new PrimaryEnroll(enrollCtrl);

            enrollGui.Show();
        }
Пример #2
0
        /// <summary>
        /// Check if SSN is valid and cycle to the next page if so
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Next_Click(object sender, EventArgs e)
        {
            var validSSN = this.EnrollCtrl.CheckSSN(this.SSN.Text);

            if (validSSN && this.firstName.Text != "" &&
                this.lastName.Text != "" && this.mailingAddr.Text != "")
            {
                // go the next part of the form
                contactPage.Visible = true;
                this.homePhone.Focus();
            }
            else
            {
                this.Hide();
                var errForm = new PrimaryEnroll(this.EnrollCtrl,
                                                validSSN ? "You didn't submit required fields" :
                                                "Invalid Social Security Number");
                // close this form when the child form is closed -> creates a closing chain
                errForm.Closed += (s, args) => this.Close();
                errForm.Show();
            }
        }