Exemple #1
0
        private void toolStrip_add_Click(object sender, EventArgs e)
        {
            //打开添加窗体
            Form_Add formadd = new Form_Add();

            formadd.ShowDialog();
            //添加删除或编辑后仍是当前选中节点的数据
            if (treeView1.SelectedNode != null)
            {
                StudentInfo Rchose = new StudentInfo();

                switch (treeView1.SelectedNode.Tag.ToString())
                {
                //通过调用search中现有的方法完成
                case "0": dataGridView1.DataSource = StudentInfoBLL.GetAllStudentInfo(); break;

                case "1":
                    Rchose.Profession        = treeView1.SelectedNode.Text;
                    dataGridView1.DataSource = StudentInfoBLL.GetStudentInfoList(Rchose);
                    break;
                    //使用Tag标志区别选中的标签类别,可以再次扩展,这里不做了,用Tag意义不大
                }
            }
            else
            {
                initContracts();
            }
        }
Exemple #2
0
        private void toolStrip_add_Click(object sender, EventArgs e)
        {
            Form_Add formadd = new Form_Add();

            formadd.ShowDialog();
            initContracts();
        }