Exemplo n.º 1
0
        //--------Event Handlers-----------
        private void saveAccInfoButton_Click(object sender, EventArgs e)
        {
            thisMember = new Member();
            thisLogin = new Login();

            thisMember.FName = firstNameBox.Text;
            thisMember.LName = lastNameBox.Text;
            thisMember.DateOfBirth = Convert.ToDateTime(DOBDateTimePicker.Text);
            thisMember.Address1 = address1Box.Text;
            thisMember.Address2 = address2Box.Text;
            thisMember.City = cityBox.Text;
            thisMember.State = stateBox.Text;
            thisMember.Zip = Convert.ToInt32(zipBox.Text);
            thisMember.Phone = Convert.ToString(phoneNumBox.Text);
            thisLogin.Username = userNameBox.Text;
            thisLogin.Password = passwordBox.Text;

            string DOBString = Convert.ToString(thisMember.DateOfBirth);
            DOBString = DOBString.Substring(0, 10);

            int scopeID = thisMember.CreateAccount(thisMember.FName, thisMember.LName, thisMember.Address1, thisMember.Address2, thisMember.Phone, thisMember.City, thisMember.State, thisMember.Zip, DOBString);
            thisLogin.CreateLogin(thisLogin.Username, thisLogin.Password, scopeID);
            ClearTextBoxes();
            MessageBox.Show("You have successfully created an account!");
        }
        private void saveAccInfoButton_Click(object sender, EventArgs e)
        {
            thisMember = new Member();

            thisMember.FName = firstNameBox.Text;
            thisMember.LName = lastNameBox.Text;
            thisMember.DateOfBirth = Convert.ToDateTime(DOBDateTimePicker.Text);
            thisMember.Address1 = address1Box.Text;
            thisMember.Address2 = address2Box.Text;
            thisMember.City = cityBox.Text;
            thisMember.State = stateBox.Text;
            thisMember.Zip = Convert.ToInt32(zipBox.Text);
            thisMember.Phone = Convert.ToString(phoneNumBox.Text);

            string DOBString = Convert.ToString(thisMember.DateOfBirth);
            DOBString = DOBString.Substring(0, 10);

            thisMember.CreateAccount(thisMember.FName, thisMember.LName, thisMember.Address1, thisMember.Address2, thisMember.Phone, thisMember.City, thisMember.State, thisMember.Zip, DOBString);
            ClearTextBoxes();
            MessageBox.Show("Thank you! Your member account has been updated");
        }