Exemplo n.º 1
0
        public IActionResult Search(string searchString)
        {
            ApplicantIndexModel model = new ApplicantIndexModel()
            {
                Applicants = _applicant.SearchApplicant(searchString)
            };

            return(View("Index", model));
        }
Exemplo n.º 2
0
        public IActionResult Index()
        {
            // server side pagenation ?

            var allApplicants = _applicant.GetAll();

            var model = new ApplicantIndexModel()
            {
                Applicants = allApplicants
            };


            return(View(model));
        }
Exemplo n.º 3
0
        public async Task <IActionResult> Applicants(int id, string accepted, string rejected)
        {
            var user = await _userManager.GetUserAsync(User);

            var userId = _userManager.GetUserId(User);

            var betasList = _context.BetaOpportunity
                            .Select(l => new SelectListItem()
            {
                Value    = l.Id.ToString(),
                Text     = l.ProjectName,
                Selected = l.Id == id ? true : false
            }).ToList();

            var applicantList = _context.BetaOptIn.Where(b => b.BetaOpportunity.Id == id)
                                .Select(a => new ApplicantListingModel
            {
                Id                = a.Id,
                Description       = a.BetaOpportunity.ShortDescription,
                ProjectName       = a.BetaOpportunity.ProjectName,
                FullName          = a.User.FirstName + " " + a.User.LastName,
                Email             = a.User.Email,
                Accepted          = a.Accepted,
                BetaOpportunityId = a.BetaOpportunity.Id
            });

            if (!string.IsNullOrEmpty(accepted) && string.IsNullOrEmpty(rejected))
            {
                applicantList = _context.BetaOptIn.Where(b => b.BetaOpportunity.Id == id && b.Accepted == 1)
                                .Select(a => new ApplicantListingModel
                {
                    Id                = a.Id,
                    Description       = a.BetaOpportunity.ShortDescription,
                    ProjectName       = a.BetaOpportunity.ProjectName,
                    FullName          = a.User.FirstName + " " + a.User.LastName,
                    Email             = a.User.Email,
                    Accepted          = a.Accepted,
                    BetaOpportunityId = a.BetaOpportunity.Id
                });
            }
            if (!string.IsNullOrEmpty(rejected) && string.IsNullOrEmpty(accepted))
            {
                applicantList = _context.BetaOptIn.Where(b => b.BetaOpportunity.Id == id && b.Accepted == 3)
                                .Select(a => new ApplicantListingModel
                {
                    Id                = a.Id,
                    Description       = a.BetaOpportunity.ShortDescription,
                    ProjectName       = a.BetaOpportunity.ProjectName,
                    FullName          = a.User.FirstName + " " + a.User.LastName,
                    Email             = a.User.Email,
                    Accepted          = a.Accepted,
                    BetaOpportunityId = a.BetaOpportunity.Id
                });
            }


            var model = new ApplicantIndexModel
            {
                ApplicantList   = applicantList,
                BetasList       = betasList,
                AcceptedChecked = !string.IsNullOrEmpty(accepted)
            };

            return(View(model));
        }