View Single Post
  #9 (permalink)  
Old July 19th, 2007, 12:10 AM
navdeep navdeep is offline
Authorized User
 
Join Date: Apr 2007
Location: , , .
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by planoie
 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
Hello Peter,

I will try to make it more clear. I will frame my question in a different way. I need a user class.

I am creating a winform application with VS2005. These application has a login screen apart from other screen. Login screen authenticates matching username and password with database. The class should have properties like user_code, user_name,password and user_type.

Now how should I design the three layer ie BO,BL,DAL so that

1. I have global access to two properties user_code and user_type
2. These properties should be set just once in the life of application ie once set the developer should not be able to set it again.

I hope it makes sense.

Navdeep

Reply With Quote