JomarMark Tamargo

JomarMark Tamargo

  • NA
  • 27
  • 9.6k

Return process

Jan 12 2016 1:33 PM
 Question for return to validateMe if there is an error validated.
 
private void tsbSave_Click(object sender, EventArgs e)
{
 
ValidateMe(); this for my error provider
 
1. Question how can i return in ValidateMe() if the field is error? n
ot continuing this line below...

 
try
{
DialogResult Mresult = MessageBox.Show("Do you want save this data?", "Message", MessageBoxButtons.YesNo);
if(Mresult == DialogResult.Yes)
{
// .........
}
else if (Mresult == DialogResult.No)
{
return;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
}
DisableField();
ClearField();
}
private void ValidateMe()
{
bool bValidIqama = ValidateIqama();
if (bValidIqama)
{
MessageBox.Show("Confirm");
}
else
MessageBox.Show("Please fill-up all the required information", "Required");
}
 

Answers (4)