public ActionResult DeleteConfirmed(int id) { GrantTypeModels grantTypeModels = db.GrantTypeModels.Find(id); db.GrantTypeModels.Remove(grantTypeModels); db.SaveChanges(); return(RedirectToAction("Index")); }
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")); }
public ActionResult Create([Bind(Include = "Id,GrantTypeName")] GrantTypeModels grantTypeModels) { if (ModelState.IsValid) { db.GrantTypeModels.Add(grantTypeModels); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(grantTypeModels)); }
// 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)); }