// 将册记录数据从XML格式转换为HTML格式 // 兼容旧函数,一次性调用(只触发Item()函数),无批概念 // parameters: // strRecPath 册记录路径。用途是为了给宿主对象的RecPath成员赋值 // 2009/10/18 public int ConvertItemXmlToHtml( string strCsFileName, string strRefFileName, string strXml, string strRecPath, out string strResult, out string strError) { strResult = ""; strError = ""; ItemConverter obj = this.NewItemConverter( strCsFileName, strRefFileName, out strError); if (obj == null) { return(-1); } obj.App = this; // 调用关键函数Item try { ItemConverterEventArgs e = new ItemConverterEventArgs(); e.Index = 0; e.Count = 1; e.ActiveBarcode = ""; e.Xml = strXml; e.RecPath = strRecPath; // 2009/10/18 obj.Item(this, e); strResult = e.ResultString; } catch (Exception ex) { strError = "脚本执行时抛出异常: " + ExceptionUtil.GetDebugText(ex); goto ERROR1; } return(0); ERROR1: return(-1); }
// 将册记录数据从XML格式转换为HTML格式 public static int RunItemConverter( string strFunction, ItemConverter obj, object sender, ItemConverterEventArgs e, out string strError) { strError = ""; // 调用关键函数Item try { if (strFunction == "item") { obj.Item(sender, e); } else if (strFunction == "begin") { obj.Begin(sender, e); } else if (strFunction == "end") { obj.End(sender, e); } } catch (Exception ex) { strError = "脚本执行时抛出异常: " + ExceptionUtil.GetDebugText(ex); goto ERROR1; } return(0); ERROR1: return(-1); }
// 将册记录数据从XML格式转换为HTML格式 public static int RunItemConverter( string strFunction, ItemConverter obj, object sender, ItemConverterEventArgs e, out string strError) { strError = ""; // 调用关键函数Item try { if (strFunction == "item") obj.Item(sender, e); else if (strFunction == "begin") obj.Begin(sender, e); else if (strFunction == "end") obj.End(sender, e); } catch (Exception ex) { strError = "脚本执行时抛出异常: " + ExceptionUtil.GetDebugText(ex); goto ERROR1; } return 0; ERROR1: return -1; }