Exemplo n.º 1
0
        void renewButton_Click(object sender, EventArgs e)
        {
            List <string> barcodes = this.GetCheckedBorrowBarcodes();

            if (barcodes.Count == 0)
            {
                // text-level: 用户提示
                this.SetDebugInfo("errorinfo", this.GetString("尚未选择要续借的事项")); // "操作失败。尚未选择要续借的事项。"
                return;
            }

            OpacApplication app         = (OpacApplication)this.Page.Application["app"];
            SessionInfo     sessioninfo = (SessionInfo)this.Page.Session["sessioninfo"];

            LibraryChannel channel = sessioninfo.GetChannel(true);

            try
            {
                for (int i = 0; i < barcodes.Count; i++)
                {
                    string strItemBarcode = barcodes[i];
                    //string strItemRecord = "";
                    //string strReaderRecord = "";

                    string strReaderBarcode = "";
                    if (String.IsNullOrEmpty(this.ReaderBarcode) == false)
                    {
                        strReaderBarcode = this.ReaderBarcode;
                    }
                    else
                    {
                        strReaderBarcode = sessioninfo.ReaderInfo.Barcode;
                    }

                    if (String.IsNullOrEmpty(strReaderBarcode) == true)
                    {
                        // text-level: 用户提示
                        this.SetDebugInfo("errorinfo", this.GetString("尚未指定读者证条码号"));   // "尚未指定读者证条码号。操作失败。"
                        return;
                    }

                    string[]   aDupPath               = null;
                    string[]   item_records           = null;
                    string[]   reader_records         = null;
                    string[]   biblio_records         = null;
                    BorrowInfo borrow_info            = null;
                    string     strError               = "";
                    string     strOutputReaderBarcode = "";

                    long lRet = // sessioninfo.Channel.
                                channel.Borrow(
                        null,
                        true,
                        strReaderBarcode,
                        strItemBarcode,
                        null,
                        false,
                        null,
                        "", // style
                        "",
                        out item_records,
                        "",
                        out reader_records,
                        "",
                        out biblio_records,
                        out aDupPath,
                        out strOutputReaderBarcode,
                        out borrow_info,
                        out strError);
                    if (lRet == -1)
                    {
                        this.SetDebugInfo("errorinfo", strError);
                        return;
                    }

                    // 清除读者记录缓存,以便借阅信息得到刷新
                    sessioninfo.ClearLoginReaderDomCache();
                }
            }
            finally
            {
                sessioninfo.ReturnChannel(channel);
            }

            // text-level: 用户提示
            this.SetDebugInfo(this.GetString("续借成功"));   // "续借成功。"
        }
Exemplo n.º 2
0
        // 预约:删除请求
        void reservationDeleteButton_Click(object sender, EventArgs e)
        {
            string strBarcodeList = GetChekcedReservationBarcodes();

            if (String.IsNullOrEmpty(strBarcodeList) == true)
            {
                // text-level: 用户提示
                this.SetDebugInfo("errorinfo", this.GetString("尚未选择要删除的预约事项"));  // "尚未选择要删除的预约事项。"
                return;
            }

            OpacApplication app         = (OpacApplication)this.Page.Application["app"];
            SessionInfo     sessioninfo = (SessionInfo)this.Page.Session["sessioninfo"];

            string strReaderBarcode = "";

            if (String.IsNullOrEmpty(this.ReaderBarcode) == false)
            {
                strReaderBarcode = this.ReaderBarcode;
            }
            else
            {
                strReaderBarcode = sessioninfo.ReaderInfo.Barcode;
            }

            if (String.IsNullOrEmpty(strReaderBarcode) == true)
            {
                // text-level: 用户提示
                this.SetDebugInfo("errorinfo", this.GetString("尚未指定读者证条码号。操作失败"));  // "尚未指定读者证条码号。操作失败。"
                return;
            }

            LibraryChannel channel = sessioninfo.GetChannel(true);

            try
            {
                string strError = "";
                long   lRet     = // sessioninfo.Channel.
                                  channel.Reservation(
                    null,
                    "delete",
                    strReaderBarcode,
                    strBarcodeList,
                    out strError);
                if (lRet == -1)
                {
                    this.SetDebugInfo("errorinfo", strError);
                }
                else
                {
                    // text-level: 用户提示
                    string strMessage = this.GetString("删除预约信息成功。请看预约列表"); // "删除预约信息成功。请看预约列表。"

                    // 成功时也可能有提示信息
                    if (String.IsNullOrEmpty(strError) == false)
                    {
                        strMessage += "<br/><br/>" + strError;
                    }

                    this.SetDebugInfo(strMessage);
                }
            }
            finally
            {
                sessioninfo.ReturnChannel(channel);
            }

            // 清除读者记录缓存
            sessioninfo.ClearLoginReaderDomCache();
        }