public async Task <ActionResult> DeleteConfirmed(int id) { PhanLoaiSach phanLoaiSach = await db.PhanLoaiSaches.FindAsync(id); db.PhanLoaiSaches.Remove(phanLoaiSach); await db.SaveChangesAsync(); return(RedirectToAction("Index")); }
public async Task <ActionResult> Edit([Bind(Include = "MaLoai,TenLoai")] PhanLoaiSach phanLoaiSach) { if (ModelState.IsValid) { db.Entry(phanLoaiSach).State = EntityState.Modified; await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(phanLoaiSach)); }
public async Task <ActionResult> Create([Bind(Include = "MaLoai,TenLoai")] PhanLoaiSach phanLoaiSach) { if (ModelState.IsValid) { db.PhanLoaiSaches.Add(phanLoaiSach); await db.SaveChangesAsync(); return(RedirectToAction("Index")); } return(View(phanLoaiSach)); }
// GET: AdminPhanLoaiSaches/Delete/5 public async Task <ActionResult> Delete(int?id) { if (id == null) { return(new HttpStatusCodeResult(HttpStatusCode.BadRequest)); } PhanLoaiSach phanLoaiSach = await db.PhanLoaiSaches.FindAsync(id); if (phanLoaiSach == null) { return(HttpNotFound()); } return(View(phanLoaiSach)); }
public void XoaDuLieu(PhanLoaiSach et) { cn.ThucThiCauLenhSQL(@"DELETE from PHANLOAISACH where MaLoaiSach='" + et.Maloaisach + "'"); }
public void SuaDuLieu(PhanLoaiSach et) { cn.ThucThiCauLenhSQL(@"UPDATE PHANLOAISACH SET TenLoai =N'" + et.Tenloai + "' where MaLoaiSach='" + et.Maloaisach + "'"); }
public void ThemDuLieu(PhanLoaiSach et) { cn.ThucThiCauLenhSQL(@"INSERT INTO PHANLOAISACH (MaLoaiSach,TenLoai) VALUES ('" + et.Maloaisach + "',N'" + et.Tenloai + "')"); }
public void XoaDuLieu(PhanLoaiSach et) { sql.XoaDuLieu(et); }
public void SuaDuLieu(PhanLoaiSach et) { sql.SuaDuLieu(et); }
public void ThemDuLieu(PhanLoaiSach et) { sql.ThemDuLieu(et); }