public int medicinePerPeriod(string medicine, DateTime startDate, DateTime endDate) { IDal dal = new PrescriptionDAL.DalImplement(); int medicineId = dal.getAllMedicines().FirstOrDefault(m => m.Name == medicine).Id; return(dal.getAllPrescriptions().Count(prescription => prescription.StartDate >= startDate && prescription.StartDate <= endDate && prescription.medicine == medicineId)); }
public IEnumerable <Prescription> getAllPrescriptions() { IDal dal = new PrescriptionDAL.DalImplement(); return(dal.getAllPrescriptions()); }
public IEnumerable <Prescription> allPrescriptionFromPatient(Patient patient) { IDal dal = new PrescriptionDAL.DalImplement(); return(dal.getAllPrescriptions().Where(prescription => prescription.Patient == patient.PatientId)); }
public IEnumerable <Prescription> allPrescriptionByDoctor(Doctor doctor) { IDal dal = new PrescriptionDAL.DalImplement(); return(dal.getAllPrescriptions().Where(prescription => prescription.Doctor == doctor.DoctorId)); }