当前位置: 首页>>代码示例>>C#>>正文


C# LibraryChannel.SetComments方法代码示例

本文整理汇总了C#中LibraryChannel.SetComments方法的典型用法代码示例。如果您正苦于以下问题:C# LibraryChannel.SetComments方法的具体用法?C# LibraryChannel.SetComments怎么用?C# LibraryChannel.SetComments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在LibraryChannel的用法示例。


在下文中一共展示了LibraryChannel.SetComments方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: DeleteCommentInfo

        // 删除一个评注记录
        public static int DeleteCommentInfo(
            Page page,
            LibraryChannel channel,
            string strBiblioRecPath,
            string strCommentRecPath,
            byte[] timestamp,
            out string strError)
        {
            strError = "";

            LoginState loginstate = GlobalUtil.GetLoginState(page);
            if (loginstate == LoginState.NotLogin)
            {
                strError = "尚未登录, 不能删除评注";
                return -1;
            }
            if (loginstate == LoginState.Public)
            {
                strError = "访客身份, 不能删除评注";
                return -1;
            }

            OpacApplication app = (OpacApplication)page.Application["app"];
            SessionInfo sessioninfo = (SessionInfo)page.Session["sessioninfo"];

            Debug.Assert(String.IsNullOrEmpty(sessioninfo.UserID) == false, "");

            EntityInfo info = new EntityInfo();
            info.RefID = Guid.NewGuid().ToString();

            // string strTargetBiblioRecID = ResPath.GetRecordId(strBiblioRecPath);


            info.Action = "delete";
            info.NewRecPath = "";
            info.OldRecPath = strCommentRecPath;
            info.NewRecord = "";
            info.NewTimestamp = null;

            info.OldRecord = "";
            info.OldTimestamp = timestamp;

            // 
            EntityInfo[] comments = new EntityInfo[1];
            comments[0] = info;

            EntityInfo[] errorinfos = null;

            long lRet = // sessioninfo.Channel.
                channel.SetComments(
                null,
                strBiblioRecPath,
                comments,
                out errorinfos,
                out strError);
            if (lRet == -1)
            {
                return -1;
            }

            if (errorinfos != null && errorinfos.Length > 0)
            {
                int nErrorCount = 0;
                for (int i = 0; i < errorinfos.Length; i++)
                {
                    EntityInfo error = errorinfos[i];
                    if (error.ErrorCode != ErrorCodeValue.NoError)
                    {
                        if (String.IsNullOrEmpty(strError) == false)
                            strError += "; ";
                        strError += errorinfos[0].ErrorInfo;
                        nErrorCount++;
                    }
                    else
                    {
                        //strNewCommentRecPath = error.NewRecPath;
                        //strNewXml = error.NewRecord;
                        //baNewTimestamp = error.NewTimestamp;
                    }
                }
                if (nErrorCount > 0)
                {
                    return -1;
                }
            }

            return 1;
        }
开发者ID:renyh1013,项目名称:dp2,代码行数:89,代码来源:CommentControl.cs


注:本文中的LibraryChannel.SetComments方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。