Exemplo n.º 1
0
        void btnAdd_Click(object sender, EventArgs e)
        {
            FrmAddOrEditConn frm = new FrmAddOrEditConn();

            frm.Owner = this;
            frm.Text  = "Add Conn";
            frm.ShowDialog();

            if (frm.c_Model != null)
            {
                result.Add(frm.c_Model);
                dal.Save(result, Program.FullName);
            }
            this.bindUI_treeView();
        }
Exemplo n.º 2
0
        void btnEdit_Click(object sender, EventArgs e)
        {
            if (treeView1.SelectedNode != null && treeView1.SelectedNode.Tag is ChangeDataBaseEventArgs)
            {
                ChangeDataBaseEventArgs toEdit = treeView1.SelectedNode.Tag as ChangeDataBaseEventArgs;
                FrmAddOrEditConn        frm    = new FrmAddOrEditConn(toEdit);
                frm.Owner = this;
                frm.Text  = "Edit Conn";
                frm.ShowDialog();

                if (frm.c_Model != null)
                {
                    result.Remove(toEdit);
                    result.Add(frm.c_Model);
                    dal.Save(result, Program.FullName);
                }
                dal.Save(result, Program.FullName);
                this.bindUI_treeView();
            }
            else
            {
                MessageBox.Show("选择需要编辑的Conn", "错误");
            }
        }