Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            PatientsInfo patientsInfo = db.PatientsInfoes.Find(id);

            db.PatientsInfoes.Remove(patientsInfo);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
 public ActionResult Edit([Bind(Include = "PatientID,Firstname,Lastname,DateOfBirth,AddressID,DocID")] PatientsInfo patientsInfo)
 {
     if (ModelState.IsValid)
     {
         db.Entry(patientsInfo).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.AddressID = new SelectList(db.Addresses, "AddressID", "Street", patientsInfo.AddressID);
     ViewBag.DocID     = new SelectList(db.Doctors, "DoctID", "Firstname", patientsInfo.DocID);
     return(View(patientsInfo));
 }
Пример #3
0
        // GET: PatientsInfoes/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PatientsInfo patientsInfo = db.PatientsInfoes.Find(id);

            if (patientsInfo == null)
            {
                return(HttpNotFound());
            }
            return(View(patientsInfo));
        }
Пример #4
0
        // GET: PatientsInfoes/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PatientsInfo patientsInfo = db.PatientsInfoes.Find(id);

            if (patientsInfo == null)
            {
                return(HttpNotFound());
            }
            ViewBag.AddressID = new SelectList(db.Addresses, "AddressID", "Street", patientsInfo.AddressID);
            ViewBag.DocID     = new SelectList(db.Doctors, "DoctID", "Firstname", patientsInfo.DocID);
            return(View(patientsInfo));
        }