コード例 #1
0
        public List <TreatmentTypeDTO> GetTreatmentsForEmployee(TreatmentRequest request)
        {
            var employee = _employeeDetailRepository
                           .All
                           .Include(c => c.Department)
                           .ThenInclude(c => c.TreatmentTypes)
                           .Where(c => c.DepartmentId == request.DepartmentId && c.Empno == request.EMPNo && !c.IsDeleted && c.DeletedBy == null)
                           .FirstOrDefault();

            if (employee != null && employee.Department != null && employee.Department.TreatmentTypes != null)
            {
                return(DomainDTOMapper.ToTreatmentTypesDTOs(employee.Department.TreatmentTypes.ToList()));
            }

            return(new List <TreatmentTypeDTO>());
        }
コード例 #2
0
 public IActionResult GetTreatmentForUser([FromBody] TreatmentRequest request)
 {
     return(Ok(_treatmentService.GetTreatmentsForEmployee(request)));
 }