本文整理汇总了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;
}