public void AddCandidate(Candidate c) { var repo = new CandidatesRepository(_connectionString); c.Status = Status.Pending; repo.AddCandidate(c); }
public ActionResult AddCandidate(Candidate candidate) { var repo = new CandidatesRepository(Properties.Settings.Default.ConStr); repo.AddCandidate(candidate); return(Redirect("/Home/Pending")); }
public ActionResult AddCandidate(Candidate candidate) { var cRepo = new CandidatesRepository(Properties.Settings.Default.Constr); cRepo.AddCandidate(candidate); return(RedirectToAction("Index")); }
public ActionResult AddCandidate(Candidate candidate) { candidate.Status = Status.Pending; repo.AddCandidate(candidate); TempData["Message"] = "Candidate successfully added!"; return(Redirect("/")); }
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); }