Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
540
WebMonthView And Third Shift Appointment Issues
posted

Hello,

I am having an issue with the webMonthView control.  Everything works well except when trying to display appointments that are "3rd shift" in nature.  We use the calender to show employee work schedules.  Whenever there is a 3rd shift employee checking their schedule, the appoints are usually 2200 - 0600, or some variation of that.  The problem is that I only want the appoint to show on one day, which would be the 2200 day.  So if the appointment was 3/31/11 2200 - 4/1/11 0600, I only want the appoint to be on the date of the start time, 3/31/11.  Is there any way to make this happen?  The original creator of this project utilized a custom data provider class to add the appoints, a webMonthView control and a webScheduleInfo control.  Below is the code from each:

WebMonthView Control - Client Code:

<igsch:WebMonthView ID="empMonthView" runat="server" AppointmentFormatString="&lt;START_DATE_TIME&gt;&amp;nbsp;"

WebScheduleInfoID="WebScheduleInfoDailyRoster" EnableMultiResourceCaption="True"

MultiDayEventFromArrowCaption="" MultiDayEventToArrowCaption="" StyleSetName=""

StyleSetPath="" StyleSheetDirectory="" EnableAutoActivityDialog="False" TimeLabelFormatString="HHmm"

WeekendDisplayFormat="Full" Height="450" Width="450">

</igsch:WebMonthView>

WebScheduleInfo Control - Client Code:

<igsch:WebScheduleInfo ID="WebScheduleInfoDailyRoster" runat="server" StyleSetName=""

StyleSetPath="" StyleSheetDirectory="" EnableMultiDayEventBanner="False"

EnableMultiResourceView="True">

</igsch:WebScheduleInfo>

 CustomDataProvider.cs - Server Code snippet:

private void FetchActivities(FetchActivitiesContext context)

{

// Clear any existing activities

context.Activities.Clear();

//Boolean bTakeTurn = false;

if (rosterList != null)

{

foreach (DailyRosterDC ddc in rosterList)

{

// Create a new Appointment with a reference to the ScheduleInfo object that requested the fetch

Appointment appointment = new Appointment(this.WebScheduleInfo);

// Configure the Appointment with the information in the data source

appointment.Key = ddc.DailyAttendanceID.ToString();

appointment.Subject = ddc.AssignmentName + " " + ddc.ProxyType;

appointment.Description = ddc.PositionName;

if (ddc.ShiftStartTime != null && ddc.ShiftEndTime != null)

{

appointment.StartDateTime = new SmartDate((DateTime)ddc.ShiftStartTime);

appointment.EndDateTime = new SmartDate((DateTime)ddc.ShiftEndTime);

}

else

{

appointment.StartDateTime = new SmartDate(ddc.RosterDate.Date);

appointment.EndDateTime = new SmartDate(ddc.RosterDate.Date.AddDays(1).AddMinutes(-1));

}

// Add the Appointment to the Activities list in the context

((IList)context.Activities).Add(appointment);

}

}