© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
4 replies
paultit_

❔ Need Help with windows form program

private void submitButton_Click(object sender, EventArgs e)
        {
            if (ValidateForm())
            {
                PersonalInformation pModel = new PersonalInformation(
                    firstNameTxtBox.Text,
                    middleNameTxtBox.Text,
                    lastNameTxtBox.Text,
                    ageTxtBox.Text);

                myAddress adModel = new myAddress(
                    cityTxtBox.Text,
                    barangayTxtBox.Text,
                    streetTxtBox.Text,
                    housenumTxtBox.Text);
                

                userInfo userModel = new userInfo(
                    userNameTxtBox.Text,
                    passwordTxtBox.Text);
                

                cardInformation cardModel = new cardInformation(
                    pinCodeTxtBox.Text
                    );




                foreach (IatmDataConnection db in GlobalConfig.Connections)
                {
                    db.personalInformationReg(pModel);
                    db.myAddressReg(adModel);
                    db.userInfoReg(userModel);
                    db.cardInformationReg(cardModel);
                }

            }
            else
            {
                MessageBox.Show("This form has an Invalid information. Please Check it and try again.");
            }
private void submitButton_Click(object sender, EventArgs e)
        {
            if (ValidateForm())
            {
                PersonalInformation pModel = new PersonalInformation(
                    firstNameTxtBox.Text,
                    middleNameTxtBox.Text,
                    lastNameTxtBox.Text,
                    ageTxtBox.Text);

                myAddress adModel = new myAddress(
                    cityTxtBox.Text,
                    barangayTxtBox.Text,
                    streetTxtBox.Text,
                    housenumTxtBox.Text);
                

                userInfo userModel = new userInfo(
                    userNameTxtBox.Text,
                    passwordTxtBox.Text);
                

                cardInformation cardModel = new cardInformation(
                    pinCodeTxtBox.Text
                    );




                foreach (IatmDataConnection db in GlobalConfig.Connections)
                {
                    db.personalInformationReg(pModel);
                    db.myAddressReg(adModel);
                    db.userInfoReg(userModel);
                    db.cardInformationReg(cardModel);
                }

            }
            else
            {
                MessageBox.Show("This form has an Invalid information. Please Check it and try again.");
            }


the else statement keeps on getting executed even though I am filling up all textboxes . TYIA ❤️
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ HELP WITH EXERCISE WINDOWS FORM
C#CC# / help
3y ago
need help with program (.exe)
C#CC# / help
2y ago
❔ Windows Form help
C#CC# / help
3y ago
need help with auto drawing program
C#CC# / help
2y ago