This was to be set up like an eCommerce application. User have to enter User ID #, quantity of an item, & price of item. The module, I think should take parts of the Char
CODE
Module Module1
Public Function fnVerify(ByVal strUserID As String) As Boolean
Dim strFirstChar As String
Dim strSecondChar As String
Dim strThirdChar As String
Dim strFourthChar As String
Dim strFifthChar As String
Dim strSixthChar As String = ("P")
strFirstChar = strUserID.Substring(0, 1)
strSecondChar = strUserID.Substring(1, 1)
strThirdChar = strUserID.Substring(2, 1)
strFourthChar = strUserID.Substring(3, 1)
strFifthChar = strUserID.Substring(4, 1)
If strFirstChar = strFifthChar Then
Return True
Else
Return False
End If
If strFourthChar = strSecondChar + strThirdChar Then
Return strSixthChar
End If
End Function
End Module
-------------------------------------------------------------------------------------------------------------------------------
2ND FORM - VERIFY BUTTON
When I click a button - verify user id matches a particular pattern. If registered -msg verified and total for order will show in textbox. If not registered -msg display and textboxes will be set to zero (quantity, price, and total)
CODE
Public Class itemVerifierForm
Private Sub verifyButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles verifyButton.Click
Dim userId As String
userId = userIdTextBox.Text
If fnVerify(userId) = True Then
MessageBox.Show("You made it")
' calTotal()
Else
MessageBox.Show("You didn't make it")
'clearfields()
quantityOfItemTextBox.Clear()
priceOfItemTextBox.Clear()
totalPriceTextBox.Clear()
End If
End Sub
Write Sub Procedures to calculate total and clear entry fields.
Name it clearfields() (NOT SURE WHAT TO DO HERE)
' Calculate Total Value of the order.
Dim totalPriceString As String
totalPriceTextBox.text = (quantityOfItem * priceOfItem)
End Class