Public Class miscFunctionsFormatString
  Public Function ConvertDateToDBFormat(ByVal strInputDate As String) As String
  Dim strOutput As String
    'strOutput = format(cdate(strInputDate), "yyyy-MM-dd")
    strOutput = Format(CDate(strInputDate), "dd MMMM yyyy")
  Return strOutput
  End Function
  Public Function ConvertDateToDDMMYYFormat(ByVal strInputDate As String) As String
  Dim strOutput As String
  strOutput = format(cdate(strInputDate), "dd/MM/yyyy")
  Return strOutput
  End Function
  Public Function ConvertDateToLongDisplayFormat(byval strInputDate As string) as string
  If strInputDate = "" Then
    Return ""
  End If
  Dim datInput As Date = CDate(strInputDate)
  Dim strOutput As String = ""
  strOutput += datInput.DayOfWeek.ToString & " "
  strOutput += datInput.ToLongDateString
  Return strOutput
  End Function
  Public Function GetGenderType(ByVal genderID As String) As String
    Dim gender As String = "Male"
    Select genderID
      Case "F"
        gender = "Female"
    End Select
    Return gender
  End Function
  Public Function GetTrueFalseText(ByVal isTrue As Integer) As String
    Dim isTrueValue As String = "No"
    Select Case isTrue
      Case 1
        isTrueValue = "Yes"
    End Select
    Return isTrueValue
  End Function
  Public Function GetAgeType(ByVal intAgeType As Integer, ByVal intAge As Integer) As String
    Dim strAgeTypeLabel As String = "months"
    Select Case intAgeType
      Case "2"
        strAgeTypeLabel  = "year"
        Select Case intAge
          Case Is > 1
            strAgeTypeLabel  &= "s"
        End Select
    End Select
    Return strAgeTypeLabel 
  End Function
  Public Function GetAgeValue(ByVal intAgeType As Integer, ByVal intAge As Integer) As String
    Select Case intAgeType
      Case "2"
        Return intAge / 12
      Case Else
        Return intAge
    End Select
  End Function
End Class
