/// <summary>
        /// Binds the data.
        /// </summary>
        private void BindData()
        {
            CommentsCount   = ContentCommentRepository.GetCommentsCount(CurrentUser.Instance.SiteID, ContentId, CommentType);
            OfficialComment = ContentCommentRepository.SelectOfficialComment(CurrentUser.Instance.SiteID, ContentId, CommentType);

            tbl_ServiceLevelClient serviceLevelClient = null;

            var dataManager = new DataManager();

            switch (CommentType)
            {
            case CommentTables.tbl_RequirementComment:
                var requirement = dataManager.Requirement.SelectById(CurrentUser.Instance.SiteID, ContentId);
                if (requirement != null)
                {
                    serviceLevelClient =
                        requirement.tbl_ServiceLevel.tbl_ServiceLevelClient.FirstOrDefault(
                            o => o.ClientID == requirement.CompanyID);
                }
                break;

            case CommentTables.tbl_RequestComment:
                var request = dataManager.Request.SelectById(CurrentUser.Instance.SiteID, ContentId);
                if (request != null)
                {
                    serviceLevelClient =
                        request.tbl_ServiceLevel.tbl_ServiceLevelClient.FirstOrDefault(
                            o => o.ClientID == request.CompanyID);
                }
                break;
            }

            if (serviceLevelClient != null)
            {
                rprDesitnations.DataSource = serviceLevelClient.tbl_ServiceLevelContact.Where(
                    o => o.tbl_Contact.tbl_User.FirstOrDefault() != null).Select(
                    o =>
                    new
                {
                    UserID = o.tbl_Contact.tbl_User.FirstOrDefault().ID,
                    o.tbl_Contact.UserFullName
                });
                rprDesitnations.DataBind();
            }
        }
示例#2
0
 /// <summary>
 /// Binds the data.
 /// </summary>
 private void BindData()
 {
     CommentsCount   = ContentCommentRepository.GetCommentsCount(CurrentUser.Instance.SiteID, ContentId, CommentType, true);
     OfficialComment = ContentCommentRepository.SelectOfficialComment(CurrentUser.Instance.SiteID, ContentId, CommentType);
 }