public void AddCandidate(Candidate c)
        {
            var repo = new CandidatesRepository(_connectionString);

            c.Status = Status.Pending;
            repo.AddCandidate(c);
        }
Ejemplo n.º 2
0
        public ActionResult AddCandidate(Candidate candidate)
        {
            var repo = new CandidatesRepository(Properties.Settings.Default.ConStr);

            repo.AddCandidate(candidate);
            return(Redirect("/Home/Pending"));
        }
Ejemplo n.º 3
0
        public ActionResult AddCandidate(Candidate candidate)
        {
            var cRepo = new CandidatesRepository(Properties.Settings.Default.Constr);

            cRepo.AddCandidate(candidate);
            return(RedirectToAction("Index"));
        }
Ejemplo n.º 4
0
 public ActionResult AddCandidate(Candidate candidate)
 {
     candidate.Status = Status.Pending;
     repo.AddCandidate(candidate);
     TempData["Message"] = "Candidate successfully added!";
     return(Redirect("/"));
 }
Ejemplo n.º 5
0
        public async Task <IActionResult> Create(CandidateViewModel candidate)
        {
            if (!ModelState.IsValid)
            {
                return(RedirectToAction(nameof(Create)));
            }
            try
            {
                await _candidate.AddCandidate(candidate);

                return(RedirectToAction(nameof(Index)));
            }
            catch
            {
                return(RedirectToAction(nameof(HomeController.Error), "Home"));
            }
        }
        public void AddCandidate(Candidate candidate)
        {
            var repo = new CandidatesRepository(_connectionString);

            repo.AddCandidate(candidate);
        }