G
Gerrit
Hallo,
In my application, the user must logon with a username and a password. In
all the tables in my database, there is a field user. By saving new or
changed records, the username is writed to that field.
Now I have a class Session with the User-information.
By opening the program, I have code like this on the mainform:
Session sess = new Session().
sess.UserName = "John";
When I open a new form, then I do this:
frmNew frm = new frmNew(sess);
When I write to the Database, I do this:
Article art = new Article(sess);
etc.
This is working, but I was asking by myself, that maybe there must be
another way to do this.
That I can store the information in a public class or struct and that I can
read this from every other form or class in my program.
Is there another way? And how can I do that?
thank you
Gerrit
In my application, the user must logon with a username and a password. In
all the tables in my database, there is a field user. By saving new or
changed records, the username is writed to that field.
Now I have a class Session with the User-information.
By opening the program, I have code like this on the mainform:
Session sess = new Session().
sess.UserName = "John";
When I open a new form, then I do this:
frmNew frm = new frmNew(sess);
When I write to the Database, I do this:
Article art = new Article(sess);
etc.
This is working, but I was asking by myself, that maybe there must be
another way to do this.
That I can store the information in a public class or struct and that I can
read this from every other form or class in my program.
Is there another way? And how can I do that?
thank you
Gerrit
