コード例 #1
0
ファイル: IssueController.cs プロジェクト: hakimaissat/sjira1
        public ActionResult Create(Issue issue)
        {
            if (ModelState.IsValid)
            {
                issue.IssueId = Guid.NewGuid();
                db.Issues.Add(issue);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.IssuePriorityId = new SelectList(db.IssuePriorities, "Id", "Name", issue.IssuePriorityId);
            ViewBag.IssueResolutionId = new SelectList(db.IssueResolutions, "Id", "Name", issue.IssueResolutionId);
            ViewBag.IssueTypeId = new SelectList(db.IssueTypes, "Id", "Name", issue.IssueTypeId);
            ViewBag.ProjectId = new SelectList(db.Projects, "Id", "Name", issue.ProjectId);
            return View(issue);
        }
コード例 #2
0
ファイル: IssueController.cs プロジェクト: hakimaissat/sjira1
 public ActionResult Edit(Issue issue)
 {
     if (ModelState.IsValid)
     {
         db.Entry(issue).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.IssuePriorityId = new SelectList(db.IssuePriorities, "Id", "Name", issue.IssuePriorityId);
     ViewBag.IssueResolutionId = new SelectList(db.IssueResolutions, "Id", "Name", issue.IssueResolutionId);
     ViewBag.IssueTypeId = new SelectList(db.IssueTypes, "Id", "Name", issue.IssueTypeId);
     ViewBag.ProjectId = new SelectList(db.Projects, "Id", "Name", issue.ProjectId);
     return View(issue);
 }