public ActionResult LoadData() { using (dTharapyDBEntities db = new dTharapyDBEntities()) { List <tbl_Patients> data = db.tbl_Patients.ToList(); return(Json(new { data }, JsonRequestBehavior.AllowGet)); } }
public ActionResult GetMessages(int id) { using (dTharapyDBEntities db = new dTharapyDBEntities()) { List <tbl_Messages> rec = (from n in db.tbl_Messages where n.PatientsIDFK == id select n).ToList(); return(Json(new { rec }, JsonRequestBehavior.AllowGet)); } }
// // GET: /ViewMessages/ public ActionResult Index(int id) { using (dTharapyDBEntities db = new dTharapyDBEntities()) { string pName = (from n in db.tbl_Patients where n.id == id select n.Name).Single().ToString(); ViewBag.pName = pName; ViewBag.PatientId = id; return(View()); } }
public ActionResult SendVideo(int id, string videoId) { using (dTharapyDBEntities db = new dTharapyDBEntities()) { tbl_Messages msg = new tbl_Messages(); msg.PatientsIDFK = id; msg.message = videoId; msg.IsVideo = true; db.tbl_Messages.Add(msg); db.SaveChanges(); return(null); } }
public ActionResult SavePatient(string name, string t_name, string user_name, string password) { using (dTharapyDBEntities db = new dTharapyDBEntities()) { tbl_Patients tbP = new tbl_Patients(); tbP.Name = name; tbP.t_Name = t_name; tbP.p_Completed = "0%"; tbP.user_name = user_name; tbP.password = password; db.tbl_Patients.Add(tbP); db.SaveChanges(); return(null); } }
public ActionResult LoginTrainer(string userName, string password) { using (dTharapyDBEntities db = new dTharapyDBEntities()) { object obj = 0; string pswd = (from n in db.tbl_trainers where n.userName == userName select n.password).Single(); if (pswd == password) { obj = 1; } return(Json(obj, JsonRequestBehavior.AllowGet)); } }