Click here to Skip to main content
15,896,201 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am making a user form in Delphi for documents tracking application. I am interested in functionalities input new entry (record) and view list by... (date, name of document, ID,...).

My problem is that I don't know how to implement these functionalities for more than one user. Currently, I have 5 users. Each user has a unique input data (record) fields (columns) and view fields (columns) of each user are also unique. There could be more users.

So, how to implement these functionalities for this form? How to assign different data (fields) for each separate user for input and view? That is what I don't understand. Is that distributed functionality of an application? If yes, how to achieve it?

Note that I don't want static assigning of a user in application's code, e.g:

Delphi
if(username='user1') then {
input();
view();
}
else if (username='user2') then {...}
...


because, than, every time there is a new user, developer must go back to the application's code and hard-code it. That is not efficient and is a bad implementation. Instead of this happening, the way to do this is to have in db a table of users and their details. Then write document tracking code to handle the user which is the current record in the Users table. This shouldn't require any conditional tests on a user's identity in code at all. hHow to achieve this? Could you show a concrete code sample or give a reference on it? I really don't know how to do this.



Note: I am using dbExpress tool with MySQL DBMS with RAD Studio XE7 Architect.

What I have tried:

Static (hard-coded) implementation, which is bad and not efficient:

Delphi
if(username='user1') then {
input();
view();
}
else if (username='user2') then {...}
...
Posted

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