public User GetCurrentUserWithPrescriptions(Guid id) { var newUser = new User(); var user = userRepo.GetById(id); var pres = preRepo.GetAll(); var doc = docRepo.GetAll(); var drug = drugRepo.GetAll(); newUser.FirstName = user.FirstName; newUser.LastName = user.LastName; newUser.UserName = user.UserName; newUser.Email = user.Email; newUser.Id = user.Id; var prescription = pres.FirstOrDefault(a => a.UserId == newUser.Id); prescription.Doctor = doc.FirstOrDefault(d => d.Id == prescription.DoctorId); var drugs = drug.Where(drug1 => drug1.PrescriptionId == prescription.Id); prescription.Drugs = drugs.ToList(); newUser.Prescriptions.Add(prescription); return(newUser); }
public List <Prescription> GetAll() { var prescriptions = _prescriptionRepository.GetAll().ToList(); foreach (Prescription prescription in prescriptions) { prescription.Report.MedicalRecord.Patient = _userGateway.GetPatientBy(prescription.Report.MedicalRecord.PatientId); prescription.Report.Doctor = _userGateway.GetDoctorBy(prescription.Report.DoctorId); } return(prescriptions); }
private void loadData() { List <Prescription> prescriptions = _prescriptionRepo.GetAll(this.txtDate.Value); prescriptions = prescriptions.OrderBy(x => x.LastUpdatedDate).ToList(); int index = 1; foreach (var prescription in prescriptions) { prescription.No = index++; } this.bdsPrescriptionHistory.DataSource = prescriptions; }
public ICollection <Prescription> GetAllPrescriptions() { return(_repository.GetAll()); }
public IEnumerable <Prescription> GetAll() => _prescriptionRepository.GetAll();
public IEnumerable <Prescription> GetAll() { return(_prescriptionRepository.GetAll()); }
// GET: Prescriptions public ActionResult Index() { log.Info(JsonConvert.SerializeObject(prescription.GetAll())); return(View(prescription.GetAll())); }
public async Task <List <Prescription> > GetAllPrescriptionsAsync() => await _prescriptionRepository.GetAll().ToListAsync();