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); }
public List <MedicalEquipment> getMedicalEquipments() { UltrasoundProtocolsDataSetTableAdapters.Tbl_MedicalEquipmentsTableAdapter adapter = new UltrasoundProtocolsDataSetTableAdapters.Tbl_MedicalEquipmentsTableAdapter(); List <MedicalEquipment> equipments = (from table in adapter.GetData() select table) .Select(x => new MedicalEquipment(x.meq_id, x.meq_name)) .ToList(); return(equipments); }