本文整理汇总了C#中LocationCollection.RefreshRefIDs方法的典型用法代码示例。如果您正苦于以下问题:C# LocationCollection.RefreshRefIDs方法的具体用法?C# LocationCollection.RefreshRefIDs怎么用?C# LocationCollection.RefreshRefIDs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LocationCollection
的用法示例。
在下文中一共展示了LocationCollection.RefreshRefIDs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DoItems
void DoItems(List<string> item_xmls, ProcessInfo info)
{
string strError = "";
List<EntityInfo> entityArray = new List<EntityInfo>();
string strRootElementName = "";
foreach (string xml in item_xmls)
{
if (string.IsNullOrEmpty(xml))
continue;
XmlDocument item_dom = new XmlDocument();
item_dom.LoadXml(xml);
strRootElementName = item_dom.DocumentElement.LocalName;
string strPath = item_dom.DocumentElement.GetAttribute("path");
string strTimestamp = item_dom.DocumentElement.GetAttribute("timestamp");
EntityInfo item = new EntityInfo();
string strRefID = DomUtil.GetElementText(item_dom.DocumentElement, "refID");
if (strRootElementName == "item")
{
RefreshRefID(info.ItemRefIDTable, ref strRefID);
}
else if (strRootElementName == "order")
{
RefreshRefID(info.OrderRefIDTable, ref strRefID);
// 记录中 distribute 元素中的 refid 要被替换
string strDistribute = DomUtil.GetElementText(item_dom.DocumentElement, "distribute");
if (string.IsNullOrEmpty(strDistribute) == false)
{
LocationCollection collection = new LocationCollection();
int nRet = collection.Build(strDistribute, out strError);
if (nRet != -1)
{
collection.RefreshRefIDs(ref info.ItemRefIDTable);
}
string strNewDistribute = collection.ToString();
if (strNewDistribute != strDistribute)
{
DomUtil.SetElementText(item_dom.DocumentElement, "distribute", strNewDistribute);
}
}
}
else
{
RefreshRefID(null, ref strRefID);
}
item.RefID = strRefID;
DomUtil.SetElementText(item_dom.DocumentElement, "refID", strRefID);
DomUtil.SetElementText(item_dom.DocumentElement,
"parent", Global.GetRecordID(info.BiblioRecPath));
string strXml = item_dom.DocumentElement.OuterXml;
item.Action = "new";
item.NewRecord = strXml;
item.NewTimestamp = ByteArray.GetTimeStampByteArray(strTimestamp);
item.OldRecord = "";
item.OldTimestamp = null;
entityArray.Add(item);
}
info.stop.SetMessage("正在为书目记录 '" + info.BiblioRecPath + "' 上传 "+info.UploadedSubItems+"+" + entityArray.Count + " 个下属 " + strRootElementName + " 记录 ...");
info.UploadedSubItems += entityArray.Count;
EntityInfo[] errorinfos = null;
long lRet = 0;
if (strRootElementName == "item")
lRet = info.Channel.SetEntities(
info.stop,
info.BiblioRecPath,
entityArray.ToArray(),
out errorinfos,
out strError);
else if (strRootElementName == "order")
lRet = info.Channel.SetOrders(
info.stop,
info.BiblioRecPath,
entityArray.ToArray(),
out errorinfos,
out strError);
else if (strRootElementName == "issue")
lRet = info.Channel.SetIssues(
info.stop,
info.BiblioRecPath,
entityArray.ToArray(),
out errorinfos,
//.........这里部分代码省略.........