public ActionResult Index() { if (Session["Account"] == null) { return Redirect("/Login"); } if (!(bool)(Session["Account"] as Account).IsManager) { return Redirect("Student"); } StudentDAO studentDAO = new StudentDAO(); RoomUsageDAO roomUsageDAO = new RoomUsageDAO(); RequestDAO requestDAO = new RequestDAO(); int totalStudentInDorm = studentDAO.GetTotalStudentInDorm(); int waterUsageMonth = roomUsageDAO.GetWaterUseageMonth(); int electricUsageMonth = roomUsageDAO.GetElectricUseageMonth(); int requestPending = requestDAO.GetTotalPendingRequest(); ViewBag.totalStudent = totalStudentInDorm; ViewBag.waterUsage = waterUsageMonth; ViewBag.electricUsage = electricUsageMonth; ViewBag.requestPending = requestPending; return View(); }