コード例 #1
0
        public IActionResult Applications(ManagerApplicationViewModel model)
        {
            var OnProcessStatus = new List <string> {
                "Submitted", "Pending", "Interviewed"
            };
            var CompletedStatus = new List <string> {
                "Offer Extended", "Rejected", "Offer Declined", "Offer Accepted"
            };
            var Application = _context.Application.Select(m => m);
            int onprocess   = Application.Where(m => OnProcessStatus.Contains(m.Status)).Count();
            int completed   = Application.Where(m => CompletedStatus.Contains(m.Status)).Count();

            if (model.SelectedJob != null)
            {
                Application = Application.Where(m => m.Job.Name == model.SelectedJob);
            }
            if (model.ApplicationStatus != null)
            {
                Application = Application.Where(m => m.Status == model.ApplicationStatus);
            }
            if (model.OmitApplications == true)
            {
                Application = Application.Where(m => m.MatchRate >= 30);
            }
            model.JobSelectList = new SelectList((_context.Job.Select(m => m.Name)).ToList());
            var ApplicationList = Application.OrderByDescending(m => m.MatchRate).ToList();

            FullFillInformation(ApplicationList);
            model.AllApplications = ApplicationList;
            model.OnProcess       = onprocess;
            model.Completed       = completed;

            return(View(model));
        }
コード例 #2
0
        public IActionResult Applications()
        {
            var OnProcessStatus = new List <string> {
                "Submitted", "Pending", "Interviewed"
            };
            var CompletedStatus = new List <string> {
                "Offer Extended", "Rejected", "Offer Declined", "Offer Accepted"
            };
            var Application     = _context.Application.Select(m => m);
            int onprocess       = Application.Where(m => OnProcessStatus.Contains(m.Status)).Count();
            int completed       = Application.Where(m => CompletedStatus.Contains(m.Status)).Count();
            var ApplicationList = Application.ToList();

            FullFillInformation(ApplicationList);
            ManagerApplicationViewModel model = new ManagerApplicationViewModel()
            {
                JobSelectList   = new SelectList((_context.Job.Select(m => m.Name)).ToList()),
                AllApplications = ApplicationList,
                OnProcess       = onprocess,
                Completed       = completed
            };

            return(View(model));
        }