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

Save with UserId

4 Answers 60 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Nikola
Top achievements
Rank 2
Nikola asked on 09 Nov 2012, 01:50 PM
heey Guy

I got a short question is it some how possible to save a appointment with the usual table id and a foraging key 
some code example would be good 


Thanks for help and  fast answer 

4 Answers, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 13 Nov 2012, 11:59 AM
Hi Nikola,

 
Here is the database structure that we recommend for RadScheduler. Please review it and if you still have questions please elaborate a little bit what exactly are you trying to change it because it is not quite clear from the explanation provided.

Regards,
Plamen
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 13 Nov 2012, 12:15 PM
heey 
thanks for help that helps^^
 
but know i have some strange errors when im trying to save the userid 

public static int GetUserIdByLogin(string p, HolidayTrackerEntities ctx, String login)
       {
           HtUser retUser = null;
           
           int backslashIndex = login.IndexOf("\\");
           String domain = backslashIndex >= 0 ? login.Substring(0, backslashIndex) : "";
           String username = backslashIndex >= 0 ? login.Substring(backslashIndex + 1, login.Length - backslashIndex - 1) : login;
 
           retUser = ctx.HtUsers.Where(au => au.UserName.ToLower() == username.ToLower()).Single();
 
            
       }
Error 1 'HolidayTracker.Data.Model.HtUser.GetUserIdByLogin(string, HolidayTracker.Data.Model.HolidayTrackerEntities, string)': not all code paths return a value C:\Development\Projects\Vs2012\HolidayTracker\HolidayTrackerData\Model\HtUser.cs 265 27 HolidayTrackerData


protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
       {
           if (ExceedsLimit(e.Appointment))
           {
               e.Cancel = true;
               RegisterScript();
           }
           else
           {
               int id = HtUser.GetUserIdByLogin(Page.User.Identity.Name);
               e.Appointment.Attributes.Add("UserId","1");
           }
       }
Error 10 'HolidayTracker.Data.Model.HtUser' does not contain a definition for 'GetUserIdByLogin' C:\Development\Projects\Vs2012\HolidayTracker\HolidayTracker\User\UserScheduler.aspx.cs 66 33 HolidayTracker

why is here a error ? 

thanks for help 
0
Plamen
Telerik team
answered on 13 Nov 2012, 01:37 PM
Hello Nikola, 

 
I have inspected the code shared and the error observed but it does not seems to be connected with RadControls but rather to your custom implementation. Please let me know if I am missing something.

Regards,
Plamen
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 13 Nov 2012, 01:41 PM
heey

nope it was my error but thanks for your time !!


Tags
Scheduler
Asked by
Nikola
Top achievements
Rank 2
Answers by
Plamen
Telerik team
Nikola
Top achievements
Rank 2
Share this question
or