コード例 #1
0
ファイル: IssueTabs.ascx.cs プロジェクト: scottstokes/bugnet
        /// <summary>
        /// Gets the name of the tab.
        /// </summary>
        /// <param name="tabName"></param>
        /// <param name="tabValue"></param>
        /// <returns></returns>
        private string GetTabName(string tabName, string tabValue)
        {
            switch (tabValue.ToLower())
            {
            case "tabcomments":
                return(string.Format("{0} ({1})", tabName, IssueId == 0 ? 0 : IssueCommentManager.GetByIssueId(IssueId).Count));

            case "tabhistory":
                return(string.Format("{0} ({1})", tabName, IssueId == 0 ? 0 : IssueHistoryManager.GetByIssueId(IssueId).Count));

            case "tabattachments":
                return(string.Format("{0} ({1})", tabName, IssueId == 0 ? 0 : IssueAttachmentManager.GetByIssueId(IssueId).Count));

            case "tabnotifications":
                return(string.Format("{0} ({1})", tabName, IssueId == 0 ? 0 : IssueNotificationManager.GetByIssueId(IssueId).Count));

            case "tabrelatedissues":
                return(string.Format("{0} ({1})", tabName, IssueId == 0 ? 0 : RelatedIssueManager.GetRelatedIssues(IssueId).Count));

            case "tabparentissues":
                return(string.Format("{0} ({1})", tabName, IssueId == 0 ? 0 : RelatedIssueManager.GetParentIssues(IssueId).Count));

            case "tabsubissues":
                return(string.Format("{0} ({1})", tabName, IssueId == 0 ? 0 : RelatedIssueManager.GetChildIssues(IssueId).Count));

            case "tabrevisions":
                return(string.Format("{0} ({1})", tabName, IssueId == 0 ? 0 : IssueRevisionManager.GetByIssueId(IssueId).Count));

            case "tabtimetracking":
                return(string.Format("{0} ({1})", tabName, IssueId == 0 ? 0 : IssueWorkReportManager.GetByIssueId(IssueId).Count));

            default:
                return(tabName);
            }
        }
コード例 #2
0
ファイル: IssueTabs.ascx.cs プロジェクト: anycall/bugnet
        /// <summary>
        /// Gets the name of the tab.
        /// </summary>
        /// <param name="tabName"></param>
        /// <param name="tabValue"></param>
        /// <returns></returns>
        private string GetTabName(string tabName, string tabValue)
        {
            int cnt;

            switch (tabValue.ToLower())
            {
            case "tabcomments":
                cnt = IssueId == 0 ? 0 : IssueCommentManager.GetByIssueId(IssueId).Count;
                return(string.Format("<span class='{2}'>{0} ({1})</span>", tabName, cnt, cnt == 0 ? "normal" : "bold"));

            case "tabhistory":
                cnt = IssueId == 0 ? 0 : IssueHistoryManager.GetByIssueId(IssueId).Count;
                return(string.Format("<span class='{2}'>{0} ({1})</span>", tabName, cnt, cnt == 0 ? "normal" : "normal"));

            case "tabattachments":
                cnt = IssueId == 0 ? 0 : IssueAttachmentManager.GetByIssueId(IssueId).Count;
                return(string.Format("<span class='{2}'>{0} ({1})</span>", tabName, cnt, cnt == 0 ? "normal" : "bold"));

            case "tabnotifications":
                cnt = IssueId == 0 ? 0 : IssueNotificationManager.GetByIssueId(IssueId).Count;
                return(string.Format("<span class='{2}'>{0} ({1})</span>", tabName, cnt, cnt == 0 ? "normal" : "normal"));

            case "tabrelatedissues":
                cnt = IssueId == 0 ? 0 : RelatedIssueManager.GetRelatedIssues(IssueId).Count;
                return(string.Format("<span class='{2}'>{0} ({1})</span>", tabName, cnt, cnt == 0 ? "normal" : "bold"));

            case "tabparentissues":
                cnt = IssueId == 0 ? 0 : RelatedIssueManager.GetParentIssues(IssueId).Count;
                return(string.Format("<span class='{2}'>{0} ({1})</span>", tabName, cnt, cnt == 0 ? "normal" : "bold"));

            case "tabsubissues":
                cnt = IssueId == 0 ? 0 : RelatedIssueManager.GetChildIssues(IssueId).Count;
                return(string.Format("<span class='{2}'>{0} ({1})</span>", tabName, cnt, cnt == 0 ? "normal" : "bold"));

            case "tabrevisions":
                cnt = IssueId == 0 ? 0 : IssueRevisionManager.GetByIssueId(IssueId).Count;
                return(string.Format("<span class='{2}'>{0} ({1})</span>", tabName, cnt, cnt == 0 ? "normal" : "normal"));

            case "tabtimetracking":
                cnt = IssueId == 0 ? 0 : IssueWorkReportManager.GetByIssueId(IssueId).Count;
                return(string.Format("<span class='{2}'>{0} ({1})</span>", tabName, cnt, cnt == 0 ? "normal" : "normal"));

            default:
                return(tabName);
            }
        }
コード例 #3
0
ファイル: Comments.ascx.cs プロジェクト: zdzislaw/bugnet
        /// <summary>
        /// Binds the comments.
        /// </summary>
        private void BindComments()
        {
            IList comments = IssueCommentManager.GetByIssueId(IssueId);

            if (comments.Count == 0)
            {
                lblComments.Text    = GetLocalResourceObject("NoComments").ToString();
                lblComments.Visible = true;
                rptComments.Visible = false;
            }
            else
            {
                _issueOwnerUserId   = IssueManager.GetById(IssueId).OwnerUserId;
                lblComments.Visible = false;

                rptComments.DataSource = comments;
                rptComments.DataBind();
                rptComments.Visible = true;
            }
        }