示例#1
0
        // 将册记录数据从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);
        }
示例#2
0
        // 将册记录数据从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);
        }
示例#3
0
        // 将册记录数据从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;
        }
示例#4
0
        // 将册记录数据从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;
        }
示例#5
0
    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 = "<html>";

        strResult += "<head>";
        strResult += "<link href='%mappeddir%\\styles\\itemhtml.css' type='text/css' rel='stylesheet' />";
        strResult += "<link href=\"%mappeddir%/jquery-ui-1.8.7/css/jquery-ui-1.8.7.css\" rel=\"stylesheet\" type=\"text/css\" />"
        + "<script type=\"text/javascript\" src=\"%mappeddir%/jquery-ui-1.8.7/js/jquery-1.4.4.min.js\"></script>"
        + "<script type=\"text/javascript\" src=\"%mappeddir%/jquery-ui-1.8.7/js/jquery-ui-1.8.7.min.js\"></script>"
        + "<script type='text/javascript' charset='UTF-8' src='%mappeddir%\\scripts\\getsummary.js" + "'></script>";

        strResult += "</head>";
        strResult += "<body>";

        strResult += "<table class='iteminfo'>";

        {

            // 册条码
            string strItemBarcode = DomUtil.GetElementText(dom.DocumentElement, "barcode");
            /*
            string strBarcodeLink = "<a href='" + App.OpacServerUrl + "/book.aspx?barcode=" + strItemBarcode + "&forcelogin=userid' target='_blank'>"
                + strItemBarcode
                + "</a>";
             * */
            string strBarcodeLink = "<a href='javascript:void(0);' onclick=\"window.external.OpenForm('ItemInfoForm', this.innerText, true);\">" + strItemBarcode + "</a>";
            strResult += GetOneTR("barcode", "册条码号", strBarcodeLink);

            // 馆藏地点
            strResult += GetOneTR(dom.DocumentElement, "location", "馆藏地点");

            // 书目摘要
            strResult += "<tr class='content summary'>";
            strResult += "<td class='name summary' nowrap>";
            strResult += "书目摘要";
            strResult += "</td>";
            strResult += "<td class='value summary pending'>";
            strResult += "B:" + strItemBarcode + "|" + e.RecPath;
            strResult += "</td></tr>";

            // 状态
            strResult += GetOneTR(dom.DocumentElement, "state", "状态");


            // 册价格
            strResult += GetOneTR(dom.DocumentElement, "price", "册价格");

            // 出版时间
            strResult += GetOneTR(dom.DocumentElement, "publishTime", "出版时间");

            // 渠道
            strResult += GetOneTR(dom.DocumentElement, "seller", "渠道");

            // 经费来源
            strResult += GetOneTR(dom.DocumentElement, "source", "经费来源");

            // 索取号
            strResult += GetOneTR(dom.DocumentElement, "accessNo", "索取号");

            // 卷
            strResult += GetOneTR(dom.DocumentElement, "volume", "卷");

            // 册类型
            strResult += GetOneTR(dom.DocumentElement, "bookType", "册类型");

            // 登录号
            strResult += GetOneTR(dom.DocumentElement, "registerNo", "登录号");

            // 注释
            strResult += GetOneTR(dom.DocumentElement, "comment", "注释");

            // 合并注释
            strResult += GetOneTR(dom.DocumentElement, "mergeComment", "合并注释");

            // 批次号
            strResult += GetOneTR(dom.DocumentElement, "batchNo", "批次号");

            string strBorrower = DomUtil.GetElementText(dom.DocumentElement, "borrower");	// 借者条码

            // 借者姓名
            strResult += "<tr class='content patronname'>";
            strResult += "<td class='name patronname' nowrap>";
            strResult += "借者姓名";
            strResult += "</td>";
            if (string.IsNullOrEmpty(strBorrower) == false)
            {
                strResult += "<td class='value patronname pending'>";
                strResult += "P:" + strBorrower;
            }
            else
            {
                strResult += "<td class='value patronname'>";
                strResult += "&nbsp;";
            }
            strResult += "</td></tr>";

            // 借者条码

            string strBorrowerLink = "";
            if (String.IsNullOrEmpty(strBorrower) == false)
            {
                /*
                strBorrowerLink = "<a href='" + App.OpacServerUrl + "/readerinfo.aspx?barcode=" + strBorrower + "&forcelogin=userid' target='_blank'>"
                    + strBorrower
                    + "</a>";
                 * */
                strBorrowerLink = "<a href='javascript:void(0);' onclick=\"window.external.OpenForm('ReaderInfoForm', this.innerText, true);\">" + strBorrower + "</a>";
            }
            else
                strBorrowerLink = "&nbsp";

            strResult += GetOneTR("borrower", "借者证条码号", strBorrowerLink);

            // 借阅日期
            string strBorrowDate = DomUtil.GetElementText(dom.DocumentElement, "borrowDate");
            strBorrowDate = LocalTime(strBorrowDate);
            strResult += GetOneTR("borrowDate", "借阅日期", strBorrowDate);

            // 借阅期限
            string strBorrowPeriod = DomUtil.GetElementText(dom.DocumentElement, "borrowPeriod");
            strBorrowPeriod = LibraryApplication.GetDisplayTimePeriodString(strBorrowPeriod);
            strResult += GetOneTR("borrowPeriod", "借阅期限", strBorrowPeriod);

            // 参考ID
            strResult += GetOneTR(dom.DocumentElement, "refID", "参考ID");

            // 册记录路径
            strResult += GetOneTR("recpath", "册记录路径", e.RecPath);
            
            // 册二维码
            /*
            string strCode = "39code:" + strItemBarcode;
            if (string.IsNullOrEmpty(strItemBarcode))
                strCode = "qrcode:@refID:" + DomUtil.GetElementText(dom.DocumentElement, "refID");
                */
            string strCode = "code="+HttpUtility.UrlEncode(strItemBarcode)+",type=code_39,width=300,height=80";
            if (string.IsNullOrEmpty(strItemBarcode))
                strCode = "code=@refID:" + HttpUtility.UrlEncode(DomUtil.GetElementText(dom.DocumentElement, "refID"))+",type=qr_code,width=200,height=200";
                
            strResult += "<tr class='content qrcode'>";
            strResult += "<td class='value qrcode' colspan='2' >";
            // strResult += "<img id='qrcode' class='pending' name='"+strCode+"' src='%mappeddir%\\images\\ajax-loader.gif' alt='册记录的二维码' ></img>";
            strResult += "<img id='qrcode' src='barcode:"+strCode+"' alt='册记录的二维码' ></img>";
            strResult += "</td></tr>";

            strResult += "</table>";
        }

        // 借阅历史
        XmlNodeList nodes = dom.DocumentElement.SelectNodes("borrowHistory/borrower");

        if (nodes.Count > 0)
        {
            strResult += "<br/><b>历史</b><br/>";
            strResult += "<table class='borrowhistory'>\r\n";

            strResult += "<tr class='borrowcount'><td colspan='10' class='borrowcount'>";

            XmlNode nodeHistory = dom.DocumentElement.SelectSingleNode("borrowHistory");
            string strHistoryCount = "";
            if (nodeHistory != null)
                strHistoryCount = DomUtil.GetAttr(nodeHistory, "count");
            strResult += "本册共被 " + strHistoryCount + " 位读者借阅过 (下表中最多仅能显示最近 " + this.App.MaxItemHistoryItems.ToString() + " 位)";

            strResult += "</td></tr>\r\n";

            strResult += "<tr class='columntitle'><td class='index' nowrap>序</td><td class='barcode' nowrap>证条码号</td><td class='summary' nowrap>姓名</td><td class='no' nowrap>续借次</td><td class='borrowdate' nowrap>借阅日期</td><td class='period' nowrap>期限</td><td class='borrowoperator' nowrap>借阅操作者</td><td class='renewcomment' nowrap>续借注</td><td class='returndate' nowrap>还书日期</td><td class='operator' nowrap>还书操作者</td></tr>\r\n";

            for (int i = 0; i < nodes.Count; i++)
            {
                XmlNode node = nodes[i];
                string strBarcode = DomUtil.GetAttr(node, "barcode");
                string strNo = DomUtil.GetAttr(node, "no");
                string strBorrowDate = DomUtil.GetAttr(node, "borrowDate");
                string strPeriod = DomUtil.GetAttr(node, "borrowPeriod");
                string strBorrowOperator = DomUtil.GetAttr(node, "borrowOperator");	// 借书操作者
                string strOperator = DomUtil.GetAttr(node, "operator");	// 还书操作者
                string strRenewComment = DomUtil.GetAttr(node, "renewComment");
                // string strSummary = "";
                // string strConfirmItemRecPath = DomUtil.GetAttr(node, "recPath");
                string strReturnDate = DomUtil.GetAttr(node, "returnDate");

                // string strBarcodeLink = "<a href='" + App.OpacServerUrl + "/readerinfo.aspx?barcode=" + strBarcode + "&forcelogin=userid' target='_blank'>" + strBarcode + "</a>";
                string strBarcodeLink = "<a href='javascript:void(0);' onclick=\"window.external.OpenForm('ReaderInfoForm', this.innerText, true);\">" + strBarcode + "</a>";

                // 表格内容奇数行的类名
                string strOdd = "";
                if (((i + 1) % 2) != 0)
                    strOdd = " odd";

                strResult += "<tr class='content" + strOdd + "'>";
                strResult += "<td class='index' nowrap>" + (i + 1).ToString() + "</td>";
                strResult += "<td class='barcode' nowrap>" + strBarcodeLink + "</td>";
                strResult += "<td class='summary pending' nowrap>P:" + strBarcode + "</td>";

                strResult += "<td class='no' nowrap align='right'>" + strNo + "</td>";
                strResult += "<td class='borrowdate' nowrap>" + LocalDate(strBorrowDate) + "</td>";
                strResult += "<td class='period' nowrap>" + LibraryApplication.GetDisplayTimePeriodString(strPeriod) + "</td>";
                strResult += "<td class='borrowoperator' nowrap>" + strBorrowOperator + "</td>";
                strResult += "<td class='renewcomment' width='30%'>" + strRenewComment.Replace(";", "<br/>") + "</td>";
                strResult += "<td class='returndate' nowrap>" + LocalDate(strReturnDate) + "</td>";
                strResult += "<td class='operator' nowrap>" + strOperator + "</td>";
                strResult += "</tr>\r\n";
            }
            strResult += "</table>\r\n";
        }

        strResult += "</body></html>";

        e.ResultString = strResult;
    }
