paultit_
paultit_
CC#
Created by paultit_ on 12/28/2022 in #help
❔ 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 ❤️
5 replies