database table structure

74 posts, 0 answers
  1. schneeflocke
    schneeflocke avatar
    31 posts
    Member since:
    Jan 2010

    Posted 08 Mar 2011 Link to this post

    Hi,

    how will the entity model look for the new ScheduleView comparing to the old Scheduler?
    Is there a sample or document available describing the table structure needed for the new ScheduleView?

    We are currently developing a solution based on the "old" Scheduler using more or less the sample database layout described here: http://www.telerik.com/help/silverlight/radscheduler-populating-with-data-ria-service-creating-database.html

    We just want to figure out if there are changes to the entity model an how big they are.

    Thanks

    Stefan
  2. Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 10 Mar 2011 Link to this post

    Since in RadScheduleView the IAppointment properties are virtually the same as in RadScheduler, the database structure will be very similar. We are preparing a new reference application that will demonstrate the best way in our opinion to store appointments, resources, categories and time markers in a database. It will be available shortly after the Q1 2011 release next week.

    Regards,
    Valeri Hristov
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
  3. DevCraft banner
  4. Michael Rodriguez
    Michael Rodriguez avatar
    8 posts
    Member since:
    Oct 2009

    Posted 17 Mar 2011 Link to this post

    Where will that reference application be published and how can I see it?
  5. George
    Admin
    George avatar
    1332 posts

    Posted 23 Mar 2011 Link to this post

    Hi Michael,

     
    We are preparing some blog posts about this scenario. They will be published on our site by the end of this week.

    Best wishes,
    George
    the Telerik team
  6. Sami
    Sami avatar
    12 posts
    Member since:
    Feb 2011

    Posted 25 Mar 2011 Link to this post

    Hi, do you have any new about this demo?
    Thanks in advance.
  7. George
    Admin
    George avatar
    1332 posts

    Posted 28 Mar 2011 Link to this post

    Hello,

     
    As I said - we are working on such integration example - how to use RadScheduleView control with RIA services (and using EF in WPF). Here are some instructions how to run the project:

    1. Run the ScheduleViewDB.sql file in your Management Studio. This will generate the Database for the RadScheduleView control.
    2. Create some resource types and resources in the database. The RadScheduleView control needs them in order to populate the ResourceTypesSource collection.
    3. Open the ScheduleView_EF_SL solution and modify the connection string in the ScheduleView_EF_SL.Web project in the Web.config file.
    4. Place the Telerik dlls in the Binaries folder.
    5. Run the project.

    You could create, edit, delete appointments in run time. Every time you click the Save button, the changes will be saved in the database. No additional code is required. For the purpose of a real-time application, the Appointments are loaded from the database in the visible range only.

    Here are some explanations about the project:
    • The Database is designed to store the objects in the AppointmentsSourceResourceTypesSourceTimeMarkersSourceCategoriesSource and their resources, exceptions, etc.
    • Please, pay attention to that the relation between the SqlAppointments and SqlResources is many-to-many. The same is for SqlExceptionAppointments and SqlResources. Unfortunately, the Ria Service doesn't support many-to-many relations at this stage. That's why we are using the following workaround - http://m2m4ria.codeplex.com/ 
    • All entities (models) implement interfaces so they can be plugged in the RadScheduleView control.
    • The application is written using the MVVM pattern.

    Attached you can find the files. Please do not hesitate to contact us if you require any further information.


    Greetings,
    George
    the Telerik team
  8. sta
    sta avatar
    34 posts
    Member since:
    Mar 2011

    Posted 02 Apr 2011 Link to this post

    Seem like one of your projects is missing, its unable to load, and the archive doesn't contain it.
    Can you please create another zip and attach it?
    Thank you - greatly appreciated!
    Note that project that is missing is ScheduleView_SL - cannot load on first opening and is unavailable in the solution. Archive, as mentioned, doesn't contain the project.

    Thank you very much in advance
  9. George
    Admin
    George avatar
    1332 posts

    Posted 04 Apr 2011 Link to this post

    Hi,

     
    Please, accept my apologies for this error in the attached project. Here is the modified project. Please, let me know if you need any further information.

    Best wishes,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  10. Scott
    Scott avatar
    42 posts
    Member since:
    Feb 2009

    Posted 07 Apr 2011 Link to this post

    Hi All,

    Thanks very much for the MVVM samples. Can you confirm the recommended approach for persisting recurrence exceptions to the database in the futrue of the RadScheduleView control?

    Similar to the first post in this thread, we've been developing a solution based on the RadScheduler. Because that control is being phased out in favour of the RadScheduleView, we're migrating to the RSV control. I've downloaded the ScheduleView-EF-SL.zip sample solution which is very helpful. However to date, your sample solutions put forth at least three different approaches for persisting recurrence exceptions in the database. The first solution we followed (http://www.telerik.com/help/silverlight/radscheduler-populating-with-data-ria-service-creating-database.html) used an nvarchar(4000) ExceptionAppointments column for serialized exceptions. The second solution we followed (http://www.telerik.com/support/kb/silverlight/scheduler/manage-data-for-radscheduler-using-ria-services.aspx) uses a self-referencing SqlAppointments table/entity with a ParentID and Type to manage recurrence exceptions. The third sample solution presented in this thread uses a SqlExceptionAppointments entity/table which is almost an exact duplicate of the SqlAppointments entity/table.

    Is there a reason you moved away from the sel-referencing SqlAppointment entity for recurrence exceptions?

    Thanks,
    Scott
  11. Stelios Polykarpou
    Stelios Polykarpou avatar
    1 posts
    Member since:
    Mar 2010

    Posted 12 Apr 2011 Link to this post

    Hi, can you please post the same example using VB.net?
  12. Scott
    Scott avatar
    42 posts
    Member since:
    Feb 2009

    Posted 13 Apr 2011 Link to this post

    Bump... George? Is anyone at Telerik still monitoring this thread?

    Thanks,
    Scott
  13. George
    Admin
    George avatar
    1332 posts

    Posted 14 Apr 2011 Link to this post

    Hello Scott,

    The reason why we store tha appointments and the exceptions in two different tables is due to the usage of different approach for binding the ScheduleView with a SqlDataBase in this example.

    With its current version RadScheduleView exposes some new interfaces: ITimeMarker, IResourceType, IResource, IRecurrenceRule, IExceptionOccurrence, IAppointment, IAppointment, ICategory. The implementation of these interfaces spares the need to create custom appointments and mapping their properties to the database entities. Because the entities (using RIA Services/EF) are partial classes and you can plug them directly in the RadScheduleView via the ViewModel, and since each change in an entity is automatically tracked by RIA/EF, we don't need to track it manually.
     
    The reason for splitting the appointments and the exceptions is because they are actually two different objects. They have very common properties, but it has some major differences - for example, the exceptions don't have recurrence and exceptions. This makes sense when implementing the Copy and CopyFrom methods. If an exception is copied, we need to perform a slightly different operation. Also, it is easier to support, to make changes and to track which IAppointment is being copied (Appointment or Exception).

    Regards,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  14. sta
    sta avatar
    34 posts
    Member since:
    Mar 2011

    Posted 14 Apr 2011 Link to this post

    Hi George,

    Thanks for the info. Is there any organized documentation about how to work with database and RIA using ScheduleView? Scheduler for example have multiple examples that can be built upon. Not so with ScheduleView and unfortunately so.
    If I missed those, can you please point me to the right direction?
    The example above is quite useful - thanks a lot, but I am looking for documented way of things.
    For example: database structure is such and such. Ria is such and such. To create an appointment in the database do : 1. 2. 3 

    Thank you a lot.
  15. Scott
    Scott avatar
    42 posts
    Member since:
    Feb 2009

    Posted 14 Apr 2011 Link to this post

    Hi George.

    That makes sense. We'll forge ahead with the data model / database schema outlined in ScheduleView-EF-SL.zip sample. The extra interfaces you mentioned make the MVVM binding much easier--thanks.

    Cheers,
    Scott.
  16. sta
    sta avatar
    34 posts
    Member since:
    Mar 2011

    Posted 20 Apr 2011 Link to this post

    HI George,

    Can you please shed some light as to why did you have to define model classes on the client side, while they all are already defined by EF on the server. Seem like unnecessary duplication, but there must be some reason you did it. Please respond. 

    Thank you in advance.
  17. Scott
    Scott avatar
    42 posts
    Member since:
    Feb 2009

    Posted 21 Apr 2011 Link to this post

    @sta:

    Do you mean the model partial classes in the ScheduleView_EF_SL project (versus the ScheduleView_EF_SL.Web project)? George can confirm, but I believe they are necessary in order to implement the required client-side interfaces such as IAppointment, IRecurrenceRule, IResource, IObjectGenerator, etc., on the RIA Service code-generated model classes. Some of those interfaces require code implementations as well as simple public properties.

    For example, the SqlResource.cs class generated by the RIA Services code generator could not be used properly by the RadScheduleView control without the client-side addition of the Telerik.Windows.Controls.IResource interface.

    Scott
  18. sta
    sta avatar
    34 posts
    Member since:
    Mar 2011

    Posted 21 Apr 2011 Link to this post

    @Scott,

    Scott, thanks a lot, it actually makes sense, just wanted to double confirm that I am not missing something. Thanks a lot!
  19. sta
    sta avatar
    34 posts
    Member since:
    Mar 2011

    Posted 25 Apr 2011 Link to this post

    @George

    in the example you've provided the following scenario crashing the application (and is reproducible) : 
    Run application, open new appointment dialog, click "edit recurrence". Just opening this dialog crashes the silverlight.
    Unfortunately there is no way for me to debug this issue, since those dialogs are built in.
    Can you please shed some light on how to overcome / workaround this issue?

    Thank you very much in advance.
  20. George
    Admin
    George avatar
    1332 posts

    Posted 26 Apr 2011 Link to this post

    Hello,

     
    Could you please let us know what is the error message? I tried to reproduce the problem, but to no avail. Attached you can find a video. Please, let me know if I miss something, I am glad to assist you further.

    Meanwhile, please double check whether you have modified the connection string in the Web.config file. It could be a database connection problem.

    Regards,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  21. sta
    sta avatar
    34 posts
    Member since:
    Mar 2011

    Posted 26 Apr 2011 Link to this post

    @George,

    Many thanks George. I watched a video, indeed you have no issues. I have this issue every time I click "edit recurrence". Silverlight plugin just crashes, the error message saying that I am accessing memory that is not accessible.
    I ran the same app in different environment - no issue, so I tend to blame my environment. 
    I will keep you posted if and when I manage to resolve the issue with my environment.

    For now - thanks a lot for prompt response. It certainly projects confidence and means a lot! 

  22. sta
    sta avatar
    34 posts
    Member since:
    Mar 2011

    Posted 05 May 2011 Link to this post

    @George,
    Hi George, better late than never. Here's my findings: problem is 64bit system
    I ran the same code on 32 bit installation (same libraries and everything).
    What was crushing on 64 bit as per my description above still does, but works on 32 bit fine.
    Also another observation: I made a context menu precisely as on your examples.
    It works as the example on 32 bit, it has weird behavior on 64 bit: regardless on where I right click (on appointment or off) I have both "open" and "delete" enabled, while on 32 bit its only enabled on right click event on appointment, and grayed out when right click is off the appointment, which is should be.
    Please advise if there are any workarounds or special libraries I have to use with 64 bit system (which I assume is the cause of this strange behaviour of ScheduleView control)

    I am running on Windows 7 64 bit, for testing the behaviour used Chrome and IE9, both show the same (problematic) behavior.

    Thanks.
  23. George
    Admin
    George avatar
    1332 posts

    Posted 09 May 2011 Link to this post

    Hello,

     
    This sounds truly strange because we are testing the RadControls with the Windows 7 64bit as well and there are no problems. Please, check your silverlight version on both machines here - http://www.microsoft.com/getsilverlight/Get-Started/Install/Default.aspx.

    Regards,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  24. sta
    sta avatar
    34 posts
    Member since:
    Mar 2011

    Posted 11 May 2011 Link to this post

    @George,

    Thanks for the link, checked, 32 and 64 bit are using the very same silverlight version, also the very same telerik release.
    However, I figured that my compilation gives me following few warnings, that I wasn't paying much attention:

    Could not load file or assembly

    'System.Windows, Version=2.0.5.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' or one of its dependencies. The system cannot find the file specified.


    Full compilation dump is attached. Can that be related to my 64 bit misbehaving?
    Thanks!

  25. George
    Admin
    George avatar
    1332 posts

    Posted 19 May 2011 Link to this post

    Hello,

     
    Please, refer to the following forum thread where you can find additional information about this error - http://www.telerik.com/community/forums/silverlight/general-discussions/280342.aspx

    I hope this helps.

    Best wishes,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  26. Sachin
    Sachin avatar
    4 posts
    Member since:
    Nov 2010

    Posted 27 May 2011 Link to this post

    Hi,

    I was trying to use the project you posted here. I followed the instructions, created the database and changed the connection string in web.config. But for some reasons, it is unable to store appointments. I create appointment, click on save, it doesn't give me any error but when I come back to see the appointments created, nothing exists tehre. So I checked the database and found that it is empty. What's going wrong here? I am using SQL Server 2008 and VS 2010. Also is there any formal documentation for implementating ScheduleView with RIA services?
  27. sta
    sta avatar
    34 posts
    Member since:
    Mar 2011

    Posted 27 May 2011 Link to this post

    @Sachin

    Hi. I took the provided example and it worked completely, except few little things like I described above, I guess related to some versioning issues. My take on your problem is to try first to understand what tables are storing what data, make sure you are pointing to the right database (happened to me I was writing to one database while thinking I am writing to another - took few hours to realize that before pulling the last hair). Bottom line - example provided works.

    BTW did anybody managed to put this appointments schema into business template project so that appointments are per user rather than for everybody? 

     Good luck
  28. George
    Admin
    George avatar
    1332 posts

    Posted 02 Jun 2011 Link to this post

    Hello,

    Currently we are preparing a formal, very detailed documentation that explains how to populate the RadScheduleView with RIA Services and EF from database. We will pronounce it when it is ready and the document will be attached to this thread as well.


    Best wishes,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  29. sta
    sta avatar
    34 posts
    Member since:
    Mar 2011

    Posted 02 Jun 2011 Link to this post

    Hi George,

    This is great news, I think that many people are waiting for this passionately. My 2 cents in this is if you can include the integration of the code you've provided (or similar example) into business template so that every member (aspnet_user) has his own set of appointments, which may include user, user profile, Entity Framework all working in one solution.
    As a  standalone code that you provided example for is great to show how to work with it and what it does, but not real life scenario, if you know what I mean. Please consider it as a feedback.

    Thanks in advance!
  30. George
    Admin
    George avatar
    1332 posts

    Posted 07 Jun 2011 Link to this post

    Hello,

     
    Thank you for your feedback, we will consider implementing such scenario. Meanwhile, you can find the attached zip file that contains a document and two diagrams. 

    I hope this helps. Please do not hesitate to contact us if you require any further information.


    Kind regards,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  31. sta
    sta avatar
    34 posts
    Member since:
    Mar 2011

    Posted 16 Jun 2011 Link to this post

    Hi George,

    thanks for the documentation, it really helps. however, as I said before, it will help even better some working example with business template application.
    reason for this posting is different however. I think I found a bug in the sample provided above:
    in the ScheduleViewViewModel.cs file there's a method called GenerateAppointments, that looks like this:
    private void GenerateAppointments(DateSpan dateSpan)
    {
    this.Appointments.Clear();
    this.IsLoading = true;


    ScheduleViewRepository.Context.Load(ScheduleViewRepository.Context.GetSqlExceptionAppointmentsQuery());
    ScheduleViewRepository.Context.Load(ScheduleViewRepository.Context.GetSqlExceptionOccurrencesQuery());
    ScheduleViewRepository.Context.Load(
    ScheduleViewRepository.Context.GetSqlAppointmentsByRangeQuery(dateSpan.Start, dateSpan.End)).Completed += (o, e) =>
    {
    this.Appointments.AddRange((o as LoadOperation).Entities.Select(a => a as SqlAppointment));
    this.IsLoading = false;
    };
    }

    I think that the first line in the method (clearing appointments) should be right before the AddRange call. At least in my case here, I have this method called 3 times on visibility range changed event and instead of generating 2 appointments that I have saved in the database, it shows 6 : every appointment is duplicated 3 times basically. This must be tested in the following way: you must get those appointments right on the screen (not playing with the control to get to them, but directly to show on the screen after the RIA call.
    I wonder if its just my environment causing this even to be fired 3 times, but anyway, just wanted to point it out and see if anybody else faced the same issue and if this is really a bug in the example. 
    Thank you in advance, George



     
Back to Top
DevCraft banner