示例#6
0
        void SessionInfo_ItemLoad(object sender, ItemLoadEventArgs e)
        {
            int    nRet     = 0;
            string strError = "";

            // string strResult = "";

            // 连带第一次
            if (e.Index == 0)
            {
                this.ItemConverterEventArgs               = new ItemConverterEventArgs();
                this.ItemConverterEventArgs.Count         = e.Count;
                this.ItemConverterEventArgs.Index         = -1;
                this.ItemConverterEventArgs.ActiveBarcode = "";

                nRet = LibraryApplication.RunItemConverter(
                    "begin",
                    this.ItemConverter,
                    this,
                    this.ItemConverterEventArgs,
                    out strError);
                if (nRet == -1)
                {
                    goto ERROR1;
                }
                //tempOutput.Write(this.ItemConverterEventArgs.ResultString);
                tempOutput += this.ItemConverterEventArgs.ResultString;
                this.ItemConverterEventArgs.ResultString = "";
            }

            this.ItemConverterEventArgs.Index         = e.Index;
            this.ItemConverterEventArgs.ActiveBarcode = Barcode;
            this.ItemConverterEventArgs.Count         = e.Count;
            this.ItemConverterEventArgs.Xml           = e.Xml;
            nRet = LibraryApplication.RunItemConverter(
                "item",
                ItemConverter,
                this,
                this.ItemConverterEventArgs,
                out strError);
            if (nRet == -1)
            {
                goto ERROR1;
            }

            // tempOutput.Write(this.ItemConverterEventArgs.ResultString);
            tempOutput += this.ItemConverterEventArgs.ResultString;
            this.ItemConverterEventArgs.ResultString = "";

            // 连带最后一次
            if (e.Index == e.Count - 1)
            {
                this.ItemConverterEventArgs.Count         = e.Count;
                this.ItemConverterEventArgs.Index         = e.Count;
                this.ItemConverterEventArgs.ActiveBarcode = "";

                nRet = LibraryApplication.RunItemConverter(
                    "end",
                    this.ItemConverter,
                    this,
                    this.ItemConverterEventArgs,
                    out strError);
                if (nRet == -1)
                {
                    goto ERROR1;
                }
                // tempOutput.Write(this.ItemConverterEventArgs.ResultString);
                tempOutput += this.ItemConverterEventArgs.ResultString;
                this.ItemConverterEventArgs.ResultString = "";
            }

            return;

ERROR1:
            tempOutput += strError;
            // tempOutput.Write(strError);
        }
