public ActionResult DeleteConfirmed(int id)
        {
            PatientAdmition patientAdmition = db.PatientAdmition.Find(id);

            db.PatientAdmition.Remove(patientAdmition);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "ID,PatientId,Date")] PatientAdmition patientAdmition)
 {
     if (ModelState.IsValid)
     {
         db.Entry(patientAdmition).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.PatientId = new SelectList(db.Patient, "ID", "PatientName", patientAdmition.PatientId);
     return(View(patientAdmition));
 }
        public ActionResult Create([Bind(Include = "ID,PatientId,Date")] PatientAdmition patientAdmition)
        {
            if (ModelState.IsValid)
            {
                db.PatientAdmition.Add(patientAdmition);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.PatientId = new SelectList(db.Patient, "ID", "PatientName", patientAdmition.PatientId);
            return(View(patientAdmition));
        }
        // GET: PatientAdmitions/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PatientAdmition patientAdmition = db.PatientAdmition.Find(id);

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

            if (patientAdmition == null)
            {
                return(HttpNotFound());
            }
            ViewBag.PatientId = new SelectList(db.Patient, "ID", "PatientName", patientAdmition.PatientId);
            return(View(patientAdmition));
        }