コード例 #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);
 }