コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Plaqueta plaqueta = db.Plaquetas.Find(id);

            db.Plaquetas.Remove(plaqueta);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
コード例 #2
0
 public ActionResult Edit([Bind(Include = "PlaquetaID,Ativada")] Plaqueta plaqueta)
 {
     if (ModelState.IsValid)
     {
         db.Entry(plaqueta).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(plaqueta));
 }
コード例 #3
0
        public ActionResult Create([Bind(Include = "PlaquetaID,Ativada")] Plaqueta plaqueta)
        {
            if (ModelState.IsValid)
            {
                db.Plaquetas.Add(plaqueta);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(plaqueta));
        }
コード例 #4
0
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Plaqueta plaqueta = db.Plaquetas.Find(id);

            if (plaqueta == null)
            {
                return(HttpNotFound());
            }
            return(View(plaqueta));
        }