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));
        }
示例#5
0
 public void XoaDuLieu(PhanLoaiSach et)
 {
     cn.ThucThiCauLenhSQL(@"DELETE  from  PHANLOAISACH where MaLoaiSach='" + et.Maloaisach + "'");
 }
示例#6
0
 public void SuaDuLieu(PhanLoaiSach et)
 {
     cn.ThucThiCauLenhSQL(@"UPDATE    PHANLOAISACH SET   TenLoai =N'" + et.Tenloai + "' where MaLoaiSach='" + et.Maloaisach + "'");
 }
示例#7
0
 public void ThemDuLieu(PhanLoaiSach et)
 {
     cn.ThucThiCauLenhSQL(@"INSERT INTO PHANLOAISACH (MaLoaiSach,TenLoai) VALUES     ('" + et.Maloaisach + "',N'" + et.Tenloai + "')");
 }
示例#8
0
 public void XoaDuLieu(PhanLoaiSach et)
 {
     sql.XoaDuLieu(et);
 }
示例#9
0
 public void SuaDuLieu(PhanLoaiSach et)
 {
     sql.SuaDuLieu(et);
 }
示例#10
0
 public void ThemDuLieu(PhanLoaiSach et)
 {
     sql.ThemDuLieu(et);
 }