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