// GET: PGBedPatientInfoes/Create public ActionResult Create(int?id) { PGBedPatientInfo mdl = new PGBedPatientInfo(); mdl.BedID = id.Value; return(View(mdl)); }
public ActionResult DeleteConfirmed(int id) { PGBedPatientInfo pGBedPatientInfo = db.PgBedPatientInfo.Find(id); db.PgBedPatientInfo.Remove(pGBedPatientInfo); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PGBedPatientId,PatientName,PatientPhone,PatientAddress,State,District,City,Pincode,PatientIdTypeValue,PatientStatus,Notes,PatientAdmittedOnDate,PatientDischargedOnDate,BedID")] PGBedPatientInfo pGBedPatientInfo) { if (ModelState.IsValid) { db.Entry(pGBedPatientInfo).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index", new { bedId = pGBedPatientInfo.BedID })); } return(View(pGBedPatientInfo)); }
public ActionResult CreatePatient([Bind(Include = "PGBedPatientId,PatientName,PatientPhone,PatientAddress,State,District,City,Pincode,PatientIdTypeValue,PatientStatus,Notes,PatientAdmittedOnDate,PatientDischargedOnDate")] PGBedPatientInfo patientInfo) { if (ModelState.IsValid) { db.PgBedPatientInfo.Add(patientInfo); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(patientInfo)); }
public ActionResult Create([Bind(Include = "PGBedPatientId,PatientName,PatientPhone,PatientAddress,State,District,City,Pincode,PatientIdTypeValue,PatientStatus,Notes,PatientAdmittedOnDate,PatientDischargedOnDate,BedID")] PGBedPatientInfo pGBedPatientInfo) { if (ModelState.IsValid) { var bed = db.PgBeds.FirstOrDefault(x => x.BedID == pGBedPatientInfo.BedID); pGBedPatientInfo.PgBed = bed; db.PgBedPatientInfo.Add(pGBedPatientInfo); db.SaveChanges(); return(RedirectToAction("Index", "PGRegistrations")); } return(View(pGBedPatientInfo)); }
// GET: PGBedPatientInfoes/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PGBedPatientInfo pGBedPatientInfo = db.PgBedPatientInfo.Find(id); if (pGBedPatientInfo == null) { return(HttpNotFound()); } return(View(pGBedPatientInfo)); }