I'm building a class that controls the showing of multiple forms that step through a generic sales transaction....
The general scheme is this:
I make a call to the class.... myTransaction.Start()
That class first displays a form to the user to select his sales rep id... once the user clicks the button to identify himself... this form returns back to the class with an instance of salesman.
Then the class displays a form to the user to select a customer.... once that information is entered, it returns back to the class with an instance of a customer...
and so on....
Right now, I am having to implement a Do-While Salesman = Nothing... which loops until the user clicks a button which sets the Salesman to a particular instance. Then the form method returns to the class the salesman...
Is there a better way to handle this? I was thinking perhaps using an event based callback... but I'm not sure how that would work...
Transaction class:
VB Code:
Public Sub Start() SelectASalesMan.Show 'actually a little more complicated 'since I would use a navigation function to determine where to go 'but this suffices for simplicity sake 'at this point though, the transaction class would resume control back to whomever called it End Sub Private Sub SalesManSelected(sender as object, e as system.eventargs) Handles MessageSent End Sub




Reply With Quote