public JsonResult DeleteMedication() { try { MedicationRepository medicationRepo = new MedicationRepository(); medicationRepo.Remove(medicationRepo.Get(int.Parse(Request.Form["Medication"]))); return(Json(new { error = "false" })); } catch { return(Json(new { error = "true" })); } }
public JsonResult EditMedication() { try { MedicationRepository medicationRepo = new MedicationRepository(); Medication medication = medicationRepo.Get(int.Parse(Request.Form["Medication"])); medication.Name = Request.Form["EditMedication"]; return(Json(new { error = "false" })); } catch { return(Json(new { error = "true" })); } }