本文整理汇总了C#中DigitalPlatform.rms.Client.RmsChannel.DoDeleteDB方法的典型用法代码示例。如果您正苦于以下问题:C# RmsChannel.DoDeleteDB方法的具体用法?C# RmsChannel.DoDeleteDB怎么用?C# RmsChannel.DoDeleteDB使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DigitalPlatform.rms.Client.RmsChannel
的用法示例。
在下文中一共展示了RmsChannel.DoDeleteDB方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteAllDatabase
// 删除所有用到的内核数据库
// 专门开发给安装程序卸载时候使用
public static int DeleteAllDatabase(
RmsChannel channel,
XmlDocument cfg_dom,
out string strError)
{
strError = "";
string strTempError = "";
long lRet = 0;
// 大书目库
XmlNodeList nodes = cfg_dom.DocumentElement.SelectNodes("itemdbgroup/database");
for (int i = 0; i < nodes.Count; i++)
{
XmlNode node = nodes[i];
// 实体库
string strEntityDbName = DomUtil.GetAttr(node, "name");
if (String.IsNullOrEmpty(strEntityDbName) == false)
{
lRet = channel.DoDeleteDB(strEntityDbName,
out strTempError);
if (lRet == -1 && channel.ErrorCode != ChannelErrorCode.NotFound)
{
strError += "删除实体库 '" + strEntityDbName + "' 内数据时候发生错误:" + strTempError + "; ";
}
}
// 订购库
string strOrderDbName = DomUtil.GetAttr(node, "orderDbName");
if (String.IsNullOrEmpty(strOrderDbName) == false)
{
lRet = channel.DoDeleteDB(strOrderDbName,
out strTempError);
if (lRet == -1 && channel.ErrorCode != ChannelErrorCode.NotFound)
{
strError += "删除订购库 '" + strOrderDbName + "' 内数据时候发生错误:" + strTempError + "; ";
}
}
// 期库
string strIssueDbName = DomUtil.GetAttr(node, "issueDbName");
if (String.IsNullOrEmpty(strIssueDbName) == false)
{
lRet = channel.DoDeleteDB(strIssueDbName,
out strTempError);
if (lRet == -1 && channel.ErrorCode != ChannelErrorCode.NotFound)
{
strError += "删除期库 '" + strIssueDbName + "' 内数据时候发生错误:" + strTempError + "; ";
}
}
// 小书目库
string strBiblioDbName = DomUtil.GetAttr(node, "biblioDbName");
if (String.IsNullOrEmpty(strBiblioDbName) == false)
{
lRet = channel.DoDeleteDB(strBiblioDbName,
out strTempError);
if (lRet == -1 && channel.ErrorCode != ChannelErrorCode.NotFound)
{
strError += "删除小书目库 '" + strBiblioDbName + "' 内数据时候发生错误:" + strTempError + "; ";
}
}
}
// 读者库
nodes = cfg_dom.DocumentElement.SelectNodes("readerdbgroup/database");
for (int i = 0; i < nodes.Count; i++)
{
XmlNode node = nodes[i];
string strDbName = DomUtil.GetAttr(node, "name");
if (String.IsNullOrEmpty(strDbName) == false)
{
lRet = channel.DoDeleteDB(strDbName,
out strTempError);
if (lRet == -1 && channel.ErrorCode != ChannelErrorCode.NotFound)
{
strError += "删除读者库 '" + strDbName + "' 内数据时候发生错误:" + strTempError + "; ";
}
}
}
// 预约到书队列库
XmlNode arrived_node = cfg_dom.DocumentElement.SelectSingleNode("arrived");
if (arrived_node != null)
{
string strArrivedDbName = DomUtil.GetAttr(arrived_node, "dbname");
if (String.IsNullOrEmpty(strArrivedDbName) == false)
{
//.........这里部分代码省略.........
示例2: DeleteDatabase
// 删除一个数据库,并删除library.xml中相关OPAC检索库定义
// 如果数据库不存在会当作出错-1来报错
int DeleteDatabase(RmsChannel channel,
string strDbName,
out string strError)
{
strError = "";
long lRet = channel.DoDeleteDB(strDbName, out strError);
if (lRet == -1 && channel.ErrorCode != ChannelErrorCode.NotFound)
return -1;
// 删除一个数据库在OPAC可检索库中的定义
// return:
// -1 error
// 0 not change
// 1 changed
int nRet = RemoveOpacDatabaseDef(
channel.Container,
strDbName,
out strError);
if (nRet == -1)
{
this.Changed = true;
return -1;
}
return 0;
}