Custom validation issue with IF statements
<p>Here is the code:</p>

<pre><code>            if (roomGender == "M")
            {
                if (gender == "F")
                {
                    row.Cells[5].BackColor = Color.FromName("#FF0000");
                    args.IsValid = false;
                    vldGender.ErrorMessage = building +" " + room + ": You cannot place a female in this space";
                }
                else
                {
                    vldGender.ErrorMessage = "";
                }
            }
            //end male gender check
            //Female gender check
            if (roomGender == "F")
            {
                if (gender == "M")
                {
                    row.Cells[5].BackColor = Color.FromName("#FF0000");
                    args.IsValid = false;
                    vldGender.ErrorMessage = building +" " + room + ": You cannot place a male in this space";
                }
                else
                {
                    vldGender.ErrorMessage = "";
                }
            }
            //end female gender check
            //Validate Names
            string last = ((TextBox)row.FindControl("txtLast")).Text;
            string first = ((TextBox)row.FindControl("txtFirst")).Text;

            if (last == "" &amp;&amp; first != "")
            {
                row.Cells[3].BackColor = Color.FromName("#FF0000");
                args.IsValid = false;
                vldLast.ErrorMessage = building +" " + room + ": The last name cannot be blank";
            }
            else
            {
                vldLast.ErrorMessage = "";
            }
            if (last != "" &amp;&amp; first == "")
            {
                row.Cells[4].BackColor = Color.FromName("#FF0000");
                args.IsValid = false;
                vldFirst.ErrorMessage = building +" " + room + ": The first name cannot be blank";
            }
            else
            {
                vldFirst.ErrorMessage = "";
            }

            if (last != "" &amp;&amp; first != "" &amp;&amp; gender == "")
            {
                row.Cells[5].BackColor = Color.FromName("#FF0000");
                args.IsValid = false;
                vldGender2.ErrorMessage = building +" " + room + ": A gender must be selected";
            }
            else
            {
                vldGender2.ErrorMessage = "";
            }
            if (!(regLast.IsValid))
            {
                row.Cells[3].BackColor = Color.FromName("#FF0000");
                regLast.ErrorMessage = building +" " + room + ": The last name is incorrect, please check the name";
            }
            if (!(regFirst.IsValid))
            {
                row.Cells[4].BackColor = Color.FromName("#FF0000");
                regFirst.ErrorMessage = building +" " + room + ": The first name is incorrect, please check the name";
            }
        }
    }
}
</code></pre>

<p><strong>My problem</strong> 
Because this is using if statements when one of the if statements fails to validate, the if statement stops on the line. So  the rest of the Fields on that line aren't validated.</p>

<p>I have the field first name, and last name and gender. </p>

<p>If I forget to add in the first name, and the last name, but not the gender. </p>

<p>This validation will only show me missing the first name, the last name wouldn't' be checked until after the first name is fixed. </p>

<p>Is their any way to solve this issue, so that both field are checks at the same time?</p>
