Esempio n. 1
0
        public ActionResult DeleteConfirmed(int id)
        {
            GrantTypeModels grantTypeModels = db.GrantTypeModels.Find(id);

            db.GrantTypeModels.Remove(grantTypeModels);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 2
0
 public ActionResult Edit([Bind(Include = "Id,GrantTypeName")] GrantTypeModels grantTypeModels)
 {
     if (ModelState.IsValid)
     {
         db.Entry(grantTypeModels).State = EntityState.Modified;
         db.SaveChanges();
         return(RedirectToAction("Index"));
     }
     return(View(grantTypeModels));
 }
        public ActionResult DeleteGrant(GrantTypeModels model)
        {
            var             id = model.Id;
            GrantTypeModels grantTypeModels = db.GrantTypeModels.Find(id);

            grantTypeModels.Deleted = DateTime.Now;
            db.GrantTypeModels.AddOrUpdate(grantTypeModels);
            db.SaveChanges();
            return(RedirectToAction("Index"));
        }
Esempio n. 4
0
        public ActionResult Create([Bind(Include = "Id,GrantTypeName")] GrantTypeModels grantTypeModels)
        {
            if (ModelState.IsValid)
            {
                db.GrantTypeModels.Add(grantTypeModels);
                db.SaveChanges();
                return(RedirectToAction("Index"));
            }

            return(View(grantTypeModels));
        }
Esempio n. 5
0
        // GET: GrantType/Delete/5
        public ActionResult Delete(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            GrantTypeModels grantTypeModels = db.GrantTypeModels.Find(id);

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