There is a form that each user is required to complete, it has 4 fields: date, bill code, amount and currency. Bill code has a drop down menu with a lot of options of 4 that options are valid (Health, Travel, Meal, Hotel). Bill code field cannot be left blank, and it should take only one of these 4 options. A user make 4 entries with each of the 4 bill codes. If user enters only Health and Travel, an error message should fire that Meal and Hotel records need to be added. This is what I got so far:
public bool ValidateBillCode(bills billArray[][])
{
for(int i = 0; i < billArray.Length; i++)
{
for(int j = 0; j < billArray[0].Length; j++)
{
if(billArray[i][j].IndexOf("Health") >= 0 ||
billArray[i][j].IndexOf("Travel") >= 0 ||
billArray[i][j].IndexOf("Meal") >= 0||
billArray[i][j].IndexOf("Hotel") >= 0)
{
return true;
}
else
{
return false;
}
}
}
}
But it doesn't make sure that all four of these are entered, and I'm not sure how to make an error message that would tell the user which of the four are missing. I will appreciate any help with this.