static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths) { foreach (string asset in importedAssets) { if (!filePath.Equals(asset)) { continue; } medical data = (medical)AssetDatabase.LoadAssetAtPath(assetFilePath, typeof(medical)); if (data == null) { data = ScriptableObject.CreateInstance <medical> (); data.SheetName = filePath; data.WorksheetName = sheetName; AssetDatabase.CreateAsset((ScriptableObject)data, assetFilePath); //data.hideFlags = HideFlags.NotEditable; } //data.dataArray = new ExcelQuery(filePath, sheetName).Deserialize<medicalData>().ToArray(); //ScriptableObject obj = AssetDatabase.LoadAssetAtPath (assetFilePath, typeof(ScriptableObject)) as ScriptableObject; //EditorUtility.SetDirty (obj); ExcelQuery query = new ExcelQuery(filePath, sheetName); if (query != null && query.IsValid()) { data.dataArray = query.Deserialize <medicalData>().ToArray(); ScriptableObject obj = AssetDatabase.LoadAssetAtPath(assetFilePath, typeof(ScriptableObject)) as ScriptableObject; EditorUtility.SetDirty(obj); } } }
public ActionResult Create(medical medical) { if (ModelState.IsValid) { var db = new qhsedbEntities(); db.medicals.Add(medical); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(medical)); }
public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var db = new qhsedbEntities(); medical medical = db.medicals.Find(id); if (medical == null) { return(HttpNotFound()); } return(View(medical)); }
public static medical SavePatientGeneralLifestyle(string hxGeneral, string hxutrition, string hxVitalsLabs, string hxTobacco, string wet, string hgfeet, string hginc, string fsmoke, string fchewer, string drate, Guid _pkey) { GuruETCEntities _etc = new GuruETCEntities(); long? ParentId = _etc.PatientProfiles.Where(d => d.UserGuid == _pkey).Select(d => d.Id).FirstOrDefault(); long? DoctorId = _etc.PatientProfiles.Where(d => d.UserGuid == _pkey).Select(d => d.DoctorId).FirstOrDefault(); medical _med = new medical(); PatientResultQuestion _Presult = _etc.PatientResultQuestions.Where(p => p.DoctorId == DoctorId && p.PatientId == ParentId).FirstOrDefault(); if (_Presult != null) { _Presult.hx_general = hxGeneral; _Presult.hx_nutrition_activity = hxutrition; _Presult.hx_vitals_labs = hxVitalsLabs; _Presult.hx_tobacco_alcohol = hxTobacco; if (!string.IsNullOrEmpty(wet)) { _Presult.Weight = double.Parse(wet); } if (!string.IsNullOrEmpty(hgfeet)) { _Presult.Height = double.Parse(hgfeet); } if (!string.IsNullOrEmpty(hginc)) { _Presult.feet = double.Parse(hginc); } _Presult.FormerSmoker = fsmoke; _Presult.FormerChewer = fchewer; _Presult.dietrating = drate; _etc.SaveChanges(); _med.cardio = _Presult.hx_medical_cardiovascular; _med.Cancer = _Presult.hx_medical_cancer; _med.DIS = _Presult.hx_medical_other_diseases; _med.ENT = _Presult.hx_medical_ent; _med.sleep = _Presult.hx_medical_sleep; _med.GHealth = _Presult.hx_medical_gender_health; _med.Endo = _Presult.hx_medical_endocrine_disorders; } return(_med); }
public JsonResult Edit(medical medical) { try { var db = new qhsedbEntities(); if (ModelState.IsValid) { medical.id = medical.id; db.Entry(medical).State = EntityState.Modified; // loanRequest.LoanDate = loanRequest.LoanDate; db.SaveChanges(); } return(Json("Edited Medical System", JsonRequestBehavior.AllowGet)); } catch (Exception e) { return(Json(e.Message, JsonRequestBehavior.AllowGet)); } }
public ActionResult Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } var db = new qhsedbEntities(); medical medical = db.medicals.Find(id); if (medical == null) { return(HttpNotFound()); } var medicalRow = db.medicals.Find(id); db.medicals.Remove(medicalRow); db.SaveChanges(); return(RedirectToAction("Index")); }
public static medical SavePatientGeneralLifestyle(string hxGeneral, string hxutrition, string hxVitalsLabs, string hxTobacco, string wet, string hgfeet, string hginc, string fsmoke, string fchewer, string drate, Guid _pkey) { GuruETCEntities _etc = new GuruETCEntities(); long? ParentId = _etc.PatientProfiles.Where(d => d.UserGuid == _pkey).Select(d => d.Id).FirstOrDefault(); long? DoctorId = _etc.PatientProfiles.Where(d => d.UserGuid == _pkey).Select(d => d.DoctorId).FirstOrDefault(); medical _med = new medical(); PatientResultQuestion _Presult = _etc.PatientResultQuestions.Where(p => p.DoctorId == DoctorId && p.PatientId == ParentId).FirstOrDefault(); if (_Presult != null) { _Presult.hx_general = hxGeneral; _Presult.hx_nutrition_activity = hxutrition; _Presult.hx_vitals_labs = hxVitalsLabs; _Presult.hx_tobacco_alcohol = hxTobacco; if(!string.IsNullOrEmpty(wet)) _Presult.Weight = double.Parse(wet); if (!string.IsNullOrEmpty(hgfeet)) _Presult.Height = double.Parse(hgfeet); if (!string.IsNullOrEmpty(hginc)) _Presult.feet = double.Parse(hginc); _Presult.FormerSmoker = fsmoke; _Presult.FormerChewer = fchewer; _Presult.dietrating = drate; _etc.SaveChanges(); _med.cardio = _Presult.hx_medical_cardiovascular; _med.Cancer = _Presult.hx_medical_cancer; _med.DIS = _Presult.hx_medical_other_diseases; _med.ENT = _Presult.hx_medical_ent; _med.sleep = _Presult.hx_medical_sleep; _med.GHealth = _Presult.hx_medical_gender_health; _med.Endo = _Presult.hx_medical_endocrine_disorders; } return _med; }