ComponentOne Scheduler for ASP.NET: Working with Scheduler for ASP.NET AJAX > Appointments > Availability Status > Assigning Predefined Statuses to an Appointment

Assigning Predefined Statuses to an Appointment

Availability status can be assigned at run time in the Appointment dialog box through the Availability drop-down list or by adding code to the form at design time.

To assign a contact at run time:

1.   Add a new or open an existing appointment.

2.   In the Appointment dialog box, click the drop-down arrow next to Availability and select one of the statuses.

To assign a status programmatically:

The following code, added the Page_Load event, assigns a Tentative status to an appointment at design time:

      Visual Basic

' Add a new appointment.

Dim app As C1.C1Schedule.Appointment

app = Me.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add()

 

' Set some details for the appointment.

app.Subject = "Meeting"

app.Location = "Large Conference Room"

app.Duration = TimeSpan.FromMinutes(45)

app.Start = New Date(2009, 3, 21, 11, 30, 0)

 

' Assign a predefined availability status to the appointment.

app.BusyStatus = Me.C1Schedule1.DataStorage.StatusStorage.Statuses(C1.C1Schedule.StatusTypeEnum.Tentative)

' OR app.BusyStatus = Me.C1Schedule1.DataStorage.StatusStorage.Statuses.Item(3)

      C#

// Add a new appointment.

C1.C1Schedule.Appointment app;

app = this.C1Schedule1.DataStorage.AppointmentStorage.Appointments.Add();

 

// Set some details for the appointment.

app.Subject = "Meeting";

app.Location = "Large Conference Room";

app.Duration = TimeSpan.FromMinutes(45);

app.Start = new DateTime(2009, 3, 21, 11, 30, 0);

 

// Assign a predefined availability status to the appointment.

app.BusyStatus = this.C1Schedule1.DataStorage.StatusStorage.Statuses[C1.C1Schedule.StatusTypeEnum.Tentative];

// OR app.BusyStatus = this.c1Schedule1.DataStorage.StatusStorage.Statuses[3];

Note that either the StatusTypeEnum enumeration or the Index can be used to set the status availability.

When you run the application, the status is assigned to the appointment.


Send comments about this topic to ComponentOne.
Copyright ComponentOne LLC. All rights reserved.