示例#7
0
        public virtual void End(object sender,
            ItemConverterEventArgs e)
        {

        }
示例#8
0
    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 = "<html>";

        strResult += "<head>";
        strResult += "<link href='%mappeddir%\\styles\\orderhtml.css' type='text/css' rel='stylesheet' />";
        strResult += "<link href=\"%mappeddir%/jquery-ui-1.8.7/css/jquery-ui-1.8.7.css\" rel=\"stylesheet\" type=\"text/css\" />"
        + "<script type=\"text/javascript\" src=\"%mappeddir%/jquery-ui-1.8.7/js/jquery-1.4.4.min.js\"></script>"
        + "<script type=\"text/javascript\" src=\"%mappeddir%/jquery-ui-1.8.7/js/jquery-ui-1.8.7.min.js\"></script>"
        + "<script type='text/javascript' charset='UTF-8' src='%mappeddir%\\scripts\\getsummary.js" + "'></script>";
        strResult += "</head>";
        strResult += "<body>";

        strResult += "<table class='orderinfo'>";

        {

            // 编号
            string strIndex = DomUtil.GetElementText(dom.DocumentElement, "index");
            strResult += GetOneTR("index", "编号", strIndex);

            // 书目摘要
            strResult += "<tr class='content summary'>";
            strResult += "<td class='name summary' nowrap>";
            strResult += "书目摘要";
            strResult += "</td>";
            strResult += "<td class='value summary pending'>";
            strResult += "B:|" + e.RecPath;
            strResult += "</td></tr>";

            // 状态
            strResult += GetOneTR(dom.DocumentElement, "state", "状态");

            // 书目号
            strResult += GetOneTR(dom.DocumentElement, "catalogNo", "书目号");

            // 渠道
            strResult += GetOneTR(dom.DocumentElement, "seller", "渠道");

            // 经费来源
            strResult += GetOneTR(dom.DocumentElement, "source", "经费来源");

            // 时间范围
            strResult += GetOneTR(dom.DocumentElement, "range", "时间范围");

            // 包含期数
            strResult += GetOneTR(dom.DocumentElement, "issueCount", "包含期数");

            // 复本数
            strResult += GetOneTR(dom.DocumentElement, "copy", "复本数");

            // 单价
            strResult += GetOneTR(dom.DocumentElement, "price", "单价");

            // 总价格
            strResult += GetOneTR(dom.DocumentElement, "totalPrice", "总价");

            // 订购时间
            string strOrderTime = DomUtil.GetElementText(dom.DocumentElement, "orderTime");
            strResult += GetOneTR("orderTime", "订购时间", LocalTime(strOrderTime));

            // 订单号
            strResult += GetOneTR(dom.DocumentElement, "orderID", "订单号");

            // 馆藏分配
            strResult += GetOneTR(dom.DocumentElement, "distribute", "馆藏分配");

            // 类别
            strResult += GetOneTR(dom.DocumentElement, "class", "类别");

            // 附注
            strResult += GetOneTR(dom.DocumentElement, "comment", "附注");


            // 批次号
            strResult += GetOneTR(dom.DocumentElement, "batchNo", "批次号");

            // 渠道地址
            strResult += GetOneTR(dom.DocumentElement, "sellerAddress", "渠道地址");

            // 参考ID
            strResult += GetOneTR(dom.DocumentElement, "refID", "参考ID");

            // 订购记录路径
            strResult += GetOneTR("recpath", "订购记录路径", e.RecPath);

            strResult += "</table>";
        }

        // 操作历史
        XmlNodeList nodes = dom.DocumentElement.SelectNodes("operations/operation");

        if (nodes.Count > 0)
        {
            strResult += "<br/><b>操作历史</b><br/>";
            strResult += "<table class='operationhistory'>\r\n";

            strResult += "<tr class='columntitle'><td class='index' nowrap>序</td><td class='name' nowrap>操作名</td><td class='time' nowrap>操作时间</td><td class='operator' nowrap>操作者</td></tr>\r\n";

            for (int i = 0; i < nodes.Count; i++)
            {
                XmlNode node = nodes[i];
                string strName = DomUtil.GetAttr(node, "name");
                string strTime = DomUtil.GetAttr(node, "time");
                string strOperator = DomUtil.GetAttr(node, "operator");	// 还书操作者

                // 表格内容奇数行的类名
                string strOdd = "";
                if (((i + 1) % 2) != 0)
                    strOdd = " odd";

                strResult += "<tr class='content" + strOdd + "'>";
                strResult += "<td class='index' nowrap>" + (i + 1).ToString() + "</td>";
                strResult += "<td class='name' nowrap>" + strName + "</td>";
                strResult += "<td class='time' nowrap>" + LocalTime(strTime) + "</td>";
                strResult += "<td class='operator' nowrap>" + strOperator + "</td>";
                strResult += "</tr>\r\n";
            }
            strResult += "</table>\r\n";
        }

        strResult += "</body></html>";

        e.ResultString = strResult;
    }
