Exemplo n.º 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            physician physician = db.physicians.Find(id);

            db.physicians.Remove(physician);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
        // GET: physicians/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            physician physician = db.physicians.Find(id);

            if (physician == null)
            {
                return(HttpNotFound());
            }
            return(View(physician));
        }
Exemplo n.º 3
0
 public ActionResult Edit([Bind(Include = "doctor_id,emp_id,department_id,special1,special2,phone,email,website,street_address1,street_address2,building_name,city,province,postal_code,user_id,fax")] physician physician)
 {
     if (ModelState.IsValid)
     {
         db.Entry(physician).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.department_id = new SelectList(db.departments, "dept_id", "dept_desc", physician.department_id);
     ViewBag.emp_id        = new SelectList(db.employees, "emp_id", "emp_position", physician.emp_id);
     ViewBag.province      = new SelectList(db.provinces, "id", "name", physician.province);
     ViewBag.special1      = new SelectList(db.specialties, "special_id", "specialty_name", physician.special1);
     ViewBag.special2      = new SelectList(db.specialties, "special_id", "specialty_name", physician.special2);
     ViewBag.user_id       = new SelectList(db.site_users, "user_id", "role_code", physician.user_id);
     return(View(physician));
 }
Exemplo n.º 4
0
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            physician physician = db.physicians.Find(id);

            if (physician == null)
            {
                return(HttpNotFound());
            }
            ViewBag.department_id = new SelectList(db.departments, "dept_id", "dept_desc", physician.department_id);
            ViewBag.emp_id        = new SelectList(db.employees, "emp_id", "emp_position", physician.emp_id);
            ViewBag.province      = new SelectList(db.provinces, "id", "name", physician.province);
            ViewBag.special1      = new SelectList(db.specialties, "special_id", "specialty_name", physician.special1);
            ViewBag.special2      = new SelectList(db.specialties, "special_id", "specialty_name", physician.special2);
            ViewBag.user_id       = new SelectList(db.site_users, "user_id", "role_code", physician.user_id);
            return(View(physician));
        }