I have a series of text boxes in a table to gather input as below:The user will input a target and actual value for each measurement point they require. I would then like to validate the actual values against the target values based upon the tolerance inputted in the tolerance textbox. The tolerance will be the same for all measurement points inputted, however the user will not always input all 10 measurement points.I have also created a very basic class containing a function that accepts the target, actual and tolerance values then returns a Boolean depending on whether the actual value is within tolerance. I realise I could use this with a ruck load of if statements to check each textbox for input then use the class to perform the validation, however this seems like a lot of code repetition and a bit crude. My question being is there a better way I can perform this validation?Class contentPublic Class TolerenceHelperPublic Function IsInTolerence(ByVal target As Integer, ByVal actual As Integer, ByVal tolerence As Integer) As Boolean    Dim upper As Integer = target + tolerence    Dim lower As Integer = target - tolerence    If actual < lower OrElse actual > upper Then        Return False    Else        Return True    End IfEnd FunctionCalling the function as below:Dim m1 As TolerenceHelperDim flag As Boolean = Truem1 = New TolerenceHelperIf m1.IsInTolerence(Integer.Parse(txtT1.Text), Integer.Parse(txtA1.Text), Integer.Parse(txtTolerance.Text)) = False Then    flag = FalseEnd IfIf flag = False Then    lblTest.Text = Out of toleranceElse    lblTest.Text = In toleranceEnd If
Most efficient way to validate multiple textboxes against a tolerance value
asp.net;vb.net;validation