Example #1
0
        private void AddRecurringAppointment()
        {
            atriumDB.AppointmentRow newApptRow;
            atriumDB.AttendeeRow    newAttRow;

            newApptRow        = (atriumDB.AppointmentRow)myA.GetAppointment().Add(null);
            newApptRow.FileId = originalApptRow.FileId;
            if (!originalApptRow.IsActivityIdNull())
            {
                newApptRow.ActivityId = originalApptRow.ActivityId;
            }
            newApptRow.StartDateLocal = trackDate;
            newApptRow.EndDateLocal   = trackDate + tsAppointmentLength;
            if (!originalApptRow.IsTypeNull())
            {
                newApptRow.Type = originalApptRow.Type;
            }
            if (!originalApptRow.IsSubjectNull())
            {
                newApptRow.Subject = originalApptRow.Subject;
            }
            newApptRow.ShowAsBusy  = originalApptRow.ShowAsBusy;
            newApptRow.AllDayEvent = originalApptRow.AllDayEvent;
            if (!originalApptRow.IsDescriptionNull())
            {
                newApptRow.Description = originalApptRow.Description;
            }
            if (!originalApptRow.IsLocationNull())
            {
                newApptRow.Location = originalApptRow.Location;
            }
            newApptRow.Tentative        = originalApptRow.Tentative;
            newApptRow.Vacation         = originalApptRow.Vacation;
            newApptRow.ApptRecurrenceId = originalApptRow.ApptRecurrenceId;

            // add attendees to new recurring appointment
            foreach (atriumDB.AttendeeRow originalAttRow in originalAttRows)
            {
                newAttRow           = (atriumDB.AttendeeRow)myA.GetAttendee().Add(newApptRow);
                newAttRow.FileId    = originalAttRow.FileId;
                newAttRow.ContactId = originalAttRow.ContactId;
                newAttRow.Accepted  = originalAttRow.Accepted;
                newAttRow.Declined  = originalAttRow.Declined;
                newAttRow.Required  = originalAttRow.Required;
                newAttRow.Tentative = originalAttRow.Tentative;
            }
        }