B
BobRoyAce
I have an application which is comprised of, among many other things, a
Main form which shows various user controls depending on which NavBar
link they click on. In addition, there are many Entity classes that I
created to support the application, one of which happens to be called
User. In my main form I currently instantiate a User which corresponds
with the user who logged in. The User object that is created
(g_oCurrentUser) is declared as Private in my Main form's code, but
there is a Public function (GetCurrentUser) that returns a pointer to
g_oCurrentUser.
My question is "Is there a way for the entity classes to "get at" the
g_oCurrentUser object from the main form? The reason I need to do this
is because I want to pull the current user's ID to use for populating
the fkLastUpdatedByUserID field of the entities when they have been
changed by the current user.
Is there a way to do this? I guess my question, more generally, is how
can I have Object variables that are accessible both to the Main form
and to other parts of the system (e.g. user controls that will be
created later and shown on the form, other Objects, modules, etc.)?
Main form which shows various user controls depending on which NavBar
link they click on. In addition, there are many Entity classes that I
created to support the application, one of which happens to be called
User. In my main form I currently instantiate a User which corresponds
with the user who logged in. The User object that is created
(g_oCurrentUser) is declared as Private in my Main form's code, but
there is a Public function (GetCurrentUser) that returns a pointer to
g_oCurrentUser.
My question is "Is there a way for the entity classes to "get at" the
g_oCurrentUser object from the main form? The reason I need to do this
is because I want to pull the current user's ID to use for populating
the fkLastUpdatedByUserID field of the entities when they have been
changed by the current user.
Is there a way to do this? I guess my question, more generally, is how
can I have Object variables that are accessible both to the Main form
and to other parts of the system (e.g. user controls that will be
created later and shown on the form, other Objects, modules, etc.)?