public async Task <ActionResult> DeleteConfirmed(int id) { LoaAmendment loaAmendment = await db.LoaAmendments.FindAsync(id); db.LoaAmendments.Remove(loaAmendment); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "ID,LoaPackageId,Name,Date")] LoaAmendment loaAmendment) { if (ModelState.IsValid) { db.Entry(loaAmendment).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.LoaPackageId = new SelectList(db.LoaPackages, "ID", "No", loaAmendment.LoaPackageId); return(View(loaAmendment)); }
// GET: LoaAmendments/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LoaAmendment loaAmendment = await db.LoaAmendments.FindAsync(id); if (loaAmendment == null) { return(HttpNotFound()); } return(View(loaAmendment)); }
// GET: LoaAmendments/Edit/5 public async Task <ActionResult> Edit(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } LoaAmendment loaAmendment = await db.LoaAmendments.FindAsync(id); if (loaAmendment == null) { return(HttpNotFound()); } ViewBag.LoaPackageId = new SelectList(db.LoaPackages, "ID", "No", loaAmendment.LoaPackageId); return(View(loaAmendment)); }