Annual Leave Booking Tutorial (ASP.NET, C#, VB, SQL Server)

This tutorial shows how to create an annual leave booking ASP.NET application. Drag and drop day selecting. C# and VB source code included.
Oct 9, 2013
annual leave booking asp.net

This tutorial uses DayPilot Scheduler control to create a simple annual leave booking tutorial.

  • The employees are displayed on the vertical axis and the time line (one year) is displayed on the horizontal axis.
  • Supports half-day intervals, with headers grouped by day and month.
  • Summary column displays total booked day count.

Example: Calculating the year totals

Create a special column for displaying the totals:

<DayPilot:DayPilotScheduler 
  ID="DayPilotScheduler1" 
  runat="server" 
  ...
  >
  <HeaderColumns>
      <DayPilot:RowHeaderColumn Title="Person" Width="80" />
      <DayPilot:RowHeaderColumn Title="Total"  Width="80" />
  </HeaderColumns>
</DayPilot:DayPilotScheduler>

Calculate the summary using the following SELECT command:

SELECT 
  [Person].[PersonId], 
  [Person].[PersonFirst], 
  [Person].[PersonLast], 
  sum(datediff(minute, [ReservationStart], [ReservationEnd])) as [Total] 
FROM 
  [Person] 
  left outer join [Reservation] on 
    [Person].[PersonId] = [Reservation].[PersonId] and NOT (([ReservationEnd] <= @start) OR ([ReservationStart] >= @end)) 
GROUP BY 
  [Person].[PersonId], 
  [Person].[PersonFirst], 
  [Person].[PersonLast] 
ORDER BY 
  [PersonLast], 
  [PersonFirst]

The sample project (including DayPilot Pro trial and C# and VB source) is available for download.

DayPilot for JavaScript, ASP.NET WebForms, ASP.NET MVC, Java