Beispiel #1
0
        /// <summary>
        /// retuns issueModel by issue id
        /// </summary>
        /// <param name="issueId"></param>
        /// <returns>IssueModel</returns>
        public IssueModel GetIssue(int issueId)
        {
            IssueModel im = new IssueModel();

            im = im.ToModel(IssueOp.GetIssueById(issueId));
            if (im.Parent != null)
            {
                int parrentIssueId = Convert.ToInt32(im.Parent);
                im.ParentTitle = IssueOp.GetIssueById(parrentIssueId).Title;
            }
            else
            {
                im.Parent = -1;
            }
            if (im.DependsOn != null)
            {
                int dependsOnIssueId = Convert.ToInt32(im.DependsOn);
                im.DependsOnTitle = IssueOp.GetIssueById(dependsOnIssueId).Title;
            }
            else
            {
                im.DependsOn = -1;
            }

            TagModel tm = new TagModel();

            im.Tags = tm.ToModelList(TagOp.GetIssueTags(issueId), tm);

            return(im);
        }
Beispiel #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="issueId">issue id</param>
        /// <param name="userId">user who is performing operation</param>
        /// <returns>user issue model by issue id</returns>
        public UserIssueModel GetUserIssueModel(int issueId, int userId)
        {
            IssueModel im = new IssueModel();

            im = im.ToModel(IssueOp.GetIssueById(issueId));
            return(GetUserIssueModelFromIssueModel(im, userId));
        }