Пример #1
0
        public ActionResult DeleteConfirmed(int id)
        {
            Grant_GrantType grant_granttype = db.Grant_GrantType.Single(g => g.GrantTypeID == id);

            db.Grant_GrantType.DeleteObject(grant_granttype);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Пример #2
0
        //
        // GET: /GrantType/Delete/5

        public ActionResult Delete(int id = 0)
        {
            Grant_GrantType grant_granttype = db.Grant_GrantType.Single(g => g.GrantTypeID == id);

            if (grant_granttype == null)
            {
                return(HttpNotFound());
            }
            return(View(grant_granttype));
        }
Пример #3
0
 public ActionResult Edit(Grant_GrantType grant_granttype)
 {
     if (ModelState.IsValid)
     {
         db.Grant_GrantType.Attach(grant_granttype);
         db.ObjectStateManager.ChangeObjectState(grant_granttype, EntityState.Modified);
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(grant_granttype));
 }
Пример #4
0
        public ActionResult Create(Grant_GrantType grant_granttype)
        {
            if (ModelState.IsValid)
            {
                db.Grant_GrantType.AddObject(grant_granttype);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(grant_granttype));
        }