public ActionResult DetailsModal(int id) { var year = DateTime.Now.Year; Candidate candidate = m_repo.GetCandidate(id, year); if (candidate == null) { candidate = new Candidate { GenotypeId = id, Year = year }; m_repo.SaveCandidate(candidate); } else { m_repo.DeleteCandidate(candidate); } Genotype genotype = m_repo.GetGenotype(id); if (genotype == null) { return(RedirectToAction("List")); } return(PartialView("_DetailsModal", genotype)); }
public ActionResult DeleteConfirmed(int id) { Candidate candidate = m_repo.GetCandidate(id); m_repo.DeleteCandidate(candidate); return(RedirectToAction("Index")); }