public ActionResult DetailMedical(int id)
        {
            Medical           m     = MedicalCRUD.GetMedical(id);
            List <Medication> mList = MedicationCRUD.GetAllMedicalMedications(id);
            List <Allergy>    aList = AllergyCRUD.GetAllMedicalAllergys(id);

            return(PartialView("_DetailMedical", new Tuple <Medical, List <Medication>, List <Allergy> >(m, mList, aList)));
        }
 public ActionResult RemoveMedication(int id)
 {
     if (MedicationCRUD.DeleteMedication(id))
     {
         return(Content("<script>alert('Medication Deleted Successfully.');window.location.href=document.referrer;</script>"));
     }
     else
     {
         return(Content("<script>alert('Medication could not be Deleted.');window.location.href=document.referrer</script>"));
     }
 }
        //Load Extend
        public ActionResult MedicalRecords(int id)
        {
            List <Medical>    mrList = MedicalCRUD.GetAllPrisonerMedicals(id);
            List <Medication> mList  = new List <Medication>();
            List <Allergy>    aList  = new List <Allergy>();

            foreach (Medical mr in mrList)
            {
                mList.AddRange(MedicationCRUD.GetAllMedicalMedications(mr.MedicalID));
                aList.AddRange(AllergyCRUD.GetAllMedicalAllergys(mr.MedicalID));
            }

            return(PartialView("_MedicalRecords", new Tuple <List <Medical>, List <Medication>, List <Allergy> >(mrList, mList, aList)));
        }
        public ActionResult EditMedicationForm(FormCollection collection)
        {
            Medication m = new Medication();

            m.Desc         = collection["Desc"];
            m.MedicationID = Int32.Parse(collection["MedicationID"]);

            if (MedicationCRUD.UpdateMedication(m))
            {
                return(Content("<script>alert('Medication Updated Successfully.');window.location.href=document.referrer;</script>"));
            }
            else
            {
                return(Content("<script>alert('Medication could not be Updated');window.location.href=document.referrer</script>"));
            }
        }
 public ActionResult EditMedication(int id)
 {
     return(PartialView("_EditMedication", MedicationCRUD.GetMedication(id)));
 }