public ActionResult Delete(long idNCC)
        {
            var tk = Session["TaiKhoan"] as KhachHang;

            if (tk == null)
            {
                return(View("../Login/Index"));
            }
            else
            {
                if (tk.LoaiTK != "Admin")
                {
                    return(View("../Home/Index"));
                }
                else
                {
                    var  db = new NhaCungCapDAO();
                    bool rs = db.DeleteNCC(idNCC);
                    if (rs == false)
                    {
                        ViewBag.Err = "Vẫn còn sách thuộc nhà cung cấp này";
                        return(View("Index"));
                    }
                    else
                    {
                        Session["UpdateNCC"] = null;
                        return(View("Index"));
                    }
                }
            }
        }
Пример #2
0
 public static void DeleteNCC(long mancc)
 {
     NhaCungCapDAO.DeleteNCC(mancc);
 }