Exemplo n.º 1
0
        private static AppointmentDTO MapFromCatalystPreloadEntry(TimesheetPreloadEntry data)
        {
            var dto = new AppointmentDTO
            {
                UniqueID       = data.ID * -1,
                StartDate      = data.Date.Date,
                EndDate        = data.Date.Date,
                Subject        = GetCatalystDescription(data.Notes),
                Description    = null,
                Location       = null,
                AllDay         = true,
                Type           = 0,
                RecurrenceInfo = null,
                ReminderInfo   = null,
                Label          = 0, // white
                Status         = 0,
                ResourceID     = 0,
                CustomField1   = null
            };

            return(dto);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Converts an instance of CaseAuthorizationHours to an AppointmentDTO.
        /// </summary>
        /// <param name="hours">CaseAuthorizationHours instance to map.</param>
        /// <returns></returns>
        private static AppointmentDTO MapFromDomainAppointment(Domain.Cases.CaseAuthorizationHours hours)
        {
            var dto = new AppointmentDTO
            {
                UniqueID       = hours.ID.Value,
                StartDate      = new DateTime(hours.Date.Year, hours.Date.Month, hours.Date.Day, hours.TimeIn.Hour, hours.TimeIn.Minute, 0),
                EndDate        = new DateTime(hours.Date.Year, hours.Date.Month, hours.Date.Day, hours.TimeOut.Hour, hours.TimeOut.Minute, 0),
                Subject        = hours.Service?.Name,
                Description    = null,
                Location       = null,
                AllDay         = false,
                Type           = 0,
                RecurrenceInfo = null,
                ReminderInfo   = null,
                Label          = GetDTOLabelFromDomainStatus(hours.Status),
                Status         = 0,
                ResourceID     = 0, // must have resource mapped! (use ResourceDTO.GetDefaultResource())
                CustomField1   = null
            };

            return(dto);
        }