Esempio n. 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Issue"/> class.
        /// </summary>
        /// <param name="issueData">
        /// Issue data from Webservice proxy.
        /// </param>
        internal Issue(MantisConnectWebservice.IssueData issueData)
        {
            this.Id                    = Convert.ToInt32(issueData.id);
            this.Project               = new ObjectRef(issueData.project);
            this.Category              = new ObjectRef(issueData.category);
            this.Summary               = issueData.summary;
            this.Description           = StringUtils.WebserviceMultilineToNative(issueData.description);
            this.StepsToReproduce      = issueData.steps_to_reproduce == null ? String.Empty : StringUtils.WebserviceMultilineToNative(issueData.steps_to_reproduce);
            this.AdditionalInformation = issueData.additional_information == null ? String.Empty : StringUtils.WebserviceMultilineToNative(issueData.additional_information);
            this.AssignedTo            = issueData.handler == null ? null : new User(issueData.handler);
            this.ReportedBy            = new User(issueData.reporter);
            this.ProductVersion        = issueData.version == null ? String.Empty : issueData.version;
            this.ProductBuild          = issueData.build == null ? String.Empty : issueData.build;
            this.Os                    = issueData.os == null ? String.Empty : issueData.os;
            this.OsBuild               = issueData.os_build == null ? String.Empty : issueData.os_build;
            this.Platform              = issueData.platform == null ? String.Empty : issueData.platform;
            this.FixedInVersion        = issueData.fixed_in_version == null ? String.Empty : issueData.fixed_in_version;
            this.SponsorshipTotal      = Convert.ToInt32(issueData.sponsorship_total);
            this.Reproducibility       = new ObjectRef(issueData.reproducibility);
            this.Resolution            = new ObjectRef(issueData.resolution);
            this.Eta                   = new ObjectRef(issueData.eta);
            this.Status                = new ObjectRef(issueData.status);
            this.Priority              = new ObjectRef(issueData.priority);
            this.Severity              = new ObjectRef(issueData.severity);
            this.Projection            = new ObjectRef(issueData.projection);
            this.ViewState             = new ObjectRef(issueData.view_state);

            this.Notes         = IssueNote.ConvertArray(issueData.notes);
            this.Attachments   = Attachment.ConvertArray(issueData.attachments);
            this.Relationships = IssueRelationship.ConvertArray(issueData.relationships);
        }
Esempio n. 2
0
        /// <summary>
        /// Get information related to the specified issue id.
        /// </summary>
        /// <param name="issueId">The id of the issue to retrieve information for.</param>
        /// <returns>The issue details, this does not include related information in other
        /// tables, like issue notes, ...etc.</returns>
        /// <exception cref="ArgumentOutOfRangeException">The issue id is 0 or negative.</exception>
        public Issue IssueGet(int issueId)
        {
            ValidateIssueId(issueId);

            MantisConnectWebservice.IssueData issueData = this.mc.mc_issue_get(
                this.session.Username,
                this.session.Password,
                issueId.ToString());

            return(issueData == null ? null : new Issue(issueData));
        }
Esempio n. 3
0
        /// <summary>
        /// Convert this instance to the type supported by the webservice proxy.
        /// </summary>
        /// <returns>
        /// A copy of this instance in the webservice proxy type.
        /// </returns>
        internal MantisConnectWebservice.IssueData ToWebservice()
        {
            MantisConnectWebservice.IssueData issueData = new MantisConnectWebservice.IssueData();

            issueData.id                     = this.Id.ToString();
            issueData.category               = this.Category.Name;
            issueData.summary                = this.Summary;
            issueData.description            = StringUtils.NativeMultilineToWebservice(this.Description);
            issueData.additional_information = StringUtils.NativeMultilineToWebservice(this.AdditionalInformation);
            issueData.steps_to_reproduce     = StringUtils.NativeMultilineToWebservice(this.StepsToReproduce);
            issueData.build                  = this.ProductBuild;
            issueData.version                = this.ProductVersion;
            issueData.os                     = this.Os;
            issueData.os_build               = this.OsBuild;
            issueData.platform               = this.Platform;
            issueData.sponsorship_total      = this.SponsorshipTotal.ToString();
            issueData.fixed_in_version       = this.FixedInVersion;
            issueData.view_state             = this.ViewState.ToWebservice();
            issueData.projection             = this.Projection.ToWebservice();
            issueData.eta                    = this.Eta.ToWebservice();
            issueData.priority               = this.Priority.ToWebservice();
            issueData.severity               = this.Severity.ToWebservice();
            issueData.project                = this.Project.ToWebservice();
            issueData.reproducibility        = this.Reproducibility.ToWebservice();
            issueData.resolution             = this.Resolution.ToWebservice();
            issueData.status                 = this.Status.ToWebservice();
            issueData.reporter               = this.ReportedBy.ToWebservice();
            issueData.handler                = this.AssignedTo == null ? null : this.AssignedTo.ToWebservice();
            issueData.date_submitted         = this.dateSubmitted;
            issueData.last_updated           = this.lastUpdated;

            issueData.notes = IssueNote.ConvertArrayToWebservice(this.Notes);

            // TODO: Attachments
            // TODO: Relationships

            return(issueData);
        }
Esempio n. 4
0
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
        internal MantisConnectWebservice.IssueData ToWebservice()
        {
            MantisConnectWebservice.IssueData issueData = new MantisConnectWebservice.IssueData();

            issueData.id = this.Id.ToString();
            issueData.category = this.Category.Name;
            issueData.summary = this.Summary;
            issueData.description = this.Description;
            issueData.additional_information = this.AdditionalInformation;
            issueData.steps_to_reproduce = this.StepsToReproduce;
            issueData.build = this.ProductBuild;
            issueData.version = this.ProductVersion;
            issueData.os = this.Os;
            issueData.os_build = this.OsBuild;
            issueData.platform = this.Platform;
            issueData.sponsorship_total = this.SponsorshipTotal.ToString();
            issueData.fixed_in_version = this.FixedInVersion;
            issueData.view_state = this.ViewState.ToWebservice();
            issueData.projection = this.Projection.ToWebservice();
            issueData.eta = this.Eta.ToWebservice();
            issueData.priority = this.Priority.ToWebservice();
            issueData.severity = this.Severity.ToWebservice();
            issueData.project = this.Project.ToWebservice();
            issueData.reproducibility = this.Reproducibility.ToWebservice();
            issueData.resolution = this.Resolution.ToWebservice();
            issueData.status = this.Status.ToWebservice();
            issueData.reporter = this.ReportedBy.ToWebservice();
            issueData.handler = this.AssignedTo.ToWebservice();
            issueData.notes = IssueNote.ConvertArrayToWebservice(this.Notes);
            issueData.target_version = this.TargetVersion;

            // TODO: Notes
            // TODO: Attachments
            // TODO: Relationships

            return issueData;
        }