public async Task <ActionResult> DeleteConfirmed(long id) { CapDau capDau = await db.CapDaus.FindAsync(id); db.CapDaus.Remove(capDau); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "ID_capdau,IDclbNha,IDclbKhach")] CapDau capDau) { if (ModelState.IsValid) { db.Entry(capDau).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } ViewBag.IDclbNha = new SelectList(db.CLBs, "IDclb", "TenClb", capDau.IDclbNha); ViewBag.IDclbKhach = new SelectList(db.CLBs, "IDclb", "TenClb", capDau.IDclbKhach); return(View(capDau)); }
// GET: Admin/CapDaus/Details/5 public async Task <ActionResult> Details(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CapDau capDau = await db.CapDaus.FindAsync(id); if (capDau == null) { return(HttpNotFound()); } return(View(capDau)); }
// GET: Admin/CapDaus/Edit/5 public async Task <ActionResult> Edit(long?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } CapDau capDau = await db.CapDaus.FindAsync(id); if (capDau == null) { return(HttpNotFound()); } ViewBag.IDclbNha = new SelectList(db.CLBs, "IDclb", "TenClb", capDau.IDclbNha); ViewBag.IDclbKhach = new SelectList(db.CLBs, "IDclb", "TenClb", capDau.IDclbKhach); return(View(capDau)); }
public long Insert(CapDau entity) { db.CapDaus.Add(entity); db.SaveChanges(); return(entity.ID_capdau); }