示例#9
0
 public virtual void End(object sender,
                         ItemConverterEventArgs e)
 {
 }
示例#10
0
    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 = "<html>";

        strResult += "<head>";
        strResult += "<link href='%mappeddir%\\styles\\issuehtml.css' type='text/css' rel='stylesheet' />";
        strResult += "<link href=\"%mappeddir%/jquery-ui-1.8.7/css/jquery-ui-1.8.7.css\" rel=\"stylesheet\" type=\"text/css\" />"
        + "<script type=\"text/javascript\" src=\"%mappeddir%/jquery-ui-1.8.7/js/jquery-1.4.4.min.js\"></script>"
        + "<script type=\"text/javascript\" src=\"%mappeddir%/jquery-ui-1.8.7/js/jquery-ui-1.8.7.min.js\"></script>"
        + "<script type='text/javascript' charset='UTF-8' src='%mappeddir%\\scripts\\getsummary.js" + "'></script>";
        strResult += "</head>";
        strResult += "<body>";

        strResult += "<table class='issueinfo'>";

        {

            // 出版时间
            strResult += GetOneTR(dom.DocumentElement, "publishTime", "出版时间");

            // 书目摘要
            strResult += "<tr class='content summary'>";
            strResult += "<td class='name summary' nowrap>";
            strResult += "书目摘要";
            strResult += "</td>";
            strResult += "<td class='value summary pending'>";
            strResult += "B:|" + e.RecPath;
            strResult += "</td></tr>";

            // 状态
            strResult += GetOneTR(dom.DocumentElement, "state", "状态");

            // 期号
            strResult += GetOneTR(dom.DocumentElement, "issue", "期号");

            // 总期号
            strResult += GetOneTR(dom.DocumentElement, "zong", "总期号");

            // 卷号
            strResult += GetOneTR(dom.DocumentElement, "volumn", "卷号");

            // 附注
            strResult += GetOneTR(dom.DocumentElement, "comment", "附注");

            // 批次号
            strResult += GetOneTR(dom.DocumentElement, "batchNo", "批次号");

            // 参考ID
            strResult += GetOneTR(dom.DocumentElement, "refID", "参考ID");

            // 期记录路径
            strResult += GetOneTR("recpath", "期记录路径", e.RecPath);

            strResult += "</table>";
        }

        // 操作历史
        XmlNodeList nodes = dom.DocumentElement.SelectNodes("operations/operation");

        if (nodes.Count > 0)
        {
            strResult += "<br/><b>操作历史</b><br/>";
            strResult += "<table class='operationhistory'>\r\n";

            strResult += "<tr class='columntitle'><td class='index' nowrap>序</td><td class='name' nowrap>操作名</td><td class='time' nowrap>操作时间</td><td class='operator' nowrap>操作者</td></tr>\r\n";

            for (int i = 0; i < nodes.Count; i++)
            {
                XmlNode node = nodes[i];
                string strName = DomUtil.GetAttr(node, "name");
                string strTime = DomUtil.GetAttr(node, "time");
                string strOperator = DomUtil.GetAttr(node, "operator");	// 还书操作者

                // 表格内容奇数行的类名
                string strOdd = "";
                if (((i + 1) % 2) != 0)
                    strOdd = " odd";

                strResult += "<tr class='content" + strOdd + "'>";
                strResult += "<td class='index' nowrap>" + (i + 1).ToString() + "</td>";
                strResult += "<td class='name' nowrap>" + strName + "</td>";
                strResult += "<td class='time' nowrap>" + LocalTime(strTime) + "</td>";
                strResult += "<td class='operator' nowrap>" + strOperator + "</td>";
                strResult += "</tr>\r\n";
            }
            strResult += "</table>\r\n";
        }
        
        {
            strResult += "<div class='cover_container'>";
                    
            XmlNamespaceManager nsmgr = new XmlNamespaceManager(new NameTable());
            nsmgr.AddNamespace("dprms", DpNs.dprms);

            XmlNodeList files = dom.DocumentElement.SelectNodes("//dprms:file", nsmgr);
            foreach (XmlElement file in files)
            {
                string id = file.GetAttribute("id");
                string usage = file.GetAttribute("usage");
                if (usage.StartsWith("FrontCover") == false)
                    continue;
                    
                string path = e.RecPath + "/object/" + id;
                strResult += "<img class='cover' src='dpres:"+path+"' alt='"+HttpUtility.HtmlEncode(usage)+"'></img>";    
            }
            
            strResult += "</div>";
        }


        strResult += "</body></html>";

        e.ResultString = strResult;
    }
