Esempio n. 1
0
        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"
                }));
            }
        }
Esempio n. 2
0
        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"
                }));
            }
        }