Beispiel #1
0
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (dialogTbx.Tag == null)
            {
                MessageBox.Show("You must select a dialog.");
                return;
            }

            Issue issue = new Issue();

            issue.Severity    = IssueSeverityType.Error;
            issue.Title       = string.Format("{0} / {1} : {2}", (dialogTbx.Tag as Dialog).Module.Name, dialogTbx.Text, nameTbx.Text);
            issue.Text        = textTbx.Text;
            issue.ObjectId    = (dialogTbx.Tag as Dialog).Id;
            issue.ObjectType  = IssueObjectType.Bug;
            issue.Application = FrontendApplication;

            analyzeService.SaveOrUpdateIssue(issue);

            Issue = issue;

            DialogResult = DialogResult.OK;

            Close();
        }
        public void Add(IssueSeverityType type, string text, object tag)
        {
            if (type != IssueSeverityType.None)
            {
                // Check if ParentNode has an Application, IssueObjectType and IssueObjectId defined or
                // it's not possible to add to the IssueList. Give an exception!
                if (ParentNode.Application == null ||
                    ParentNode.IssueObjectType == null ||
                    ParentNode.IssueObjectId == null)
                {
                    throw new Exception("You may not create any Issues to a IssueNode that doesn't have Application, IssueObjectType and IssueObjectId set!");
                }

                // Check if issue exist already
                Issue currentIssue = analyzeService.FindIssue(ParentNode.Application.Id, (IssueObjectType)ParentNode.IssueObjectType, ParentNode.IssueObjectId, GetTitle(), text);

                if (currentIssue != null)
                {
                    // Set the tag and the severity type
                    currentIssue.Tag      = tag;
                    currentIssue.Severity = type;

                    // Save Issue
                    analyzeService.SaveOrUpdateIssue(currentIssue);
                }
                else
                {
                    // Create the new Issue
                    currentIssue             = new Issue();
                    currentIssue.Application = ParentNode.Application;
                    currentIssue.ObjectType  = (IssueObjectType)ParentNode.IssueObjectType;
                    currentIssue.ObjectId    = ParentNode.IssueObjectId;
                    currentIssue.Severity    = type;
                    currentIssue.Tag         = tag;
                    currentIssue.Text        = text;
                    currentIssue.Title       = GetTitle();
                    currentIssue.Hidden      = false;

                    // Save the Issue
                    analyzeService.SaveOrUpdateIssue(currentIssue);
                }

                // Add the found or created issue to the list.
                base.Add(currentIssue);
            }
        }
Beispiel #3
0
        private void btnSaveSelection_Click(object sender, EventArgs e)
        {
            foreach (ListViewItem item in lvIssueList.Items)
            {
                Issue issue = item.Tag as Issue;

                if (issue.Hidden != issue.IsNewHiddenValue)
                {
                    issue.Hidden = issue.IsNewHiddenValue;

                    analyzeService.SaveOrUpdateIssue(issue);
                }
            }

            ShowIssueNodeTree();
            ShowCurrentWorkingIssueList();
        }