Exemple #1
0
        public async Task <IActionResult> OnGetAsync()
        {
            var user = await _userManager.GetUserAsync(User);

            if (user == null)
            {
                return(RedirectToPage("/Account/Errors/AccessDenied", new { Area = "Identity" }));
            }

            if (user.AccountType == 0)
            {
                return(RedirectToPage("Pricing"));
            }

            if (user.Role.Equals(Roles.Employer) || user.Role.Equals(Roles.Recruiter))
            {
                var job = await _jobsService.GetAllAsNoTracking()
                          .Where(x => x.isApproved == ApproveType.Success && (x.PosterID == user.Id))
                          .AsQueryable()
                          .FirstOrDefaultAsync();

                ReceivedResumes = _resumeService.GetAllReceived(job);
            }

            //MyJobs = await _jobsService.GetAllCountByCondition(-1, -1, user.UserName, ApproveType.Success);

            /*
             * // Admin
             * AllJobsWaiting = await _jobsService.GetAllCountByCondition(-1, -1, null, ApproveType.Waiting, false);
             * AllCompaniesWaiting = await _companyService.GetAllCountByCondition(ApproveType.Waiting, null);
             * AllContestantsWaiting = await _contestantService.GetAllCountByCondition(-1, null, ApproveType.Waiting, false);
             *
             * // Employer & Recruiter
             * MyJobs = await _jobsService.GetAllCountByCondition(-1, -1, user.UserName, ApproveType.Success, false);
             * MyCompanies = await _companyService.GetAllCountByCondition(ApproveType.Success,user.UserName);
             * MyContestant = await _contestantService.GetAllCountByCondition(-1, user.UserName, ApproveType.Success, false);
             *
             * // Messages & Apps
             * MyMessages = await _messageService.GetMessagesCountBy_Receiver(user.UserName);
             * MyAppliedJobs = await _favouritesService.GetFavouriteByCount(user, PostType.Job);
             * MyAppsCount =  MyApps is null ? 0 : MyApps.Count();
             */
            //ViewData["Labels"] = labels;
            //ViewData["Data"] = labels;
            return(Page());
        }