public ActionResult DeleteConfirmed(int id) { PartAResource partAResource = db.PartAResources.Find(id); db.PartAResources.Remove(partAResource); db.SaveChanges(); return(RedirectToAction("Index")); }
public ActionResult Edit([Bind(Include = "PartAResourceID,PartAID,ResourceName,InitialCost,RecurringCost,FundingSource")] PartAResource partAResource) { if (ModelState.IsValid) { db.Entry(partAResource).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } ViewBag.PartAID = new SelectList(db.PartAs, "PartAID", "ProposalTitle", partAResource.PartAID); return(View(partAResource)); }
// GET: PartAResources/Details/5 public ActionResult Details(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PartAResource partAResource = db.PartAResources.Find(id); if (partAResource == null) { return(HttpNotFound()); } return(View(partAResource)); }
// GET: PartAResources/Edit/5 public ActionResult Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PartAResource partAResource = db.PartAResources.Find(id); if (partAResource == null) { return(HttpNotFound()); } ViewBag.PartAID = new SelectList(db.PartAs, "PartAID", "ProposalTitle", partAResource.PartAID); return(View(partAResource)); }