public ActionResult SearchPatient(string SearchPatientID) { PresentModel p = new PresentModel(); IEnumerable <PresentViewModel> vm = p.ForTest(SearchPatientID); string jsonSeries = JsonConvert.SerializeObject(vm); ViewBag.item = jsonSeries; IEnumerable <PresentViewModel> vm2 = p.GetMed_Dormicum(); string jsonSeries2 = JsonConvert.SerializeObject(vm2); ViewBag.item2 = jsonSeries2; IEnumerable <PresentViewModel> vm3 = p.GetMed_TARGO(); string jsonSeries3 = JsonConvert.SerializeObject(vm3); ViewBag.item3 = jsonSeries3; IEnumerable <PresentViewModel> vm4 = p.GetMed_MEPE2(); string jsonSeries4 = JsonConvert.SerializeObject(vm4); ViewBag.item4 = jsonSeries4; IEnumerable <PresentViewModel> vm_MedRecord = p.GetMedRecord(); string jsonSerie_MedRecord = JsonConvert.SerializeObject(vm_MedRecord); ViewBag.item_MedRecord = jsonSerie_MedRecord; //IEnumerable<PresentViewModel> vm_med = p.GetMed(); return(PartialView(vm)); }
//搜尋病患頁面 public ActionResult SearchPatient() { PresentViewModel vm = new PresentViewModel(); PresentModel p = new PresentModel(); vm = p.GetDropList(); return(View(vm)); }
public ActionResult SearchTime(string data) { ViewBag.SearchTime = data; PresentModel p = new PresentModel(); IEnumerable <PresentViewModel> vm = p.GetTime(data, Session["PatientID"].ToString()); return(PartialView(vm)); }
//病患資料主畫面 public ActionResult Index() { ViewBag.item = TempData["item"].ToString(); ViewBag.item_MedDose = TempData["item_MedDose"].ToString(); ViewBag.item_medTime = TempData["item_medTime"].ToString(); ViewBag.P_ID = Session["PatientID"]; PresentModel p = new PresentModel(); //抓側邊欄藥物名稱 IEnumerable <PresentViewModel> vm_med = p.GetMed(Session["PatientID"].ToString()); return(View(vm_med)); }
//public ActionResult Test() //{ // PresentModel p = new PresentModel(); // IEnumerable<PresentViewModel> vm_med = p.GetMed(); // return View(vm_med); //} // public ActionResult SearchByMed(string med) //{ // string searchMed = null; // if (!String.IsNullOrEmpty(searchMed)) // { // using(Models.PresentModel p = new Models.PresentModel()) // { // var result = (from s in p.GetMed() // where s.Med_Code == searchMed // select s).ToList(); // return View("Test", result); // } // } // else // { // return View("Test", new List<Models.PresentModel>()); // } //} public ActionResult Test(string id) { PresentModel p = new PresentModel(); PresentViewModel vm = new PresentViewModel(); vm = p.GetPatientID(); IEnumerable <PresentViewModel> vm_EHRContent = p.GetEHRContent(); string jsonSeries = JsonConvert.SerializeObject(vm_EHRContent); ViewBag.item = jsonSeries; IEnumerable <PresentViewModel> vm3 = p.GetMed_TARGO(); string jsonSeries3 = JsonConvert.SerializeObject(vm3); ViewBag.item3 = jsonSeries3; return(View(vm)); }
// // GET: /Present/ public ActionResult Index(int id = -1) { if (Request.IsAuthenticated) { if (id != -1) { PresentModel model = new PresentModel(id); ViewBag.PageState_0 = "state-inactive"; ViewBag.PageState_2 = "state-inactive"; return(View(model)); } else { ViewBag.PageState_1 = "state-inactive"; ViewBag.PageState_2 = "state-inactive"; return(View()); } } else { return(RedirectToAction("LogOn", "Home")); } }
public ActionResult index() { PresentModel p = new PresentModel(); //IEnumerable<PresentViewModel> vm_PatientID = p.GetPatientID(); //string jsonSeries_PatientID = JsonConvert.SerializeObject(vm_PatientID); //ViewBag.item_PatientID = jsonSeries_PatientID; IEnumerable <PresentViewModel> vm_Patient = p.GetPatient(); string jsonSeries = JsonConvert.SerializeObject(vm_Patient); ViewBag.item = jsonSeries; IEnumerable <PresentViewModel> vm2 = p.GetMed_Dormicum(); string jsonSeries2 = JsonConvert.SerializeObject(vm2); ViewBag.item2 = jsonSeries2; IEnumerable <PresentViewModel> vm3 = p.GetMed_TARGO(); string jsonSeries3 = JsonConvert.SerializeObject(vm3); ViewBag.item3 = jsonSeries3; IEnumerable <PresentViewModel> vm4 = p.GetMed_MEPE2(); string jsonSeries4 = JsonConvert.SerializeObject(vm4); ViewBag.item4 = jsonSeries4; IEnumerable <PresentViewModel> vm_MedRecord = p.GetMedRecord(); string jsonSerie_MedRecord = JsonConvert.SerializeObject(vm_MedRecord); ViewBag.item_MedRecord = jsonSerie_MedRecord; IEnumerable <PresentViewModel> vm_med = p.GetMed(); return(View(vm_med)); }
public async Task <PresentModel> GetRandomParticipant(string participantName) { var secret = new PresentModel(); try { using (SqlConnection connection = new SqlConnection(_conn)) { await connection.OpenAsync(); using (SqlCommand command = new SqlCommand(@"dbo.[GetRandomParticipant]", connection)) { command.Parameters.Add("@Name", SqlDbType.VarChar, 50).Value = participantName; command.CommandType = CommandType.StoredProcedure; using (SqlDataReader reader = await command.ExecuteReaderAsync()) { while (await reader.ReadAsync()) { secret.Name = await reader.GetFieldValueAsync <string>(0); secret.WishList = await reader.GetFieldValueAsync <string>(1); } reader.Close(); } } connection.Close(); } } catch (Exception e) { throw e; } return(secret); }
public void init(Hex h) { this.h = h; model = new GameObject("Present Model").AddComponent <PresentModel>(); model.init(this); }
public ActionResult SearchPatient(PresentViewModel vm) { Session["PatientID"] = vm.P_ID_Value; //紀錄patientID PresentModel p = new PresentModel(); //病患資料 IEnumerable <PresentViewModel> getPatientData = p.GetP_ID_Value(vm); string jsonSeries = JsonConvert.SerializeObject(getPatientData); TempData["item"] = jsonSeries; //要跨Action要使用TempData才能記住資料 //病患藥物劑量 List <Dictionary <string, object> > mRet_Dose = new List <Dictionary <string, object> >(); mRet_Dose = p.GetMedDose(vm); List <Dictionary <string, object> > samedateDose = new List <Dictionary <string, object> >(); for (int i = 0; i < mRet_Dose.Count; i++) { if (samedateDose.Count == 0) { Dictionary <string, object> dict = new Dictionary <string, object>(); //拿MedPRS的時間 dict.Add("MedPRS", mRet_Dose[i]["MedPRS"]); dict.Add("Time13", mRet_Dose[i]["Time13"]); dict.Add("Dose", mRet_Dose[i]["Dose"]); dict.Add("DoseUnit", mRet_Dose[i]["DoseUnit"]); dict.Add("MedPRS_Name", mRet_Dose[i]["MedPRS_Name"]); samedateDose.Add(dict); } else { var mRet_DoseCount = samedateDose.Count; bool IsExist = false; for (int n = 0; n < mRet_DoseCount; n++) { if (samedateDose[n].ContainsValue(mRet_Dose[i]["MedPRS"]) && samedateDose[n].ContainsValue(mRet_Dose[i]["Time13"])) { IsExist = true; samedateDose[n]["Dose"] = float.Parse(samedateDose[n]["Dose"].ToString()) + float.Parse(mRet_Dose[i]["Dose"].ToString()); break; } else { IsExist = false; } } if (IsExist == false) { Dictionary <string, object> dict = new Dictionary <string, object>(); //拿MedPRS的時間 dict.Add("MedPRS", mRet_Dose[i]["MedPRS"]); dict.Add("Time13", mRet_Dose[i]["Time13"]); dict.Add("Dose", mRet_Dose[i]["Dose"]); dict.Add("DoseUnit", mRet_Dose[i]["DoseUnit"]); dict.Add("MedPRS_Name", mRet_Dose[i]["MedPRS_Name"]); samedateDose.Add(dict); } } } string jsonSeries_mRet_Dose = JsonConvert.SerializeObject(samedateDose); TempData["item_MedDose"] = jsonSeries_mRet_Dose; //病歷時間 List <string> vm_medTime = p.GetMedTime(vm); string medTimeStr = ""; for (int i = 0; i < vm_medTime.Count; i++) { if (i == 0) { medTimeStr = "[ { x:" + vm_medTime[i] + ", title:'R' }"; } else if (i == (vm_medTime.Count - 1)) { medTimeStr = medTimeStr + ",{ x:" + vm_medTime[i] + ", title:'R' }]"; } else { medTimeStr = medTimeStr + ",{ x:" + vm_medTime[i] + ", title:'R'}"; } } TempData["item_medTime"] = medTimeStr; return(RedirectToAction("Index")); //將頁面導到 Index_0430TesT }
//For TEST public ActionResult IndexTest() { PresentModel p = new PresentModel(); //病患資料 IEnumerable <PresentViewModel> getPatientData = p.GetPIDTest(); string jsonSeries = JsonConvert.SerializeObject(getPatientData); ViewBag.item = jsonSeries; //要跨Action要使用TempData才能記住資料 //病患藥物劑量 List <Dictionary <string, object> > mRet_Dose = new List <Dictionary <string, object> >(); mRet_Dose = p.GetMedDoseTest(); List <Dictionary <string, object> > samedateDose = new List <Dictionary <string, object> >(); for (int i = 0; i < mRet_Dose.Count; i++) { if (samedateDose.Count == 0) { Dictionary <string, object> dict = new Dictionary <string, object>(); //拿MedPRS的時間 dict.Add("MedPRS", mRet_Dose[i]["MedPRS"]); dict.Add("Time13", mRet_Dose[i]["Time13"]); dict.Add("Dose", mRet_Dose[i]["Dose"]); dict.Add("DoseUnit", mRet_Dose[i]["DoseUnit"]); dict.Add("MedPRS_Name", mRet_Dose[i]["MedPRS_Name"]); samedateDose.Add(dict); } else { var mRet_DoseCount = samedateDose.Count; bool IsExist = false; for (int n = 0; n < mRet_DoseCount; n++) { if (samedateDose[n].ContainsValue(mRet_Dose[i]["MedPRS"]) && samedateDose[n].ContainsValue(mRet_Dose[i]["Time13"])) { IsExist = true; samedateDose[n]["Dose"] = float.Parse(samedateDose[n]["Dose"].ToString()) + float.Parse(mRet_Dose[i]["Dose"].ToString()); break; } else { IsExist = false; } } if (IsExist == false) { Dictionary <string, object> dict = new Dictionary <string, object>(); //拿MedPRS的時間 dict.Add("MedPRS", mRet_Dose[i]["MedPRS"]); dict.Add("Time13", mRet_Dose[i]["Time13"]); dict.Add("Dose", mRet_Dose[i]["Dose"]); dict.Add("DoseUnit", mRet_Dose[i]["DoseUnit"]); dict.Add("MedPRS_Name", mRet_Dose[i]["MedPRS_Name"]); samedateDose.Add(dict); } } } string jsonSeries_mRet_Dose = JsonConvert.SerializeObject(samedateDose); ViewBag.item_MedDose = jsonSeries_mRet_Dose; //病歷時間 List <string> vm_medTime = p.GetMedTimeTest(); string medTimeStr = ""; for (int i = 0; i < vm_medTime.Count; i++) { if (i == 0) { medTimeStr = "[ { x:" + vm_medTime[i] + ", title:'R' }"; } else if (i == (vm_medTime.Count - 1)) { medTimeStr = medTimeStr + ",{ x:" + vm_medTime[i] + ", title:'R' }]"; } else { medTimeStr = medTimeStr + ",{ x:" + vm_medTime[i] + ", title:'R'}"; } } ViewBag.item_medTime = medTimeStr; Session["PatientID"] = "321"; ViewBag.P_ID = Session["PatientID"]; //抓側邊欄藥物名稱 var teststr = "321"; IEnumerable <PresentViewModel> vm_med = p.GetMed(teststr); return(View(vm_med)); }