Ejemplo n.º 1
0
        // GET: Admin
        //[Route("adminLogin")]
        public ActionResult Index()
        {
            var summaryModel = new AdminSummaryViewModel
            {
                BatchesCount          = _batchService.GetBatchesCount(),
                BranchesCount         = _branchService.GetBranchesCount(),
                ClientsCount          = _clientService.GetClientsCount(),
                StudentsCount         = _studentService.GetStudentsCount(),
                TeachersCount         = _teacherService.GetTeachersCount(),
                PendingAdmissionCount = _apiService.GetPendingAdmission(),
            };
            var roleUserId = User.Identity.GetUserId();
            var roles      = _aspNetRolesService.GetCurrentUserRole(roleUserId);

            if (roles == "Student")
            {
                return(RedirectToAction("Index", "StudentDashBoard"));
            }
            else
            {
                return(View(summaryModel));
            }
        }