Author Topic: Determine user  (Read 8549 times)

1c3m4n

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Determine user
« on: October 15, 2010, 11:50:24 pm »
Hi,

i get the currently logged in user by using the command

Code: [Select]
repository.GetCurrentLoginUser(false);
Is it possible to determine the forename and surname of this user?

Have a nice weekend.

Florian
« Last Edit: October 15, 2010, 11:51:44 pm by 1c3m4n »

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13286
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Determine user
« Reply #1 on: October 16, 2010, 12:52:48 am »
Florian,

I think the only way is to query the t_secuser table.
You can use Repository.SQLQuery to execute a query to the database.

Geert

1c3m4n

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Determine user
« Reply #2 on: October 18, 2010, 05:34:08 pm »
Hi Geert,

thank you for your answer. Can you please specify what i need to write in the SQL string parameter of the SQLQuery function.

Thanks.

Florian

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13286
  • Karma: +556/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: Determine user
« Reply #3 on: October 18, 2010, 05:56:20 pm »
Something like
Code: [Select]
"Select u.FirstName, u.Surname from t_secuser u
where u.UserLogin = '" + loginVariable + "'"
should do the trick.

Geert
« Last Edit: October 18, 2010, 05:56:47 pm by Geert.Bellekens »

1c3m4n

  • EA User
  • **
  • Posts: 20
  • Karma: +0/-0
    • View Profile
Re: Determine user
« Reply #4 on: October 18, 2010, 06:21:05 pm »
It works !

Thank you !

Florian