public ActionResult Edit(int id) { TempData["UpdateId"] = id; tblAdmitDetail ad = dc.tblAdmitDetails.SingleOrDefault(ob => ob.AdmitDetailId == id); return(View(ad)); }
public ActionResult Delete(int id) { tblAdmitDetail ad = dc.tblAdmitDetails.SingleOrDefault(ob => ob.AdmitDetailId == id); dc.tblAdmitDetails.Remove(ad); dc.SaveChanges(); return(RedirectToAction("Index", "Admit")); }
public ActionResult Edit(FormCollection form) { int id = Convert.ToInt32(TempData["UpdateId"]); tblAdmitDetail ad = dc.tblAdmitDetails.SingleOrDefault(ob => ob.AdmitDetailId == id); ad.DoctorId = Convert.ToInt32(form["DoctorId"]); ad.PatientId = Convert.ToInt32(form["PatientId"]); ad.NurseId = Convert.ToInt32(form["NurseId"]); ad.WardType = form["WardType"]; ad.WardNo = Convert.ToInt32(form["WardNo"]); dc.SaveChanges(); return(RedirectToAction("Index", "Admit")); }
public ActionResult Details(int id) { tblAdmitDetail ad = dc.tblAdmitDetails.SingleOrDefault(ob => ob.AdmitDetailId == 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; ViewBag.NurseName = (from ob2 in dc.tblNurses where ob2.NurseId == ad.NurseId select ob2).Take(1).SingleOrDefault().FirstName; // ViewBag.AdminName = (from ob23 in dc.tblAdmins where ob3.AdminId == ad.CreatedBy select ob3).Take(1).SingleOrDefault().Name; string name = ViewBag.DoctorName; // string Aname = ViewBag.AdminName; string pname = ViewBag.patientName; string Nname = ViewBag.NurseName; return(View(ad)); }
public JsonResult Active(int id) { tblAdmitDetail ad = dc.tblAdmitDetails.SingleOrDefault(ob => ob.AdmitDetailId == id); if (ad.IsDischarge == true) { ad.IsDischarge = false; } else { ad.IsDischarge = true; } dc.SaveChanges(); return(Json(ad.IsDischarge, JsonRequestBehavior.AllowGet)); }
public ActionResult registration(FormCollection form) { tblAdmitDetail ad = new tblAdmitDetail(); ad.DoctorId = Convert.ToInt32(form ["DoctorId"]); ad.PatientId = Convert.ToInt32(form ["PatientId"]); ad.NurseId = Convert.ToInt32(form["NurseId"]); ad.WardType = form["WardType"]; ad.WardNo = Convert.ToInt32(form["WardNo"]); ad.CreatedBy = Convert.ToInt32(form["CreatedBy"]); ad.ModifiedBy = Convert.ToInt32(form["ModifiedBy"]); ad.IsDischarge = true; ad.CreatedOn = DateTime.Now; ad.ModifiedOn = DateTime.Now; dc.tblAdmitDetails.Add(ad); dc.SaveChanges(); return(RedirectToAction("Index", "Admit")); }