# Appointments

Learn how to add appointments in C1Schedule application.

## Content



An appointment represents a period of time and detailed information about events that will take place during that period of time. Appointments can span from a specified duration, such as 30 minutes, to multi-day events, and can be set either in code or by binding to a data source, or at run time, either through the context menu or by clicking a specified time on the schedule.

![](https://cdn.mescius.io/document-site-files/images/675b9aff-7616-4324-81ac-58e410fb9531/images/appointments.png)

The code snippet below depicts creating an appointment:

```csharp
// 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(2021, 11, 01, 13, 30, 0);
// Assign a predefined label to the appointment.        
app.Label = this.c1Schedule1.DataStorage.LabelStorage.Labels[6];
// Assign a predefined availability to the appointment.          
app.BusyStatus = this.c1Schedule1.DataStorage.StatusStorage.Statuses[C1.C1Schedule.StatusTypeEnum.Tentative];
// Assign a category to the appointment.        
C1.C1Schedule.Category category;
category = this.c1Schedule1.DataStorage.CategoryStorage.Categories[15];
app.Categories.Add(category);
// Create the Digital Projector resource.         
C1.C1Schedule.ResourceCollection rescol;
rescol = this.c1Schedule1.DataStorage.ResourceStorage.Resources;
C1.C1Schedule.Resource roomres = new C1.C1Schedule.Resource();
roomres.Text = "Digital Projector";
// Insert the resource into the Master Resource List.         
rescol.Insert(0, roomres);
// Assign the resource to the appointment.         
app.Resources.Add(roomres);
```

### Interval Appointments

Appointments that span a specific duration will appear on the schedule during that duration when in [DayView](/componentone/docs/win/online-schedule/), [WeekView](/componentone/docs/win/online-schedule/), or [WorkWeekView](/componentone/docs/win/online-schedule/) views. In the [MonthView](/componentone/docs/win/online-schedule/) view, the appointment will appear on the calendar with the time and subject of the appointment.

![](https://cdn.mescius.io/document-site-files/images/675b9aff-7616-4324-81ac-58e410fb9531/images/appointment-monthview.png)

At run time, an appointment can be created through the Appointment dialog box by setting the Start time and End time drop-downs to the duration of the appointment. For more information on creating appointments at run time, see **Working with Appointments**.

### All-Day or Multi-Day Events

Appointments that are either an all-day event or a multi-day event will appear on the schedule in the area above the schedule when in DayView, WeekView, or WorkWeekView view. For example, the appointment below represents an all-day event.

![](https://cdn.mescius.io/document-site-files/images/675b9aff-7616-4324-81ac-58e410fb9531/images/all-day-appointment.png)

In the MonthView view, the appointment will appear on the calendar with the subject of the appointment within a box.

**Setting an All-Day Appointment**

Appointments can be created in code or at run time through the **Appointment** dialog box. The following code, added to the **Form\_Load** event, creates a new all-day appointment:

```csharp
// Create a new appointment.   
C1.C1Schedule.Appointment app1 = this.c1Schedule1.DataStorage.AppointmentStorage.Appointments.Add();
// Make the appointment an all day event.   
app1.Start = new DateTime(2021, 11, 02, 13, 30, 0);
app1.AllDayEvent = true;
// Set some details for the appointment.   
app1.Subject = "Training";
app1.Location = "Large Conference Room";
// Assign a custom label to the appointment.       
app1.Label = new C1.C1Schedule.Label(Color.DeepSkyBlue, "Meeting", "Meeting");
// Create the contact.       
C1.C1Schedule.ContactCollection contcol;
contcol = this.c1Schedule1.DataStorage.ContactStorage.Contacts;
C1.C1Schedule.Contact contact = new C1.C1Schedule.Contact();
contact.Text = "John Smith";
// Insert the contact into the Master Contact List.       
contcol.Insert(0, contact);
app1.Links.Add(contact);
// Create the Meetings category.       
C1.C1Schedule.CategoryCollection catcol;
catcol = this.c1Schedule1.DataStorage.CategoryStorage.Categories;
C1.C1Schedule.Category meetings = new C1.C1Schedule.Category();
meetings.Text = "Meetings";
// Insert the Meetings category into the Master Category List.       
catcol.Insert(0, meetings);
category = this.c1Schedule1.DataStorage.CategoryStorage.Categories[0];
app1.Categories.Add(category);
```

At run time, an appointment can be created through the **Appointment** dialog box by checking the **All day event** check box. For more information on creating appointments at run time, see [Working with Appointments](/componentone/docs/win/online-schedule/concepts/workingwithappointme).

## See Also

[Labels](/componentone/docs/win/online-schedule/)

[Availability](/componentone/docs/win/online-schedule/concepts/availability)

[Reminders](/componentone/docs/win/online-schedule/concepts/reminders)

[Contacts](/componentone/docs/win/online-schedule/concepts/contacts)

[Categories](/componentone/docs/win/online-schedule/concepts/categories)

[Resources](/componentone/docs/win/online-schedule/concepts/resources)