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

[Solved] Custorm or Resources

3 Answers 135 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Yamil
Top achievements
Rank 1
Yamil asked on 28 May 2008, 03:34 AM
Hi
I would like to use the RadScheduler to keep tracks of holiday and "working" hours (and days) for a group of doctors.
My user double click in a cell of the RadScheduler and using a RadWindow to show an aspx to edit the data for the appointment.
A dropdownlist allows to select the date and hour for available or non-available. If it is non-available the user must why this
day is holiday (vacation, independe day, labor day, etc) and if it is available specify which medicine category the doctor will work for (
ginecology, pediatrics, etc).

I need some hints about how to implement this. I am thinking about to have a subclass from appointment class sho in the docs but further
reading makes me think this is a hard way to do it. Now I am thinking to use resources and Custom attributes but I am confused about them.
I wil have two datatable, one for the holidays, one for the working dates and also have in datatable the reasons for non-working days,
medicine categories, doctor details (id, name, etc), medicine categories by doctor so I am not sure what things are resources and which ones are
attributes.
The tables are defined :
   - Category(idCategory int, NbCategory varchar(100)) Eg. 1, "Ginecology", 2,"Heart Surgery"
   - Doctor(IdDoctor int, NbDoctor varchar(255)) Eg. 1, "Yamil Bracho"
   - CategoryDoctor (IdCategory int , IdDoctor int) Eg. 1,1 - 1,2
   - ReasonHoliday (IdReason int, NbReason varchar(255)) Eg. 1,"Vacation" - 2,"Labor Day"
   - Holiday(IdHoliday int, IdDoctor int, IdReason int, StartTime DateTime, EndTime DateTime) Eg. 1,1,1,05/01/08 08:00:00 AM,05/15/08 06:00:00 PM
   - WorkDay(IdWorkDay int, IdDoctor int, IdCategory int, StartTime DateTime, EndTime DateTime) Eg. 1,1,1,01/01/08 08:00:00 AM, 01/01/01/08 12:00:00

 Thanks you for your time 

3 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 30 May 2008, 05:27 AM
Hi Yamil,

After reviewing the description of your scenario, I think you should use Resources for all additional appointment information. The reason I recommend this approach is because you already have data tables for the various additional appointment details. You can easily create resources from these tables. You can see the Defining Resources example for reference.

If you have further questions, feel free to contact us.


Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Yamil
Top achievements
Rank 1
answered on 02 Jun 2008, 01:22 PM
Thanks a lot for your answer. I will do that way.
Regarding the problem when you click in the appointment, for example, at 8:00 am and got 12:00 pm I found there is a problem with javascript getUTCHours() so change to var hour = padNumber(date.getUTCHours()-4, 2) and it works Ok. the complete code is:

 
function formatDate(date) 
 { 
    var temp = date.toGMTString() ;    // convert date to a GMT string; 
    date = new Date(temp);    // convert string to a Date object 
             
    var year = padNumber(date.getUTCFullYear(), 4); 
    var month = padNumber(date.getUTCMonth() + 1, 2); 
    var day = padNumber(date.getUTCDate(), 2); 
    var hour = padNumber(date.getUTCHours()-4, 2); 
    var minute = padNumber(date.getUTCMinutes(), 2); 
     
   return year + month + day + hour + minute; 


        
0
Peter
Telerik team
answered on 02 Jun 2008, 02:57 PM
Hello Yamil,

Thanks for the feedback. We wish you good luck with your project. If you experience any problems, don't hesitate to contact us.


Peter
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Scheduler
Asked by
Yamil
Top achievements
Rank 1
Answers by
Peter
Telerik team
Yamil
Top achievements
Rank 1
Share this question
or