public async Task <ActionResult> DeleteConfirmed(string id) { QuanBan quanBan = await db.QuanBans.FindAsync(id); db.QuanBans.Remove(quanBan); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "MaQuan,TenQuan")] QuanBan quanBan) { if (ModelState.IsValid) { db.Entry(quanBan).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(quanBan)); }
public async Task <ActionResult> Create([Bind(Include = "MaQuan,TenQuan")] QuanBan quanBan) { if (ModelState.IsValid) { db.QuanBans.Add(quanBan); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(quanBan)); }
// GET: QuanBans/Delete/5 public async Task <ActionResult> Delete(string id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } QuanBan quanBan = await db.QuanBans.FindAsync(id); if (quanBan == null) { return(HttpNotFound()); } return(View(quanBan)); }