View Single Post
  #8 (permalink)  
Old July 18th, 2007, 10:22 PM
planoie's Avatar
planoie planoie is offline
Friend of Wrox
Points: 16,481, Level: 55
Points: 16,481, Level: 55 Points: 16,481, Level: 55 Points: 16,481, Level: 55
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2003
Location: Clifton Park, New York, USA.
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

From what you have explained so far, it sounds like you need to pass around the user detail information throughout the application so my approach would be to pass the user details class around to the forms that need it.

The form you do the login on creates the instance of the user details class. Presumably, you are then launching other forms from that. So these other forms have constructors that expect an instance of the user details. Short of writing the code for you I'm not sure I can elaborate more.

Regarding the second bit, you need to create a class that extends the base windows form class (the class that your forms normally inherit). This class will have an instance of the user details. Then your forms will extend that class instead of the default form class so they get to use that user details instance.

I'm not sure I follow what you mean about two classes with user code and user type. Generally, I'd say you should avoid this if they are holding the same data.

-Peter
Reply With Quote