public ActionResult Create(string id) { var medicalItem = new IntakeMedicalConditionItem() { Person_Id = int.Parse(id) }; return(PartialView("_MedicalDetailsCreate", medicalItem)); }
public ActionResult Edit(IntakeMedicalConditionItem medicalConditionItem) { var personModel = new PersonModel(); var editPerson = new Person(); int InAassId = Convert.ToInt32(Session["IntAssId"]); switch (medicalConditionItem.Remove_Item_Type_Id) { case (int)MedicalConditionTypeEnum.Allergy: personModel.RemoveAllergy(medicalConditionItem.Person_Id, medicalConditionItem.Remove_Item_Id); break; case (int)MedicalConditionTypeEnum.ChronicIllness: personModel.RemoveChronicIllness(medicalConditionItem.Person_Id, medicalConditionItem.Remove_Item_Id); break; case (int)MedicalConditionTypeEnum.Decease: personModel.RemoveDecease(medicalConditionItem.Person_Id, medicalConditionItem.Remove_Item_Id); break; } switch (medicalConditionItem.Medical_Condition_Type_Id) { case (int)MedicalConditionTypeEnum.Allergy: editPerson = personModel.AddAllergy(medicalConditionItem.Person_Id, medicalConditionItem.Medical_Condition_Id); break; case (int)MedicalConditionTypeEnum.ChronicIllness: editPerson = personModel.AddChronicIllness(medicalConditionItem.Person_Id, medicalConditionItem.Medical_Condition_Id); break; case (int)MedicalConditionTypeEnum.Decease: editPerson = personModel.AddDeceases(medicalConditionItem.Person_Id, medicalConditionItem.Medical_Condition_Id); break; } var status = ""; var message = ""; if (editPerson == null) { status = "Error"; message = "A technical error has occurred! Please try again later"; } return(new JsonResult { Data = new { status, message } }); //return RedirectToAction("EditAssessment", "Intake", new { id = InAassId }); }
public ActionResult Edit(string id, string personId, string medicalConditionTypeId) { var intakeMedicalConditionItem = new IntakeMedicalConditionItem(); switch (int.Parse(medicalConditionTypeId)) { case (int)MedicalConditionTypeEnum.Allergy: var allergyModel = new AllergyModel(); var allergyList = allergyModel.GetListOfAllergies(); intakeMedicalConditionItem.Medical_Conditions = (from a in allergyList select new LookupDataItem() { ItemId = a.Allergy_Id, Description = a.Description }).ToList(); break; case (int)MedicalConditionTypeEnum.ChronicIllness: var chronicIllnessModel = new ChronicIllnessModel(); var chronicIllnessList = chronicIllnessModel.GetListOfChronicIllnesses(); intakeMedicalConditionItem.Medical_Conditions = (from c in chronicIllnessList select new LookupDataItem() { ItemId = c.Chronic_Illness_Id, Description = c.Description }).ToList(); break; case (int)MedicalConditionTypeEnum.Decease: var deceasesModel = new DeceaseModel(); var deceasesList = deceasesModel.GetListOfDeseases(); intakeMedicalConditionItem.Medical_Conditions = (from c in deceasesList select new LookupDataItem() { ItemId = c.Decease_Id, Description = c.Description }).ToList(); break; } intakeMedicalConditionItem.Person_Id = int.Parse(personId); intakeMedicalConditionItem.Medical_Condition_Type_Id = int.Parse(medicalConditionTypeId); intakeMedicalConditionItem.Medical_Condition_Id = int.Parse(id); intakeMedicalConditionItem.Remove_Item_Type_Id = int.Parse(medicalConditionTypeId); intakeMedicalConditionItem.Remove_Item_Id = int.Parse(id); return(PartialView("_MedicalDetailsEdit", intakeMedicalConditionItem)); }