示例#1
0
        public ActionResult Index(int? parentId, string text, string stackTrace, string serverVariables, string source, string version)
        {
            Issue parentIssue = null;
            if (parentId.HasValue)
                parentIssue = _db.Issues.FirstOrDefault(x => x.Id == parentId.Value);

            if (parentIssue != null)
            {
                parentIssue.AddComment(source, text);
                return new JsonResult
                {
                    Data = parentIssue.Id
                };
            }

            var issue = new CreateIssueService(_db).Create(source, text, stackTrace, serverVariables, version);
            return new JsonResult
            {
                Data = issue == null ? 0 : issue.Id
            };
        }
示例#2
0
 public int CreateIssue(string creator, string text, string stackTrace, string serverVariables)
 {
     var issue = new CreateIssueService(new Db()).Create(creator, text, stackTrace, serverVariables, null);
     return issue == null ? 0 : issue.Id;
 }