예제 #1
0
    // 维护种次号
    void ManageZhongcihao()
    {
        string strError = "";
        ZhongcihaoForm dlg = new ZhongcihaoForm();

        string strClass = "";
        int nRet = 0;

        strClass = this.DetailForm.MarcEditor.Record.Fields.GetFirstSubfield("905", "d");

        dlg.MdiParent = this.DetailForm.MainForm;
        dlg.MainForm = this.DetailForm.MainForm;
        dlg.TopMost = true;
        dlg.AutoBeginSearch = true;

        dlg.ClassNumber = strClass;
        dlg.BiblioDbName = this.DetailForm.BiblioDbName;

        dlg.Show();
    }
예제 #2
0
    // new 
    void AddZhongcihao()
    {
        string strError = "";
        ZhongcihaoForm dlg = new ZhongcihaoForm();

        try
        {
            string strClass = "";
            string strNumber = "";
            int nRet = 0;

            strClass = this.DetailForm.MarcEditor.Record.Fields.GetFirstSubfield("905", "d");

            if (strClass == "")
            {
                MessageBox.Show(this.DetailForm, "记录中不存在905$d子字段,因此无法加种次号");
                return;
            }

            string strExistNumber = this.DetailForm.MarcEditor.Record.Fields.GetFirstSubfield("905", "e");

            dlg.MainForm = this.DetailForm.MainForm;
            dlg.TopMost = true;
            dlg.MyselfBiblioRecPath = this.DetailForm.BiblioRecPath;
            dlg.LibraryServerName = this.DetailForm.ServerName;

            dlg.Show();
            // dlg.WindowState = FormWindowState.Minimized;

            // return:
            //      -1  error
            //      0   canceled
            //      1   succeed
            nRet = dlg.GetNumber(
                ZhongcihaoStyle.Seed,
                strClass,
                this.DetailForm.BiblioDbName,
                out strNumber,
                out strError);
            if (nRet == -1)
                goto ERROR1;

            this.DetailForm.MarcEditor.Record.Fields.SetFirstSubfield("905", "e", strNumber);
            return;
        }
        catch (Exception ex)
        {
            strError = ex.Message;
            goto ERROR1;
        }
        finally
        {
            dlg.Close();
        }

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