コード例 #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            SpecialDesign specialDesign = db.SpecialDesigns.Find(id);

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

            return(View(specialDesign));
        }
コード例 #4
0
        // GET: SpecialDesigns/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            SpecialDesign specialDesign = db.SpecialDesigns.Find(id);

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