Click here to Skip to main content
15,915,093 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have user class and login form,in the login time store user information in user object. I have also another class name Customer.For adding a customer i need customer id which is stored in user class. How can i get this in windows application.
Posted

You can make it a global object and share it across the application or you could add a parameter to the constructors of all the form to pass the object around.
 
Share this answer
 
Comments
Md. Shihab Uddin 23-Dec-14 14:47pm    
Thanks
Usually you make the User class provide a method (e.g. getUserId() ) or a read-only property. Then, of course, the Customer object needs to call the method on a instance of the User class.
 
Share this answer
 
Comments
Md. Shihab Uddin 18-Jan-15 1:18am    
Thanks
CPallini 18-Jan-15 9:22am    
You are welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900