public ActionResult Index() { if (!user.IsAdmin()) { return(View("Error")); } Model.UpdateLastLogin(); Model.UpdateLastSeen("Trang Chủ", Url.Action("Index")); Dictionary <string, int> ListCount = Model.GetDashBoard(); return(View(ListCount)); }
AdminDA Model = new AdminDA(); // Tạo biến lưu Admin public ActionResult Index() { if (!user.IsAdmin()) { return(View("Error")); // Nếu không sẽ báo lỗi } // Nếu đúng Model.UpdateLastLogin(); Model.UpdateLastSeen("Trang Chủ", Url.Action("Index")); Dictionary <string, int> ListCount = Model.GetDashBoard(); // Đếm sô lượng return(View(ListCount)); // Trả về giao diện số lượng đếm được }