Exemple #1
0
        public static List <AvailableAppointmentsDTO> AppointmentsToAvailableAppointmentsDTO(List <Appointment> appointments)
        {
            List <AvailableAppointmentsDTO> availableAppointmentsDTO = new List <AvailableAppointmentsDTO>();

            foreach (Appointment appointmentIt in appointments)
            {
                AvailableAppointmentsDTO dto = new AvailableAppointmentsDTO
                {
                    Start = appointmentIt.Period.StartTime,
                    End   = appointmentIt.Period.EndTime,
                };
                availableAppointmentsDTO.Add(dto);
            }
            return(availableAppointmentsDTO);
        }
Exemple #2
0
        public static List <AvailableAppointmentsDTO> AppointmentsToAvailableAppointmentsDTOWithDoctor(List <Appointment> appointments)
        {
            List <AvailableAppointmentsDTO> availableAppointmentsDTO = new List <AvailableAppointmentsDTO>();

            foreach (Appointment appointmentIt in appointments)
            {
                AvailableAppointmentsDTO dto = new AvailableAppointmentsDTO
                {
                    Start          = appointmentIt.Period.StartTime,
                    End            = appointmentIt.Period.EndTime,
                    DoctorId       = appointmentIt.DoctorId,
                    DoctorFullName = appointmentIt.Doctor.Name + " " + appointmentIt.Doctor.Surname
                };
                availableAppointmentsDTO.Add(dto);
            }
            return(availableAppointmentsDTO);
        }