Esempio n. 1
0
        public ActionResult AddIssue(Issue_for_View issueForView)
        {
            Issue _issue = new Issue()
            {
                Summary     = issueForView.Summary,
                Description = issueForView.Description,
                Assignee    = issueForView.Assignee,
                ProjectId   = issueForView.ProjectId,
                Type        = (Models.Type)Enum.Parse(typeof(Models.Type), issueForView.Type, true),
                Priority    = (Priority)Enum.Parse(typeof(Priority), issueForView.Priority, true)
            };

            return(Json(repository.addIssue(_issue)));
        }
Esempio n. 2
0
        public ActionResult IssueModal(int projectId, int id = -1)
        {
            const int nonexistentIssueId = -1;
            int       issueId            = id;

            ViewBag.Users = repository.getUsersByProjectId(projectId);
            if (issueId == nonexistentIssueId)
            {
                ViewBag.Action = "Create";
                Issue issue = new Issue();
                issue.ProjectId = projectId;
                Issue_for_View issueForView = repository.ViewIssues(new List <Issue>()
                {
                    issue
                }).First();
                issueForView.Priority = "Trivial";
                return(PartialView(issueForView));
            }
            ViewBag.Action = "Edit";
            return(PartialView(repository.getIssue(id)));
        }