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

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

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

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