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