Esempio n. 1
0
        // 自动根据情况,装载到MARC或者XML记录窗
        void LoadDetail(int index,
            string strFormat)
        {
            // XML格式
            if (strFormat == "xml")
            {
                XmlDetailForm form = new XmlDetailForm();

                form.DisplayOriginPage = false;
                form.MdiParent = this.m_mainForm;
                form.MainForm = this.m_mainForm;
                form.Show();

                form.LoadRecord(this, index);
                return;
            }

            ListViewItem curItem = this.listView_browse.Items[index];
            ItemInfo info = (ItemInfo)curItem.Tag;
            if (info != null)
            {
                if (strFormat == "unimarc")
                    info.PreferSyntaxOID = "1.2.840.10003.5.1"; // UNIMARC
                else if (strFormat == "usmarc")
                    info.PreferSyntaxOID = "1.2.840.10003.5.10"; // USMARC
            }

            {
                MarcDetailForm form = new MarcDetailForm();

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

#if NO
                // 继承自动识别的OID
                if (connection.TargetInfo != null
                    && connection.TargetInfo.DetectMarcSyntax == true)
                {
                    form.AutoDetectedMarcSyntaxOID = record.AutoDetectedSyntaxOID;
                }
#endif
                form.Show();

                form.LoadRecord(this, index);
            }
        }
Esempio n. 2
0
        // 自动根据情况,装载到MARC或者XML记录窗
        void LoadDetail(int index,
            string strFormat)
        {
            // XML格式
            if (strFormat == "xml")
            {
                XmlDetailForm form = new XmlDetailForm();

                form.DisplayOriginPage = false;
                form.MdiParent = this.m_mainForm;
                form.MainForm = this.m_mainForm;
                form.Show();

                form.LoadRecord(this, index);
                return;
            }

            ListViewItem curItem = this.listView_browse.Items[index];
            ItemInfo info = (ItemInfo)curItem.Tag;
            if (info != null)
            {
                if (strFormat == "unimarc")
                    info.PreferSyntaxOID = "1.2.840.10003.5.1"; // UNIMARC
                else if (strFormat == "usmarc")
                    info.PreferSyntaxOID = "1.2.840.10003.5.10"; // USMARC
            }

            {
                MarcDetailForm exist_fixed = this.MainForm.FixedMarcDetailForm;

                MarcDetailForm form = new MarcDetailForm();

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

#if NO
                // 继承自动识别的OID
                if (connection.TargetInfo != null
                    && connection.TargetInfo.DetectMarcSyntax == true)
                {
                    form.AutoDetectedMarcSyntaxOID = record.AutoDetectedSyntaxOID;
                }
#endif
                // 在已经有左侧窗口的情况下,普通窗口需要显示在右侧
                if (exist_fixed != null)
                {
                    if (exist_fixed != null)
                        exist_fixed.Activate();

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

                form.LoadRecord(this, index);
            }
        }
Esempio n. 3
0
        void menuItem_loadXmlDetail_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"
                || record.m_strSyntaxOID == "1.2.840.10003.5.101")
            {
                XmlDetailForm form = new XmlDetailForm();

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

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

            // return;
            ERROR1:
            MessageBox.Show(this, strError);
        }
Esempio n. 4
0
        // 自动根据情况,装载到MARC或者XML记录窗
        void LoadDetail(int index)
        {
            if (index < 0)
                throw new ArgumentException("index 值不应该小于 0","index");

            ZConnection connection = this.GetCurrentZConnection();
            if (connection == null)
            {
                MessageBox.Show(this, "当前ZConnection为空");
                return;
            }

            DigitalPlatform.Z3950.Record record = null;
            if (index < connection.VirtualItems.Count)
            {
                record = (DigitalPlatform.Z3950.Record)
                    connection.VirtualItems[index].Tag;
            }
            else
            {
                MessageBox.Show(this, "index越界");
                return;
            }

            if (record.m_nDiagCondition != 0)
            {
                MessageBox.Show(this, "这是一条诊断记录");
                return;
            }

            // 2014/5/18
            string strSyntaxOID = record.AutoDetectedSyntaxOID;
            if (string.IsNullOrEmpty(strSyntaxOID) == true)
                strSyntaxOID = record.m_strSyntaxOID;

            // XML格式或者SUTRS格式
            if (strSyntaxOID == "1.2.840.10003.5.109.10"
                || strSyntaxOID == "1.2.840.10003.5.101")
            {
                XmlDetailForm form = new XmlDetailForm();

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

                form.LoadRecord(this, index);
                return;
            }

            {
                MarcDetailForm exist_fixed = this.MainForm.FixedMarcDetailForm;
                MarcDetailForm form = new MarcDetailForm();

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

                // 继承自动识别的OID
                if (connection.TargetInfo != null
                    && connection.TargetInfo.DetectMarcSyntax == true)
                {
                    // form.AutoDetectedMarcSyntaxOID = record.AutoDetectedSyntaxOID;

                    form.UseAutoDetectedMarcSyntaxOID = true;
                }

                // 在已经有左侧窗口的情况下,普通窗口需要显示在右侧
                if (exist_fixed != null)
                {
                    if (exist_fixed != null)
                        exist_fixed.Activate();

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

                form.LoadRecord(this, index);
            }
        }
Esempio n. 5
0
        // 自动根据情况,装载到MARC或者XML记录窗
        void LoadDetail(int index)
        {
            ZConnection connection = this.GetCurrentZConnection();
            if (connection == null)
            {
                MessageBox.Show(this, "当前ZConnection为空");
                return;
            }

            DigitalPlatform.Z3950.Record record = null;
            if (index < connection.VirtualItems.Count)
            {
                record = (DigitalPlatform.Z3950.Record)
                    connection.VirtualItems[index].Tag;
            }
            else
            {
                MessageBox.Show(this, "index越界");
                return;
            }

            if (record.m_nDiagCondition != 0)
            {
                MessageBox.Show(this, "这是一条诊断记录");
                return;
            }

            // 2014/5/18
            string strSyntaxOID = record.AutoDetectedSyntaxOID;
            if (string.IsNullOrEmpty(strSyntaxOID) == true)
                strSyntaxOID = record.m_strSyntaxOID;

            // XML格式或者SUTRS格式
            if (strSyntaxOID == "1.2.840.10003.5.109.10"
                || strSyntaxOID == "1.2.840.10003.5.101")
            {
                XmlDetailForm form = new XmlDetailForm();

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

                form.LoadRecord(this, index);
                return;
            }


            {
                MarcDetailForm form = new MarcDetailForm();


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

                // 继承自动识别的OID
                if (connection.TargetInfo != null
                    && connection.TargetInfo.DetectMarcSyntax == true)
                {
                    // form.AutoDetectedMarcSyntaxOID = record.AutoDetectedSyntaxOID;

                    form.UseAutoDetectedMarcSyntaxOID = true;
                }
                form.Show();

                form.LoadRecord(this, index);
            }
        }