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

[Solved] checking Resoucr availabilty in radscheduler while editing an occurence

1 Answer 49 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Chinnu Prabhakar
Top achievements
Rank 1
Chinnu Prabhakar asked on 25 Sep 2009, 06:02 AM
Hi friends,
   I'm using a radscheduler with recurrence facility, I'm also checking resouce availability in this , wht my problem is , i will expalin this using an example

i have 2 rooms R1 and R2  and 3 users - A,B,C

A and B has meeting in R1 at 10am - 11 am
so i cant schedule meeting for A & B at the same time in room R2 - i checked this , and there is no problem

suppose i'm using a recurrence and no problem while inserting the appointment , problem is while ediiting that recurrence

while ediiting 2 options will ask

1. edit this occurence
2. edit the series

while editing  the 1st option i'm getting an error - object reference not set to an instance of an object
for second option no pblm is there

here is the code

private IEnumerable<Resource> GetResources(string resType)
        {
            List<Resource> availableUsers = new List<Resource>(Owner.Resources.GetResourcesByType("User"));
            List<Resource> availableResources = new List<Resource>();
            IEnumerable<Resource> resources = Owner.Resources.GetResourcesByType(resType);
            
            foreach (Appointment appointmentInRange in Owner.Appointments.GetAppointmentsInRange(Appointment.Start, Appointment.End))
            {
                if (appointmentInRange == Appointment)
                    continue;

                foreach (Resource occupiedUser in appointmentInRange.Resources.GetResourcesByType("User"))
                {
                    availableUsers.Remove(occupiedUser);
                }
                if (availableUsers.Count == 0)
                {
                    found = true;
                }
            }

            return availableUsers;          
        }

Please help... If anyone of u have an idea

thanking You
Regards
Chinnu

1 Answer, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 26 Sep 2009, 09:34 AM
Hello Chinnu,

Can you isolate the problem in a simple working demo and send it to us for testing?


Greetings,
Peter
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Scheduler
Asked by
Chinnu Prabhakar
Top achievements
Rank 1
Answers by
Peter
Telerik team
Share this question
or