This is a migrated thread and some comments may be shown as answers.

How to get and save the exact user that created a new appointment

3 Answers 34 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Nikola
Top achievements
Rank 2
Nikola asked on 07 Nov 2012, 08:45 AM
Heey Guys

My quest is how to get the current user that is using the scheduler and when he is creating a new Appointment,how  to save  his userId in the same table where the appointment is saved . 


Thanks for fast answer 

Nikola 

3 Answers, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 09 Nov 2012, 03:15 PM
Hello Nikola,

One easy and convenient way to achieve the described functionality would be:
  • Adding a column with name ClientID to the table where you are saving your appointments.
  • Modify your current select,update, delete and insert queries if some exist ( optional in case of using SQL data source).
  • Adding an appointment attribute with name ClientID and a string value equals its number onAppointmentInsert server-side event. 
  • You could implement your custom logic for retrieving the ClientID number. In the attached sample project it is always a value of "23" added to the table column ClientID.
Please find the attached project that implements functionality very similar to your scenario.

Hope that this will lead you into right direction.

Regards,
Boyan Dimitrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Nikola
Top achievements
Rank 2
answered on 09 Nov 2012, 03:25 PM
Heey 

I see your solution and thanks for that but is it somehow possible to to it dynamical because yee it is how to say stupid for a user to know his id ... is there some solution when the user create a new appointment to get his userid and to save it with the new appointment in the same table  
0
Accepted
Boyan Dimitrov
Telerik team
answered on 14 Nov 2012, 11:40 AM
Hello Nikola,

Easy and convenient way for getting a client number would be using the Session or Cookie object for example.  As long as you have a table column for this number in your database you can set it for every appointment as attribute from the code behind. This way it will use that value instead of the "23" as shown in the sample project.
The provided solution will not require each user to select or type this client number since this approach is not creating a resource field to your advanced form.

Hope that this will lead you into right direction.

Regards,
Boyan Dimitrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Scheduler
Asked by
Nikola
Top achievements
Rank 2
Answers by
Boyan Dimitrov
Telerik team
Nikola
Top achievements
Rank 2
Share this question
or