コード例 #1
0
        //public JsonResult GetPByDId()
        //{
        //    //var patients= PatientManager.GetPatientByDiseasesId(int diseasesId)
        //    //return Json(new {Success = true, Patients = patients}, JsonRequestBehavior.AllowGet);
        //    return
        //}

        public JsonResult Save(PatientMedicalHistoryViewModel model)
        {
            //model.Patients = PatientManager.GetAllPatient();
            //model.Diseases = DiseasesManager.GetAllDiseases();
            //model.Patients = PatientManager.GetPatientByDiseasesId(model.SearchField.SearchByDiseasesId);
            int saveIndex = 0;

            PatientsMedicalHistory _patientsMedicalHistory = new PatientsMedicalHistory();

            _patientsMedicalHistory.PatientHistoryId = model.PatientHistoryId;
            _patientsMedicalHistory.PatientId        = model.PatientId;
            _patientsMedicalHistory.DiseasesId       = model.DiseasesId;
            _patientsMedicalHistory.VitalSign        = model.VitalSign;
            _patientsMedicalHistory.Medicalhistory   = model.Medicalhistory;
            _patientsMedicalHistory.CreatedDate      = model.CreatedDate;
            _patientsMedicalHistory.ModifiedDate     = model.ModifiedDate;

            saveIndex = model.PatientHistoryId == 0
                ? PatientMedicalHistoryManager.Save(_patientsMedicalHistory)
                : PatientMedicalHistoryManager.Edit(_patientsMedicalHistory);
            return(Reload(saveIndex));
        }