Ejemplo n.º 1
0
        public ActionResult Create(CandidateIssue candidateissue)
        {
            if (ModelState.IsValid)
            {
                context.CandidateIssues.Add(candidateissue);
                context.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.PossibleCandidates = context.Candidates;
            ViewBag.PossibleIssues = context.Issues;
            return View(candidateissue);
        }
Ejemplo n.º 2
0
 public ActionResult Edit(CandidateIssue candidateissue)
 {
     if (ModelState.IsValid)
     {
         context.Entry(candidateissue).State = EntityState.Modified;
         context.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.PossibleCandidates = context.Candidates;
     ViewBag.PossibleIssues = context.Issues;
     return View(candidateissue);
 }