Esempio n. 1
0
        public List <Doctor> getActiveDoctors()
        {
            UltrasoundProtocolsDataSetTableAdapters.Tbl_DoctorsTableAdapter adapter =
                new UltrasoundProtocolsDataSetTableAdapters.Tbl_DoctorsTableAdapter();
            List <Doctor> doctors = (from table in adapter.GetData() where table.dct_status select table)
                                    .Select(x => new Doctor(x.dct_id, x.dct_fullname, x.dct_status))
                                    .ToList();

            return(doctors);
        }
Esempio n. 2
0
        public List <FullProtocol> getFullFilledProtocols()
        {
            UltrasoundProtocolsDataSetTableAdapters.Tbl_ProtocolsTableAdapter adapterProtocols =
                new UltrasoundProtocolsDataSetTableAdapters.Tbl_ProtocolsTableAdapter();
            UltrasoundProtocolsDataSetTableAdapters.Tbl_DoctorsTableAdapter adapterDoctors =
                new UltrasoundProtocolsDataSetTableAdapters.Tbl_DoctorsTableAdapter();
            UltrasoundProtocolsDataSetTableAdapters.Tbl_PatientsTableAdapter adapterPatients =
                new UltrasoundProtocolsDataSetTableAdapters.Tbl_PatientsTableAdapter();
            UltrasoundProtocolsDataSetTableAdapters.Tbl_MedicalEquipmentsTableAdapter adapterEquipments =
                new UltrasoundProtocolsDataSetTableAdapters.Tbl_MedicalEquipmentsTableAdapter();
            var fullFilledProtocols = (from protocols in adapterProtocols.GetData()
                                       join doctors in adapterDoctors.GetData() on protocols.prt_doctor equals doctors.dct_id
                                       join patients in adapterPatients.GetData() on protocols.prt_patient equals patients.pat_id
                                       join equipments in adapterEquipments.GetData() on protocols.prt_equipment equals equipments.meq_id
                                       select new { Id = protocols.prt_id, DateTime = protocols.prt_datetime, Doctor = doctors.dct_fullname,
                                                    Patient = patients.pat_fullname, Equipment = equipments.meq_name, Source = protocols.prt_source })
                                      .Select(x => new FullProtocol(x.Id, x.DateTime, x.Doctor, x.Patient, x.Equipment, x.Source))
                                      .ToList();

            return(fullFilledProtocols);
        }