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); }
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); }
//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); }
//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); }
public DepartmentDTO GetDepartment() { GHRepository <Department> repoDepart = new GHRepository <Department>(); return(DTOConverter.Convert <Department, DepartmentDTO>(repoDepart.FindById(DepartmentId))); }
public NurseDTO GetNurse() { GHRepository <Nurse> nurse = new GHRepository <Nurse>(); return(DTOConverter.Convert <Nurse, NurseDTO>(nurse.FindById(NurseId))); }
public NoteDTO GetNote() { GHRepository <Note> note = new GHRepository <Note>(); return(DTOConverter.Convert <Note, NoteDTO>(note.FindById(NoteId))); }
public PatientDTO GetPatient() { GHRepository <Patient> patient = new GHRepository <Patient>(); return(DTOConverter.Convert <Patient, PatientDTO>(patient.FindById(PatientId))); }
public DoctorDTO GetDoctor() { GHRepository <Doctor> doctor = new GHRepository <Doctor>(); return(DTOConverter.Convert <Doctor, DoctorDTO>(doctor.FindById(DoctorId))); }