예제 #1
0
        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);
        }
예제 #3
0
        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;
        }
예제 #4
0
 public ICollection <Prescription> GetAllPrescriptions()
 {
     return(_repository.GetAll());
 }
예제 #5
0
 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()));
 }
예제 #8
0
 public async Task <List <Prescription> > GetAllPrescriptionsAsync() =>
 await _prescriptionRepository.GetAll().ToListAsync();