Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            anm_Categories anm_categories = db.anm_Categories.Single(a => a.idcategory == id);

            db.anm_Categories.DeleteObject(anm_categories);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        public ActionResult Create(anm_Categories anm_categories)
        {
            if (ModelState.IsValid)
            {
                db.anm_Categories.AddObject(anm_categories);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(anm_categories));
        }
Пример #3
0
 public ActionResult Edit(anm_Categories anm_categories)
 {
     if (ModelState.IsValid)
     {
         db.anm_Categories.Attach(anm_categories);
         db.ObjectStateManager.ChangeObjectState(anm_categories, EntityState.Modified);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(anm_categories));
 }
Пример #4
0
        //
        // GET: /Admin/Category/Delete/5

        public ActionResult Delete(int id)
        {
            anm_Categories anm_categories = db.anm_Categories.Single(a => a.idcategory == id);

            return(View(anm_categories));
        }
Пример #5
0
        //
        // GET: /Admin/Category/Details/5

        public ViewResult Details(int id)
        {
            anm_Categories anm_categories = db.anm_Categories.Single(a => a.idcategory == id);

            return(View(anm_categories));
        }