Beispiel #1
0
        public IActionResult Delete(int?id)
        {
            HomeDetailsViewModel homeDetailsViewModel = new HomeDetailsViewModel
            {
                Medication = _handlerMedicationRepository.DeleteMedication(id ?? 1),
                Title      = "Medication Delete"
            };

            return(View(homeDetailsViewModel));
        }
Beispiel #2
0
        public IActionResult DeleteMedication(int MedicationId)
        {
            var MedicationObj = _meRepo.GetMedication(MedicationId);

            if (!_meRepo.DeleteMedication(MedicationObj))
            {
                ModelState.AddModelError("", $"Something went wrong when deleting the record {MedicationObj.Id}");
                return(StatusCode(500, ModelState));
            }
            return(NoContent());
        }
Beispiel #3
0
 public void DeleteMedication(int medicationId)
 {
     _medicationRepository.DeleteMedication(medicationId);
 }