Example #1
0
        //
        // GET: /Category/Delete/5

        public ActionResult Delete(int id = 0)
        {
            Grant_Category grant_category = db.Grant_Category.Single(g => g.CategoryID == id);

            if (grant_category == null)
            {
                return(HttpNotFound());
            }
            return(View(grant_category));
        }
Example #2
0
        public ActionResult DeleteConfirmed(int id)
        {
            Grant_Category grant_category = db.Grant_Category.Single(g => g.CategoryID == id);

            db.Grant_Category.DeleteObject(grant_category);

            db.SaveChanges();

            return(RedirectToAction("Index"));
        }
Example #3
0
 public ActionResult Edit(Grant_Category grant_category)
 {
     if (ModelState.IsValid)
     {
         db.Grant_Category.Attach(grant_category);
         db.ObjectStateManager.ChangeObjectState(grant_category, EntityState.Modified);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(grant_category));
 }
Example #4
0
        public ActionResult Create(Grant_Category grant_category)
        {
            if (ModelState.IsValid)
            {
                db.Grant_Category.AddObject(grant_category);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(grant_category));
        }