Пример #1
0
        void LoadDetail(int index)
        {
            // 取出记录路径,析出书目库名,然后看这个书目库的syntax
            // 可能装入MARC和DC两种不同的窗口
            string strError = "";

            // 防止重入
            if (m_bInSearch == true)
            {
                strError = "当前窗口正在被一个未结束的长操作使用,无法装载记录。请稍后再试。";
                goto ERROR1;
            }

            string strSyntax = "";
            int    nRet      = GetOneRecordSyntax(index,
                                                  out strSyntax,
                                                  out strError);

            if (nRet == -1)
            {
                goto ERROR1;
            }

            if (strSyntax == "" || // default = unimarc
                strSyntax.ToLower() == "unimarc" ||
                strSyntax.ToLower() == "usmarc")
            {
                MarcDetailForm form = new MarcDetailForm();

                form.MdiParent = this.MainForm;
                form.MainForm  = this.MainForm;

                // MARC Syntax OID
                // 需要建立数据库配置参数,从中得到MARC格式
                //// form.AutoDetectedMarcSyntaxOID = "1.2.840.10003.5.1";   // UNIMARC

                form.Show();

                form.LoadRecord(this, index);
            }
            else if (strSyntax.ToLower() == "dc")
            {
                DcForm form = new DcForm();

                form.MdiParent = this.MainForm;
                form.MainForm  = this.MainForm;

                form.Show();

                form.LoadRecord(this, index);
            }
            else
            {
                strError = "未知的syntax '" + strSyntax + "'";
                goto ERROR1;
            }

            return;

ERROR1:
            MessageBox.Show(this, strError);
        }
Пример #2
0
        // parameters:
        //      strStyle    打开的风格 new/exist/fixed
        //      bOpendNew   是否打开新的详细窗
        void LoadDetail(int index,
            string strStyle = "new"
            // bool bOpenNew = true
                )
        {
            // 取出记录路径,析出书目库名,然后看这个书目库的syntax
            // 可能装入MARC和DC两种不同的窗口
            string strError = "";

#if NO
            // 防止重入
            if (m_bInSearching == true)
            {
                strError = "当前窗口正在被一个未结束的长操作使用,无法装载记录。请稍后再试。";
                goto ERROR1;
            }
#endif

            string strSyntax = "";
            int nRet = GetOneRecordSyntax(index,
                this.m_bInSearching,
                out strSyntax,
                out strError);
            if (nRet == -1)
                goto ERROR1;

            if (strSyntax == "" // default = unimarc
                || strSyntax.ToLower() == "unimarc"
                || strSyntax.ToLower() == "usmarc")
            {

                MarcDetailForm form = null;
                MarcDetailForm exist_fixed = this.MainForm.FixedMarcDetailForm;

                if (strStyle == "exist")
                    form = this.MainForm.TopMarcDetailForm;
                else if (strStyle == "fixed")
                    form = exist_fixed;

                if (exist_fixed != null)
                    exist_fixed.Activate();

                if (form == null)
                {
                    form = new MarcDetailForm();

                    form.MdiParent = this.MainForm;
                    form.MainForm = this.MainForm;

                    if (strStyle == "fixed")
                    {
                        form.Fixed = true;
                        form.SupressSizeSetting = true;
                        this.MainForm.SetMdiToNormal();
                    }
                    else
                    {
                        // 在已经有左侧窗口的情况下,普通窗口需要显示在右侧
                        if (exist_fixed != null)
                        {
                            form.SupressSizeSetting = true;
                            this.MainForm.SetMdiToNormal();
                        }
                    }
                    form.Show();
                    if (strStyle == "fixed")
                        this.MainForm.SetFixedPosition(form, "left");
                    else
                    {
                        // 在已经有左侧窗口的情况下,普通窗口需要显示在右侧
                        if (exist_fixed != null)
                        {
                            this.MainForm.SetFixedPosition(form, "right");
                        }
                    }
                }
                else
                {
                    form.Activate();
                    if (strStyle == "fixed")
                    {
                        this.MainForm.SetMdiToNormal();
                    }
                    else
                    {
                        // 在已经有左侧窗口的情况下,普通窗口需要显示在右侧
                        if (exist_fixed != null)
                        {
                            this.MainForm.SetMdiToNormal();
                        }
                    }
                }

                // MARC Syntax OID
                // 需要建立数据库配置参数,从中得到MARC格式
                ////form.AutoDetectedMarcSyntaxOID = "1.2.840.10003.5.1";   // UNIMARC

                form.LoadRecord(this, index);
            }
            else if (strSyntax.ToLower() == "dc")
            {
                DcForm form = null;

                if (strStyle == "exist")
                    form = this.MainForm.TopDcForm;

                if (form == null)
                {
                    form = new DcForm();

                    form.MdiParent = this.MainForm;
                    form.MainForm = this.MainForm;

                    form.Show();
                }
                else
                    form.Activate();

                form.LoadRecord(this, index);
            }
            else
            {
                strError = "未知的syntax '" + strSyntax + "'";
                goto ERROR1;
            }

            return;
        ERROR1:
            MessageBox.Show(this, strError);
        }
