示例#1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Puff puff = db.Puff.Find(id);

            db.Puff.Remove(puff);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
示例#2
0
 public ActionResult Edit([Bind(Include = "Pid,Progid")] Puff puff)
 {
     if (ModelState.IsValid)
     {
         db.Entry(puff).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     ViewBag.Progid = new SelectList(db.Program, "Id", "ProgramName", "Date", puff.Progid);
     return(View(puff));
 }
示例#3
0
        public ActionResult Create([Bind(Include = "Pid,Progid")] Puff puff)
        {
            if (ModelState.IsValid)
            {
                db.Puff.Add(puff);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            ViewBag.Progid = new SelectList(db.Program, "Id", "ProgramName", puff.Progid);
            return(View(puff));
        }
示例#4
0
        // GET: Puffs/Details/5
        public ActionResult Details(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Puff puff = db.Puff.Find(id);

            if (puff == null)
            {
                return(HttpNotFound());
            }
            return(View(puff));
        }
示例#5
0
        // GET: Puffs/Edit/5
        public ActionResult Edit(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            Puff puff = db.Puff.Find(id);

            if (puff == null)
            {
                return(HttpNotFound());
            }
            ViewBag.Progid = new SelectList(db.Program, "Id", "ProgramName", "Date", puff.Progid);
            return(View(puff));
        }