示例#11
0
        void SessionInfo_ItemLoad(object sender, ItemLoadEventArgs e)
        {
            int nRet = 0;
            string strError = "";
            // string strResult = "";

            // 连带第一次
            if (e.Index == 0)
            {
                this.ItemConverterEventArgs = new ItemConverterEventArgs();
                this.ItemConverterEventArgs.Count = e.Count;
                this.ItemConverterEventArgs.Index = -1;
                this.ItemConverterEventArgs.ActiveBarcode = "";

                nRet = LibraryApplication.RunItemConverter(
                    "begin",
                    this.ItemConverter,
                    this,
                    this.ItemConverterEventArgs,
                    out strError);
                if (nRet == -1)
                    goto ERROR1;
                //tempOutput.Write(this.ItemConverterEventArgs.ResultString);
                tempOutput += this.ItemConverterEventArgs.ResultString;
                this.ItemConverterEventArgs.ResultString = "";

            }

            this.ItemConverterEventArgs.Index = e.Index;
            this.ItemConverterEventArgs.ActiveBarcode = Barcode;
            this.ItemConverterEventArgs.Count = e.Count;
            this.ItemConverterEventArgs.Xml = e.Xml;
            nRet = LibraryApplication.RunItemConverter(
                "item",
                ItemConverter,
                this,
                this.ItemConverterEventArgs,
                out strError);
            if (nRet == -1)
                goto ERROR1;

            // tempOutput.Write(this.ItemConverterEventArgs.ResultString);
            tempOutput += this.ItemConverterEventArgs.ResultString;
            this.ItemConverterEventArgs.ResultString = "";

            // 连带最后一次
            if (e.Index == e.Count - 1)
            {
                this.ItemConverterEventArgs.Count = e.Count;
                this.ItemConverterEventArgs.Index = e.Count;
                this.ItemConverterEventArgs.ActiveBarcode = "";

                nRet = LibraryApplication.RunItemConverter(
                    "end",
                    this.ItemConverter,
                    this,
                    this.ItemConverterEventArgs,
                    out strError);
                if (nRet == -1)
                    goto ERROR1;
                // tempOutput.Write(this.ItemConverterEventArgs.ResultString);
                tempOutput += this.ItemConverterEventArgs.ResultString;
                this.ItemConverterEventArgs.ResultString = "";
            }

            return;
        ERROR1:
            tempOutput += strError;
            // tempOutput.Write(strError);
        }
