public List <TreatmentHistoryDTO> GetTreatmentHistories(int medicalChartId)
        {
            var treatmentHistoryDTOS = _context.TreatmentHistories
                                       .Include(th => th.User)
                                       .Include(th => th.Treatment)
                                       .Include(th => th.Tooth)
                                       .Include(th => th.Affiliate)
                                       .Where(f => f.MedicalChartId.Equals(medicalChartId))
                                       .OrderByDescending(th => th.DateOfTreatment)
                                       .Select(th => TreatmentHistoryMapper.TreatmentHistoryToDTO(th))
                                       .ToList();

            return(treatmentHistoryDTOS);
        }
Пример #2
0
        public TreatmentHistoryDTO Get(int medicalChartId, int treatmentHistoryId)
        {
            var treatmentHistory = _context.TreatmentHistories
                                   .Include(th => th.User)
                                   .Include(th => th.Treatment)
                                   .Include(th => th.Tooth)
                                   .Include(th => th.Affiliate)
                                   .Where(th => th.Id.Equals(treatmentHistoryId))
                                   .Where(th => th.MedicalChartId.Equals(medicalChartId))
                                   .SingleOrDefault();

            if (treatmentHistory == null)
            {
                return(null);
            }

            return(TreatmentHistoryMapper.TreatmentHistoryToDTO(treatmentHistory));
        }