public ActionResult Block(bool confirm, int idKH) { if (Session["TaiKhoan"] != null) { var tk = Session["TaiKhoan"] as KhachHang; if (tk.LoaiTK == "Khách Hàng") { return(View("../Home/Index")); } else { if (confirm == true) { KhachHangDAO dao = new KhachHangDAO(); dao.Block(idKH, tk.MaKH); if (Session["UpdateKH"] != null) { var admin = Session["UpdateKH"] as KhachHang; if (admin.MaKH == idKH) { Session["UpdateKH"] = null; } } Session["ListKH"] = dao.GetList(); Session["ListKHBlock"] = dao.GetListBlock(); } return(View("Index")); } } else { return(View("../DangNhap/Index")); } }