public ActionResult DeleteConfirmed(int id)
        {
            OPDRegistration oPDRegistration = db.OPDRegistrations.Find(id);

            db.OPDRegistrations.Remove(oPDRegistration);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "OPDId,PatientId,DoctorId,DateOfRegister,Problem,RoomNo,TokenNo,Status")] OPDRegistration oPDRegistration)
 {
     if (ModelState.IsValid)
     {
         db.Entry(oPDRegistration).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DoctorId  = new SelectList(db.Doctors, "DoctorId", "DoctorName", oPDRegistration.DoctorId);
     ViewBag.PatientId = new SelectList(db.Patients, "PatientId", "PatientName", oPDRegistration.PatientId);
     return(View(oPDRegistration));
 }
        // GET: OPDRegistrations/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OPDRegistration oPDRegistration = db.OPDRegistrations.Find(id);

            if (oPDRegistration == null)
            {
                return(HttpNotFound());
            }
            return(View(oPDRegistration));
        }
        // GET: OPDRegistrations/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            OPDRegistration oPDRegistration = db.OPDRegistrations.Find(id);

            if (oPDRegistration == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DoctorId  = new SelectList(db.Doctors, "DoctorId", "DoctorName", oPDRegistration.DoctorId);
            ViewBag.PatientId = new SelectList(db.Patients, "PatientId", "PatientName", oPDRegistration.PatientId);
            return(View(oPDRegistration));
        }