/// <summary>
        /// 检索出书目数据
        /// </summary>
        /// <param name="strError"></param>
        /// <returns></returns>
        public long SearchBiblio(out string strError)
        {
            this.SearchPanel.BeginLoop("正在检索 " + this.textBox_queryWord.Text + " ...");
            try
            {
                // 2007/4/5 改造 加上了 GetXmlStringSimple()
                string strQueryXml = "<target list='"
                                     + StringUtil.GetXmlStringSimple(this.BiblioDbName + ":" + this.comboBox_from.Text) // 2007/9/14
                                     + "'><item><word>"
                                     + StringUtil.GetXmlStringSimple(GetQueryString())
                                     + "</word><match>left</match><relation>=</relation><dataType>string</dataType><maxCount>-1</maxCount></item><lang>" + this.Lang + "</lang></target>";


                ActivateBrowseWindow();

                long lRet = 0;

                this.SearchPanel.BrowseRecord += new BrowseRecordEventHandler(SearchPanel_BrowseRecord);

                try
                {
                    // 检索
                    lRet = this.SearchPanel.SearchAndBrowse(
                        this.ServerUrl,
                        strQueryXml,
                        true,
                        out strError);
                }
                finally
                {
                    this.SearchPanel.BrowseRecord -= new BrowseRecordEventHandler(SearchPanel_BrowseRecord);
                }


                if (lRet == 1 && this.browseWindow != null)
                {
                    this.browseWindow.LoadFirstDetail(true);
                }

                if (lRet == 0)
                {
                    strError = "没有命中。";
                }


                if (lRet == 0 || lRet == -1)
                {
                    this.browseWindow.Close();
                    this.browseWindow = null;
                }


                return(lRet);
            }
            finally
            {
                this.SearchPanel.EndLoop();
            }
        }
        void ActivateBrowseWindow()
        {
            if (this.browseWindow == null ||
                (this.browseWindow != null && this.browseWindow.IsDisposed == true))
            {
                this.browseWindow      = new BrowseSearchResultDlg();
                this.browseWindow.Text = "命中多条种记录。请从中选择一条";
                this.browseWindow.Show();

                this.browseWindow.OpenDetail -= new OpenDetailEventHandler(browseWindow_OpenDetail);
                this.browseWindow.OpenDetail += new OpenDetailEventHandler(browseWindow_OpenDetail);
            }
            else
            {
                this.browseWindow.BringToFront();
                this.browseWindow.RecordsList.Items.Clear();
            }
        }
Beispiel #3
0
        void ActivateBrowseWindow()
        {
            if (this.browseWindow == null
                || (this.browseWindow != null && this.browseWindow.IsDisposed == true))
            {
                this.browseWindow = new BrowseSearchResultDlg();
                this.browseWindow.Text = "命中多条种记录。请从中选择一条";
                this.browseWindow.Show();

                this.browseWindow.OpenDetail -= new OpenDetailEventHandler(browseWindow_OpenDetail);
                this.browseWindow.OpenDetail += new OpenDetailEventHandler(browseWindow_OpenDetail);
            }
            else
            {
                this.browseWindow.BringToFront();
                this.browseWindow.RecordsList.Items.Clear();
            }
        }
Beispiel #4
0
        /// <summary>
        /// 检索出书目数据
        /// </summary>
        /// <param name="strError"></param>
        /// <returns></returns>
        public long SearchBiblio(out string strError)
        {
            this.SearchPanel.BeginLoop("正在检索 " + this.textBox_queryWord.Text + " ...");
            try
            {
                // 2007/4/5 改造 加上了 GetXmlStringSimple()
                string strQueryXml = "<target list='"
                    + StringUtil.GetXmlStringSimple(this.BiblioDbName + ":" + this.comboBox_from.Text)        // 2007/9/14
                    + "'><item><word>"
                    + StringUtil.GetXmlStringSimple(GetQueryString())
                    + "</word><match>left</match><relation>=</relation><dataType>string</dataType><maxCount>-1</maxCount></item><lang>" + this.Lang + "</lang></target>";


                ActivateBrowseWindow();

                long lRet = 0;

                this.SearchPanel.BrowseRecord += new BrowseRecordEventHandler(SearchPanel_BrowseRecord);

                try
                {
                    // 检索
                    lRet = this.SearchPanel.SearchAndBrowse(
                        this.ServerUrl,
                        strQueryXml,
                        true,
                        out strError);
                }
                finally
                {
                    this.SearchPanel.BrowseRecord -= new BrowseRecordEventHandler(SearchPanel_BrowseRecord);
                }


                if (lRet == 1 && this.browseWindow != null)
                {
                    this.browseWindow.LoadFirstDetail(true);
                }

                if (lRet == 0)
                {
                    strError = "没有命中。";
                }


                if (lRet == 0 || lRet == -1)
                {
                    this.browseWindow.Close();
                    this.browseWindow = null;

                }


                return lRet;

            }
            finally
            {
                this.SearchPanel.EndLoop();
            }

        }