public async Task <ActionResult> DeleteConfirmed(int id) { BacDaoTao bacDaoTao = await db.BacDaoTaos.FindAsync(id); db.BacDaoTaos.Remove(bacDaoTao); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "MaBacDT,TenBacDT")] BacDaoTao bacDaoTao) { if (ModelState.IsValid) { db.Entry(bacDaoTao).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(bacDaoTao)); }
public async Task <ActionResult> Create([Bind(Include = "MaBacDT,TenBacDT")] BacDaoTao bacDaoTao) { if (ModelState.IsValid) { db.BacDaoTaos.Add(bacDaoTao); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(bacDaoTao)); }
// GET: AdminBacDaoTao/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } BacDaoTao bacDaoTao = await db.BacDaoTaos.FindAsync(id); if (bacDaoTao == null) { return(HttpNotFound()); } return(View(bacDaoTao)); }