// 册XML记录转换为HTML显示格式 // 编写者:谢涛 // 最后修改日期: 2009/10/17 using System; using System.Xml; using DigitalPlatform.LibraryServer; using DigitalPlatform.Xml; public class MyConverter : ItemConverter { public override void Item(object sender, ItemConverterEventArgs e) { XmlDocument dom = new XmlDocument(); try { dom.LoadXml(e.Xml); } catch (Exception ex) { e.ResultString = ex.Message; return; } string strResult = ""; strResult += "
"; strResult += ""; strResult += ""; strResult += ""; strResult += ""; strResult += ""; strResult += "册条码"; strResult += " | "; strResult += "" + ""; strResult += strItemBarcode; strResult += ""; strResult += " | |
"; strResult += "书目摘要"; strResult += " | "; strResult += ""; strResult += "B:" + strItemBarcode; strResult += " | |
"; strResult += "借者姓名"; strResult += " | "; if (string.IsNullOrEmpty(strBorrower) == false) { strResult += ""; strResult += "P:" + strBorrower; } else { strResult += " | "; strResult += " "; } strResult += " |
"; XmlNode nodeHistory = dom.DocumentElement.SelectSingleNode("borrowHistory"); string strHistoryCount = ""; if (nodeHistory != null) strHistoryCount = DomUtil.GetAttr(nodeHistory, "count"); strResult += "本册共被 " + strHistoryCount + " 位读者借阅过 (下表中最多仅能显示最近100位)"; strResult += " | |||||||||
序 | 证条码号 | 姓名 | 续借次 | 借阅日期 | 期限 | 借阅操作者 | 续借注 | 还书日期 | 还书操作者 |
" + (i+1).ToString() + " | "; strResult += "" + strBarcodeLink + " | "; strResult += "P:" + strBarcode + " | "; strResult += "" + strNo + " | "; strResult += "" + LocalDate(strBorrowDate) + " | "; strResult += "" + LibraryApplication.GetDisplayTimePeriodString(strPeriod) + " | "; strResult += "" + strOperator + " | "; strResult += "" + strRenewComment.Replace(";", " ") + " | ";
strResult += "" + LocalDate(strReturnDate) + " | "; strResult += "" + strOperator + " | "; strResult += "