Esempio n. 1
0
        public ActionResult AddCandidate(Candidate candidate)
        {
            var manager = new CandidateRepository(Properties.Settings.Default.ConStr);

            manager.AddCandidate(candidate);
            return(Redirect("/home/pending"));
        }
Esempio n. 2
0
        public async Task AddCandidate_ShouldAddOneCandidate()
        {
            var options = new DbContextOptionsBuilder <GeekHunterContext>()
                          .UseInMemoryDatabase("AddCandidate_ShouldAddOneCandidate")
                          .Options;

            var context = new GeekHunterContext(options);

            await Seed(context);

            CandidateRepository candidateRepository = new CandidateRepository(context);

            await candidateRepository.AddCandidate(new AddCandidateDto
            {
                FirstName = "TestFirstName",
                LastName  = "TestLastName",
                Skills    = new List <string> {
                    "SQL", "Entity Framework"
                }
            });

            var candidates = (await candidateRepository.GetCandidates()).ToList();

            Assert.Equal(4, candidates.Count);
            var addedCustomer = candidates[3];

            Assert.Equal("TestFirstName", addedCustomer.FirstName);
            Assert.Equal("TestLastName", addedCustomer.LastName);
            Assert.Equal(2, addedCustomer.Skills.Count);
        }
Esempio n. 3
0
        public ActionResult Candidate(Applicant applicant)
        {
            var repo = new CandidateRepository(Properties.Settings.Default.ConStr);

            repo.AddCandidate(applicant);
            return(Redirect("/home/index"));
        }
Esempio n. 4
0
        public IActionResult AddCandidate(Candidate candidate)
        {
            var manager = new CandidateRepository(_connectionString);

            manager.AddCandidate(candidate);
            return(Redirect("/home/pending"));
        }
Esempio n. 5
0
        public void AddCandidate(Candidate candidate)
        {
            var repo = new CandidateRepository(_connectionString);

            candidate.Status = Status.Pending;
            repo.AddCandidate(candidate);
        }
Esempio n. 6
0
        public IActionResult AddCandidate(Candidates candidate)
        {
            candidate.Status = Status.Pending;
            CandidateRepository repo = new CandidateRepository(_connectionString);

            repo.AddCandidate(candidate);
            return(Redirect("/home/candidates"));
        }
Esempio n. 7
0
        public Candidate AddCandidate(Candidate candidate)
        {
            using (var candidateRepo = new CandidateRepository())
            {
                candidateRepo.AddCandidate(Mapper.Map <Datacom.CorporateSys.Hire.Domain.Models.Candidate>(candidate));
            }

            return(candidate);
        }
        public ActionResult AddCandidate(string firstName, string lastName, string phoneNumber, string email, string notes)
        {
            var db = new CandidateRepository(Properties.Settings.Default.ConStr);

            db.AddCandidate(new Candidate
            {
                FirstName   = firstName,
                LastName    = lastName,
                PhoneNumber = phoneNumber,
                Email       = email,
                Notes       = notes,
                Status      = Status.Pending
            });
            return(Redirect("/Home/Pending"));
        }
Esempio n. 9
0
        public void AddCandidate(Candidate c)
        {
            var repo = new CandidateRepository(_connection);

            repo.AddCandidate(c);
        }
        public void AddCandidate(Candidate candidate)
        {
            var repo = new CandidateRepository(_connectionString);

            repo.AddCandidate(candidate);
        }