//发布一个新的评语
 private MB.Util.Model.BfModuleCommentInfo createNewCommentInfo()
 {
     MB.Util.Model.BfModuleCommentInfo newInfo = new MB.Util.Model.BfModuleCommentInfo();
     newInfo.COMMENT_TYPE         = cobCommentType.Text;
     newInfo.USER_ID              = MB.WinBase.AppEnvironmentSetting.Instance.CurrentLoginUserInfo.USER_ID;
     newInfo.COMMENT_CONTENT      = System.Text.Encoding.UTF8.GetBytes(rxtInputComment.Rtf);
     newInfo.MODULE_IDENTITY      = _ViewGridForm.ClientRuleObject.ModuleTreeNodeInfo.PriID;
     newInfo.APPLICATION_IDENTITY = COMMENT_APPLICATION_IDENTITY;
     newInfo.CREATE_DATE          = System.DateTime.Now;
     return(newInfo);
 }
        //追加评语
        private void appendModuleComment(MB.Util.Model.BfModuleCommentInfo commentInfo)
        {
            rxtModuleComment.SelectionStart = 0;
            string rtf = System.Text.Encoding.UTF8.GetString(commentInfo.COMMENT_CONTENT);

            rxtModuleComment.SelectedRtf    = rtf;
            rxtModuleComment.SelectionStart = 0;
            rxtModuleComment.SelectionColor = Color.Blue;
            rxtModuleComment.SelectedText   = string.Format(MB.WinClientDefault.Properties.Resources.BfModuleComment_COMMENT_TITLE, commentInfo.USER_ID, commentInfo.COMMENT_TYPE, commentInfo.CREATE_DATE.ToString());
            rxtModuleComment.SelectionStart = 0;
            rxtModuleComment.SelectionColor = Color.Black;
            rxtModuleComment.SelectedText   = RTF_LINE;
        }
        private void butSubmitComment_Click(object sender, EventArgs e)
        {
            using (MB.WinBase.WaitCursor cursor = new MB.WinBase.WaitCursor(this.ParentForm)) {
                try {
                    checkInputData();

                    MB.Util.Model.BfModuleCommentInfo newInfo = createNewCommentInfo();
                    if (_CommentClient == null)
                    {
                        throw new MB.Util.APPException("需要配置 IBfModuleCommentClient 客户端");
                    }

                    _CommentClient.AddObject(newInfo);
                    appendModuleComment(newInfo);

                    rxtInputComment.Clear();
                    rxtInputComment.Focus();
                }
                catch (Exception ex) {
                    MB.WinBase.ApplicationExceptionTerminate.DefaultInstance.ExceptionTerminate(ex);
                }
            }
        }
 private int commentCreateDateCompare(MB.Util.Model.BfModuleCommentInfo x, MB.Util.Model.BfModuleCommentInfo y)
 {
     return(Comparer <DateTime> .Default.Compare(x.CREATE_DATE, y.CREATE_DATE));
 }