1 (edited by eserjbrujo 2022-07-12 03:51:32)

Topic: ID User

Hello everyone!

Some ideas for my problem, I hope you can help me, Thank you for your time and support!

I made a database for the registration of certain units, the database works perfectly, but I have a problem when a user registers a unit since he does not put his employee number, he invents a non-existing employee number, any idea how to be able to control, that they put their assigned employee number.

Example: Valid employee number 2461

Example: Invalid employee number 9999979


Thank you so much!!

Best regards.

Post's attachments

Attachment icon Capture.5JPG.JPG 54.32 kb, 96 downloads since 2022-07-12 

Re: ID User

your indicated valid employee number is vague. can you elaborate it?
is it all emp no must be a 4 digit number or must 1 to 9999? Or which is which?

brian

Re: ID User

could be assigned some numbers to say if I have 20 employees it would be: 0001,0002...0020,
or would it be specific numbers that you can register,  Who can save and who can't!,
I don't know if I explain myself sad

Re: ID User

can be compared
You need to store the actual numbers in the database and compare the entered ones.
 
можно сравнивать
Вам нужно хранить действующие номера в БД и сравнивать введенные.

Re: ID User

Hi All,
Eserjbrujo, have you considered using the standard MVD 'roles and users' functionality?
In the attached example, I'm using a spare field (email) in the _user table to hold the employee number but you could use a separate table  (I just wanted to keep it simple).
How it works?
1.  Employees are set up with user ids and passwords (using the standard MVD functionality).
2. Their employee number is entered in to the (spare) email field
3.  As soon as they log on, all of the details from the _user table, including the employee number (email) are available throughout the application.
4.  The Employee Number is pre-set to the logged in User when adding a new record and the field is made read-only.
5.  The Employee Number is pre-set to the logged in User when editing a new record and the field is made read-only.  This allows you to see both who created the record and who might have edited it.
You could actually take both the 'added by' and the 'edited by' off the body of the form itself and put them into the form's caption so visually it is much clearer that this is something that the user does not have access to.
You also get a lot of additional features using MVD's role-based functionality - you mentioned something about who can save and who cannot - this is made very easy using 'roles'.
Maybe this is an option for you?
In the attachment, the passwords are the same as the user-ids (all lower case).
Derek.

Post's attachments

Attachment icon validate employee.zip 338.62 kb, 251 downloads since 2022-07-12 

Re: ID User

Thank you very much Derek, I'll start working on it, very good idea thanks for your time and support

Best regards