Exemplo n.º 1
0
        private void button_newProject_Click(object sender, EventArgs e)
        {
            // 复制出一个新的DOM
            XmlDocument new_dom = new XmlDocument();

            new_dom.LoadXml(this.dom.OuterXml);

            ProjectDialog dlg = new ProjectDialog();

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

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

            this.dom = new_dom;

            // 刷新列表
            FillProjectNameList();

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

            this.Changed = true;

            FillDefaultList();  // 库名的集合可能发生改变
        }
Exemplo n.º 2
0
        // 修改查重方案
        private void button_modifyProject_Click(object sender, EventArgs e)
        {
            if (this.listView_projects.SelectedItems.Count == 0)
            {
                MessageBox.Show(this, "尚未选择要修改的查重方案事项");
                return;
            }

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

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

            // 复制出一个新的DOM
            XmlDocument new_dom = new XmlDocument();

            new_dom.LoadXml(this.dom.OuterXml);

            ProjectDialog dlg = new ProjectDialog();

            dlg.CreateMode     = false;
            dlg.DupCfgDialog   = this;
            dlg.ProjectName    = strProjectName;
            dlg.ProjectComment = strProjectComment;
            dlg.dom            = new_dom;
            dlg.StartPosition  = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

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

            this.dom = new_dom;

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

            this.Changed = true;

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

            if (strProjectName != dlg.ProjectName)
            {
                // 方案名发生改变后,兑现到下方的缺省关系列表中
                ChangeDefaultProjectName(strProjectName,
                                         dlg.ProjectName);
            }
        }
Exemplo n.º 3
0
        private void button_newProject_Click(object sender, EventArgs e)
        {
            // 复制出一个新的DOM
            XmlDocument new_dom = new XmlDocument();
            new_dom.LoadXml(this.dom.OuterXml);

            ProjectDialog dlg = new ProjectDialog();

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

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

            this.dom = new_dom;

            // 刷新列表
            FillProjectNameList();

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

            this.Changed = true;

            FillDefaultList();  // 库名的集合可能发生改变
        }
Exemplo n.º 4
0
        // 修改查重方案
        private void button_modifyProject_Click(object sender, EventArgs e)
        {
            if (this.listView_projects.SelectedItems.Count == 0)
            {
                MessageBox.Show(this, "尚未选择要修改的查重方案事项");
                return;
            }

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

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

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

            ProjectDialog dlg = new ProjectDialog();

            dlg.CreateMode = false;
            dlg.DupCfgDialog = this;
            dlg.ProjectName = strProjectName;
            dlg.ProjectComment = strProjectComment;
            dlg.dom = new_dom;
            dlg.StartPosition = FormStartPosition.CenterScreen;
            dlg.ShowDialog(this);

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

            this.dom = new_dom;

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

            this.Changed = true;

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

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