// GET: DoctorTbls/Edit/5
        public ActionResult Edit(int?id)
        {
            DoctorTbl doctorTbl = db.DoctorTbls.Find(id);

            ViewBag.docid = new SelectList(db.DoctorTbls, "Id", "firstname", "lastname");

            return(View(doctorTbl));
        }
        public ActionResult DeleteConfirmed(int id)
        {
            DoctorTbl doctorTbl = db.DoctorTbls.Find(id);

            db.DoctorTbls.Remove(doctorTbl);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
 public ActionResult Edit([Bind(Include = "Id,firstname,lastname")] DoctorTbl doctorTbl)
 {
     if (ModelState.IsValid)
     {
         db.Entry(doctorTbl).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("DoctorTbls", "List"));
     }
     return(View(doctorTbl));
 }
        // GET: DoctorTbls/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            DoctorTbl doctorTbl = db.DoctorTbls.Find(id);

            if (doctorTbl == null)
            {
                return(HttpNotFound());
            }
            return(View(doctorTbl));
        }
        public ActionResult Create(String firstname, String lastname)
        {
            DoctorTbl doctorTbl = new DoctorTbl();

            doctorTbl.firstname = firstname;
            doctorTbl.lastname  = lastname;
            db.DoctorTbls.Add(doctorTbl);
            db.SaveChanges();
            return(RedirectToAction("Admin", "Home"));



            return(View(doctorTbl));
        }