Wednesday, March 16, 2005

news from the wasteland

we're going public and it's not bulletproof yet.
oh well, sometimes cleaning up messes is faster then being ready.
the moving goal posts of this project (feature creap x 10) have wore me out so i'm to the point where i really don't care anymore. i have faith in what i've built for 16 months, so if it's going to fail (or break in an area) its because they've amended the business process for the 101st time and i'm not quite on top of it. i guess that is what they get for changing their mind and not truly knowing how their business functions.

insane business rule #200 that cannot be done on paper (my rule of thumb for appropriate) - IT's for all applicants (even inside a group of up to 40) needing to have a medical revision date within the last 6 months and to choose at least 1 allergy even if that allergy is 'no known allergies' - try enforcing THAT with your fax machine and short intructions!

so, here's some code from this morning to keep everyone happy:

Dim aMembers() As String = viewstate("Group") 'pull from viewstate
For x = 0 To (GroupMemberCount() - 1) 'each member
ViewState("GrpMemSel") = (x + 1).ToString 'set active member to one that failed 'the group counter starts at 1 and our array starts at 0
If aMembers((x * 50) + 2) <> "" Then 'group member _First_Name exists
If Strings.IsDate(aMembers((x * 50) + 15).ToString) = "False" Then 'check medicaldate
Errors.Add(New Validation("txtGMedicalDate", "Date must be in MM/DD/YYYY"))
Else
If CDec(DateDiff(DateInterval.Day, CDate(aMembers((x * 50) + 15).ToString), Now())) < 180 And CDec(DateDiff(DateInterval.Day, CDate(aMembers((x * 50) + 15).ToString), Now())) >= 0 Then
'if it's not the same then save
If aMembers((x * 50) + 15) <> Strings.IsDate(aMembers((x * 50) + 15).ToString) Then
aMembers((x * 50) + 15) = Strings.IsDate(aMembers((x * 50) + 15).ToString)
viewstate("Group") = aMembers 'save
End If 'date checks out.
Else
Errors.Add(New Validation("txtGMedicalDate", "Your Medical Record Update Date must be within the past six months.")) ' & CDec(DateDiff(DateInterval.Day, CDate(txtGMedicalDate.Text), Now()) / 365.25)))
End If 'old enough based on context
End If 'valid medical date

If Strings.IsTrue(aMembers((x * 50) + 31)) = False _
And Strings.IsTrue(aMembers((x * 50) + 32)) = False _
And Strings.IsTrue(aMembers((x * 50) + 33)) = False _
And Strings.IsTrue(aMembers((x * 50) + 34)) = False _
And Strings.IsTrue(aMembers((x * 50) + 35)) = False _
And Strings.IsTrue(aMembers((x * 50) + 36)) = False Then 'check allergies
Errors.Add(New Validation("lblGAllergies", "A minimum of 'No Known Allergies' must be selected."))
viewstate("Group") = aMembers 'save
End If 'valid allergies

If Errors.Count > 0 Then 'redraw controls and crash out of loop if they fail.
Call GroupMemberLoad() 'draw them to the screen
Call DrawGroupList() 'draw the group
Exit Select 'bail out.
End If 'errors and we saved and left
End If 'if fname exists
Next 'group member
End If 'no erros so check our members for validation.

0 Comments:

Post a Comment

<< Home