Beispiel #1
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);
        }