Print Page | Close Window

Caldendar Resource

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=17428
Printed Date: 04 May 2024 at 1:32pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Caldendar Resource
Posted By: cannones
Subject: Caldendar Resource
Date Posted: 14 October 2010 at 11:29am
Hi All,

Does anyone have any pseudo code on how to add resources to a calendar. Essentially all I want to do is show a single date with columns of resource names then add any bookings they may have in the relevant resource column.

You practically require a GPS to navigate through this control. It needs to be explained in plain english together what steps are required ..

Regards,
Sam




Replies:
Posted By: Xander75
Date Posted: 19 October 2010 at 5:41am
Hi

To be honest you should be able to pick apart the code from the code examples, I do unserstand what you mean about this control as it's full of features and there's a lot to it. But you should be able to take what you need from the examples and anything else from this forum.

But here is some code on how I add events to the Calendar Control:


    Dim m_pEvent As CalendarEvent

    ' Create a New event for the Calendar
    Set m_pEvent = CalendarControl.DataProvider.CreateEvent

    ' The following code will add an All Day Event which appears at the top of the Calendar for a given date.
    With m_pEvent
        .StartTime = <Start Date Time Goes Here>
        .EndTime = <End Date Time Goes Here>
        .Subject = <Subject Title Goes Here>
        .Body = <Body Text Goes Here>
        .AllDayEvent = True
        .Label = 10    ' Gives the Event a Colour... The colours are from 1 to 10
    End With

    CalendarControl.DataProvider.AddEvent m_pEvent

    ' Create a New event for the Calendar
    Set m_pEvent = CalendarControl.DataProvider.CreateEvent

    ' The following code will add an Event which appears in the Calendar for a given date.
    With m_pEvent
        .StartTime = <Start Date Time Goes Here>
        .EndTime = <End Date Time Goes Here>
        .Subject = <Subject Title Goes Here>
        .Body = <Body Text Goes Here>
    End With

    CalendarControl.DataProvider.AddEvent m_pEvent

    ' Notes:
    ' AllDayEvent defaults as false therefore is only required to add an AllDayEvent
    ' You don't have to pass a Label Colour, it has a default colour if nothing is passed

    ' The m_pEvent variable used has many more useful events built in, but the above should give you the basics on how to add two types of events to the Calendar Control




I hope this helps.


-------------
Product: Xtreme SuitePro (ActiveX) v15.3.1
Platform: Windows 7 64-bit (SP1) Professional Edition
Languages: C#.Net using Visual Studio 2012 & Visual Basic 6.0 (SP6)


Posted By: cannones
Date Posted: 31 October 2010 at 9:22pm
Hi ,

Thanks you for the snippet .. I actually do have the loading of standard events going. One of the issues I am having is when loading resources.

I used to use the dbi scheduling controls which in relation to understanding the codejock calendar control was like walking to the local shop rather than flying to the moon. 

In my application I only want to display either a 7 day work week or a single day. In the single day view I display all the resources together with what appointment/events they have for that day.

When I switch to 7 day work week I want to display all the appointments/events for that week , but not have the resources appear in the calendar.

So what I need to know is how to I remove all the resources before changing the view type back to a 7 day work week..

I have tried to call the RemoveAll  of the CalendarResourcesManager but the resources still appear..

What am I doing wrong ..

Sam



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net