예제 #1
0
        public ActionResult Create(Issue issue)
        {
            if (ModelState.IsValid)
            {
                db.Issues.Add(issue);
                db.SaveChanges();
                return RedirectToAction("Details", "Release", new { id = issue.ReleaseId });
            }

            ViewBag.ReleaseId = new SelectList(db.Releases, "ID", "Name", issue.ReleaseId);
            return View(issue);
        }
예제 #2
0
 public ActionResult Edit(Issue issue)
 {
     if (ModelState.IsValid)
     {
         db.Entry(issue).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Details", "Release", new { id = issue.ReleaseId });
     }
     ViewBag.ReleaseId = new SelectList(db.Releases, "ID", "Name", issue.ReleaseId);
     return View(issue);
 }