Beispiel #1
0
        static public ICollection <DoctorDTO> GetSomeDoctors()
        {
            GHRepository <Doctor> repo        = new GHRepository <Doctor>();
            List <Doctor>         doctors_old = new List <Doctor>(repo.GetEntities(x => x.Id > 0).ToList().OrderBy(x => x.Surname));

            ObservableCollection <DoctorDTO> doctors = new ObservableCollection <DoctorDTO>();
            DoctorDTO doctor;

            foreach (var a in doctors_old)
            {
                doctor = DTOConverter.Convert <Doctor, DoctorDTO>(a);
                doctors.Add(doctor);
            }
            return(doctors);
        }
Beispiel #2
0
        static public ICollection <PatientDTO> GetSomePatients()
        {
            GHRepository <Patient> repo         = new GHRepository <Patient>();
            List <Patient>         patients_old = new List <Patient>(repo.GetEntities(x => x.Id > 0).ToList().OrderBy(x => x.Surname));

            ObservableCollection <PatientDTO> patients = new ObservableCollection <PatientDTO>();
            PatientDTO patient;

            foreach (var a in patients_old)
            {
                patient = DTOConverter.Convert <Patient, PatientDTO>(a);
                patients.Add(patient);
            }
            return(patients);
        }
Beispiel #3
0
        //return ReceptionDTO collection for current doctor
        private ICollection <ReceptionDTO> GetReceptionsDTO()
        {
            ICollection <ReceptionDTO> receptionDTOs = new ObservableCollection <ReceptionDTO>();

            //Шукаємо доктора з нашим id і витягуємо його workDayDoctors
            GetCurrentDoctor();
            ICollection <Reception> receptions = new ObservableCollection <Reception>(Doctor.Reception);

            //конвертуємо workDayDoctor в workDayDoctorDTO
            foreach (var reception in Doctor.Reception)
            {
                receptionDTOs.Add(DTOConverter.Convert <Reception, ReceptionDTO>(reception));
            }

            return(receptionDTOs);
        }
Beispiel #4
0
        //return WorkDayDoctorDTO collection for current doctor
        public ICollection <WorkDayDoctorDTO> GetWorkDaysDoctorsDTO()
        {
            ICollection <WorkDayDoctorDTO> WorkDayDoctorDTOs = new List <WorkDayDoctorDTO>();

            //Шукаємо доктора з нашим id і витягуємо його workDayDoctors
            GetCurrentDoctor();
            ICollection <WorkDayDoctor> WorkDayDoctors = new ObservableCollection <WorkDayDoctor>(Doctor.WorkDayDoctor);

            //конвертуємо workDayDoctor в workDayDoctorDTO
            foreach (var workDayDoctor in Doctor.WorkDayDoctor)
            {
                WorkDayDoctorDTOs.Add(DTOConverter.Convert <WorkDayDoctor, WorkDayDoctorDTO>(workDayDoctor));
            }

            return(WorkDayDoctorDTOs);
        }
Beispiel #5
0
        public DepartmentDTO GetDepartment()
        {
            GHRepository <Department> repoDepart = new GHRepository <Department>();

            return(DTOConverter.Convert <Department, DepartmentDTO>(repoDepart.FindById(DepartmentId)));
        }
Beispiel #6
0
        public NurseDTO GetNurse()
        {
            GHRepository <Nurse> nurse = new GHRepository <Nurse>();

            return(DTOConverter.Convert <Nurse, NurseDTO>(nurse.FindById(NurseId)));
        }
Beispiel #7
0
        public NoteDTO GetNote()
        {
            GHRepository <Note> note = new GHRepository <Note>();

            return(DTOConverter.Convert <Note, NoteDTO>(note.FindById(NoteId)));
        }
Beispiel #8
0
        public PatientDTO GetPatient()
        {
            GHRepository <Patient> patient = new GHRepository <Patient>();

            return(DTOConverter.Convert <Patient, PatientDTO>(patient.FindById(PatientId)));
        }
Beispiel #9
0
        public DoctorDTO GetDoctor()
        {
            GHRepository <Doctor> doctor = new GHRepository <Doctor>();

            return(DTOConverter.Convert <Doctor, DoctorDTO>(doctor.FindById(DoctorId)));
        }