Exemplo n.º 1
0
        private void toolStripButton_dup_project_modify_Click(object sender, EventArgs e)
        {
            if (this.listView_dup_projects.SelectedItems.Count == 0)
            {
                MessageBox.Show(this, "尚未选择要修改的查重方案事项");
                return;
            }

            ListViewItem item = this.listView_dup_projects.SelectedItems[0];

            string strProjectName = item.Text;
            string strProjectComment = ListViewUtil.GetItemText(item, 1);

            // 复制出一个新的DOM
            XmlDocument new_dom = new XmlDocument();
            new_dom.LoadXml(this.m_dup_dom.OuterXml);

            ProjectDialog dlg = new ProjectDialog();
            MainForm.SetControlFont(dlg, this.Font, false);

            dlg.CreateMode = false;
            // dlg.DupCfgDialog = this;
            dlg.DbFromInfos = this.MainForm.BiblioDbFromInfos;
            dlg.BiblioDbNames = this.GetAllBiblioDbNames();
            dlg.ProjectName = strProjectName;
            dlg.ProjectComment = strProjectComment;
            dlg.dom = new_dom;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
                return;

            this.m_dup_dom = new_dom;

            item.Text = dlg.ProjectName;
            ListViewUtil.ChangeItemText(item,
                1, dlg.ProjectComment);

            this.DupChanged = true;

            FillDefaultList(this.m_dup_dom); // 库名的集合可能发生改变

            if (strProjectName != dlg.ProjectName)
            {
                // 方案名发生改变后,兑现到下方的缺省关系列表中
                ChangeDefaultProjectName(strProjectName,
                    dlg.ProjectName);
            }

        }
Exemplo n.º 2
0
        // 新增一个方案
        private void toolStripButton_dup_project_new_Click(object sender, EventArgs e)
        {
            // 复制出一个新的DOM
            XmlDocument new_dom = new XmlDocument();
            new_dom.LoadXml(this.m_dup_dom.OuterXml);

            ProjectDialog dlg = new ProjectDialog();
            MainForm.SetControlFont(dlg, this.Font, false);

            dlg.CreateMode = true;
            //dlg.DupCfgDialog = this;
            dlg.DbFromInfos = this.MainForm.BiblioDbFromInfos;
            dlg.BiblioDbNames = this.GetAllBiblioDbNames();
            dlg.ProjectName = "新的查重方案";
            dlg.ProjectComment = "";
            dlg.dom = new_dom;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

            if (dlg.DialogResult != DialogResult.OK)
                return;

            this.m_dup_dom = new_dom;

            // 刷新列表
            FillProjectNameList(this.m_dup_dom);

            // 选定刚插入的事项
            SelectProjectItem(dlg.ProjectName);

            this.DupChanged = true;

            FillDefaultList(this.m_dup_dom);  // 库名的集合可能发生改变
        }