public ActionResult Details(int id, int medicalRecordId)
        {
            TreatmentViewModel treatmentViewModel = treatmentRepository.GetById(id).ToViewModel();

            treatmentViewModel.MedicalRecordEntryViewModel = medicalRecordEntryRepository.GetById(medicalRecordId).ToViewModel();
            AddMedicalRecordToTempData(medicalRecordId);
            return(View(treatmentViewModel));
        }
        public async Task <IActionResult> Delete(Guid id)
        {
            if (ManagedYearPlan == null)
            {
                return(ActionIfNotChoosedManagedYearPlan());
            }

            var @operator = await _treatmentRepository.GetById(id);

            await _treatmentRepository.Delete(@operator);

            return(RedirectToAction("Index"));
        }
Example #3
0
        public async Task <ActionResult <Treatment> > GetById(Guid id)
        {
            try
            {
                var result = await treatmentRepository.GetById(id);

                if (result == null)
                {
                    return(NotFound());
                }

                return(result);
            }
            catch (Exception)
            {
                return(StatusCode(StatusCodes.Status500InternalServerError,
                                  "Error retrieving data from the database"));
            }
        }