示例#12
0
    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 = "<html>";

        strResult += "<head>";
        strResult += "<link href='%mappeddir%\\styles\\issuehtml.css' type='text/css' rel='stylesheet' />";
        strResult += "<link href=\"%mappeddir%/jquery-ui-1.8.7/css/jquery-ui-1.8.7.css\" rel=\"stylesheet\" type=\"text/css\" />"
        + "<script type=\"text/javascript\" src=\"%mappeddir%/jquery-ui-1.8.7/js/jquery-1.4.4.min.js\"></script>"
        + "<script type=\"text/javascript\" src=\"%mappeddir%/jquery-ui-1.8.7/js/jquery-ui-1.8.7.min.js\"></script>"
        + "<script type='text/javascript' charset='UTF-8' src='%mappeddir%\\scripts\\getsummary.js" + "'></script>";
        strResult += "</head>";
        strResult += "<body>";

        strResult += "<table class='issueinfo'>";

        {

            // 出版时间
            strResult += GetOneTR(dom.DocumentElement, "publishTime", "出版时间");

            // 书目摘要
            strResult += "<tr class='content summary'>";
            strResult += "<td class='name summary' nowrap>";
            strResult += "书目摘要";
            strResult += "</td>";
            strResult += "<td class='value summary pending'>";
            strResult += "B:|" + e.RecPath;
            strResult += "</td></tr>";

            // 状态
            strResult += GetOneTR(dom.DocumentElement, "state", "状态");

            // 期号
            strResult += GetOneTR(dom.DocumentElement, "issue", "期号");

            // 总期号
            strResult += GetOneTR(dom.DocumentElement, "zong", "总期号");

            // 卷号
            strResult += GetOneTR(dom.DocumentElement, "volumn", "卷号");

            // 附注
            strResult += GetOneTR(dom.DocumentElement, "comment", "附注");

            // 批次号
            strResult += GetOneTR(dom.DocumentElement, "batchNo", "批次号");

            // 参考ID
            strResult += GetOneTR(dom.DocumentElement, "refID", "参考ID");

            // 期记录路径
            strResult += GetOneTR("recpath", "期记录路径", e.RecPath);

            strResult += "</table>";
        }

        // 操作历史
        XmlNodeList nodes = dom.DocumentElement.SelectNodes("operations/operation");

        if (nodes.Count > 0)
        {
            strResult += "<br/><b>操作历史</b><br/>";
            strResult += "<table class='operationhistory'>\r\n";

            strResult += "<tr class='columntitle'><td class='index' nowrap>序</td><td class='name' nowrap>操作名</td><td class='time' nowrap>操作时间</td><td class='operator' nowrap>操作者</td></tr>\r\n";

            for (int i = 0; i < nodes.Count; i++)
            {
                XmlNode node = nodes[i];
                string strName = DomUtil.GetAttr(node, "name");
                string strTime = DomUtil.GetAttr(node, "time");
                string strOperator = DomUtil.GetAttr(node, "operator");	// 还书操作者

                // 表格内容奇数行的类名
                string strOdd = "";
                if (((i + 1) % 2) != 0)
                    strOdd = " odd";

                strResult += "<tr class='content" + strOdd + "'>";
                strResult += "<td class='index' nowrap>" + (i + 1).ToString() + "</td>";
                strResult += "<td class='name' nowrap>" + strName + "</td>";
                strResult += "<td class='time' nowrap>" + LocalTime(strTime) + "</td>";
                strResult += "<td class='operator' nowrap>" + strOperator + "</td>";
                strResult += "</tr>\r\n";
            }
            strResult += "</table>\r\n";
        }

        strResult += "</body></html>";

        e.ResultString = strResult;
    }