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

            db.Patient2.Remove(patient2);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Exemplo n.º 2
0
 public ActionResult Edit([Bind(Include = "Id,Name,Email,Address,Telephone,dateOfBirth,DoctorId")] Patient2 patient2)
 {
     if (ModelState.IsValid)
     {
         db.Entry(patient2).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.DoctorId = new SelectList(db.Doctors, "Id", "Name", patient2.DoctorId);
     return(View(patient2));
 }
        public void Equal3_Test()
        {
            var p    = Parameter(typeof(Patient));
            var pp   = new Patient2();
            var body = Equal(Constant(pp), p);
            Expression <Func <Patient, bool> > e = (o) => o == pp;
            var expr = Lambda <Func <Patient, bool> >(body, p);

            var compiled = expr.CompileFast(true);
            var c        = expr.Compile();

            Assert.AreEqual(c(pp), compiled(pp));
            Assert.AreEqual(c(new Patient()), compiled(new Patient()));
        }
Exemplo n.º 4
0
        // GET: Patient2/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Patient2 patient2 = db.Patient2.Find(id);

            if (patient2 == null)
            {
                return(HttpNotFound());
            }
            return(View(patient2));
        }
Exemplo n.º 5
0
        // GET: Patient2/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Patient2 patient2 = db.Patient2.Find(id);

            if (patient2 == null)
            {
                return(HttpNotFound());
            }
            ViewBag.DoctorId = new SelectList(db.Doctors, "Id", "Name", patient2.DoctorId);
            return(View(patient2));
        }