Пример #3
0
        void LoadDetail(int index)
        {
            // 取出记录路径,析出书目库名,然后看这个书目库的syntax
            // 可能装入MARC和DC两种不同的窗口
            string strError = "";

            // 防止重入
            if (m_bInSearch == true)
            {
                strError = "当前窗口正在被一个未结束的长操作使用,无法装载记录。请稍后再试。";
                goto ERROR1;
            }

            string strSyntax = "";
            int nRet = GetOneRecordSyntax(index,
                out strSyntax,
                out strError);
            if (nRet == -1)
                goto ERROR1;

            if (strSyntax == "" // default = unimarc
                || strSyntax.ToLower() == "unimarc"
                || strSyntax.ToLower() == "usmarc")
            {

                MarcDetailForm form = new MarcDetailForm();

                form.MdiParent = this.MainForm;
                form.MainForm = this.MainForm;

                // MARC Syntax OID
                // 需要建立数据库配置参数,从中得到MARC格式
                //// form.AutoDetectedMarcSyntaxOID = "1.2.840.10003.5.1";   // UNIMARC

                form.Show();

                form.LoadRecord(this, index);
            }
            else if (strSyntax.ToLower() == "dc")
            {

                DcForm form = new DcForm();

                form.MdiParent = this.MainForm;
                form.MainForm = this.MainForm;

                form.Show();

                form.LoadRecord(this, index);
            }
            else
            {
                strError = "未知的syntax '" + strSyntax + "'";
                goto ERROR1;
            }

            return;
        ERROR1:
            MessageBox.Show(this, strError);
        }
Пример #4
0
        // 装入DC详窗
        void menuItem_loadDcDetail_Click(object sender, EventArgs e)
        {
            int index = -1;
            string strError = "";

            ZConnection connection = this.GetCurrentZConnection();
            if (connection == null)
            {
                strError = "当前ZConnection为空";
                goto ERROR1;
            }

            if (connection.VirtualItems.SelectedIndices.Count > 0)
                index = connection.VirtualItems.SelectedIndices[0];
            else
            {
                strError = "尚未选择要装入的记录";
                goto ERROR1;
            }

            DigitalPlatform.Z3950.Record record = null;
            if (index < connection.VirtualItems.Count)
            {
                record = (DigitalPlatform.Z3950.Record)
                    connection.VirtualItems[index].Tag;
            }
            else
            {
                strError = "index越界";
                goto ERROR1;
            }

            // XML格式或者SUTRS
            if (record.m_strSyntaxOID == "1.2.840.10003.5.109.10" // XML
                )
            {
                DcForm form = new DcForm();

                form.MdiParent = this.MainForm;
                form.MainForm = this.MainForm;
                form.Show();

                form.LoadRecord(this, index);
                return;
            }
            else
            {
                strError = "记录不是XML格式";
                goto ERROR1;
            }

            // return;
            ERROR1:
            MessageBox.Show(this, strError);
        }