public IActionResult Delete(int?id) { HomeDetailsViewModel homeDetailsViewModel = new HomeDetailsViewModel { Medication = _handlerMedicationRepository.DeleteMedication(id ?? 1), Title = "Medication Delete" }; return(View(homeDetailsViewModel)); }
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()); }
public void DeleteMedication(int medicationId) { _medicationRepository.DeleteMedication(medicationId); }