public ActionResult Details(int id) { tblDoctorInquiry ad = dc.tblDoctorInquiries.SingleOrDefault(ob => ob.DoctorInquiryID == id); ViewBag.DoctorName = (from ob in dc.tblDoctors where ob.DoctorId == ad.DoctorId select ob).Take(1).SingleOrDefault().FirstName; ViewBag.PatientName = (from ob1 in dc.tblPatients where ob1.PatientId == ad.PatientId select ob1).Take(1).SingleOrDefault().FirstName; string name = ViewBag.DoctorName; string pname = ViewBag.patientName; return(View(ad)); }
public JsonResult Active(int id) { tblDoctorInquiry ad = dc.tblDoctorInquiries.SingleOrDefault(ob => ob.DoctorInquiryID == id); if (ad.IsReply == true) { ad.IsReply = false; } else { ad.IsReply = true; } dc.SaveChanges(); return(Json(ad.IsReply, JsonRequestBehavior.AllowGet)); }