Пример #1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            AddDepartmentFrm addFrm = new AddDepartmentFrm();

            addFrm.Text = "添加部门信息";
            addFrm.ShowDialog();
            refreshDataGridView();
        }
Пример #2
0
        private void buttonModify_Click(object sender, EventArgs e)
        {
            if (null == dataGridViewDepartment.CurrentRow)
            {
                return;
            }
            int index = dataGridViewDepartment.CurrentRow.Index;
            AddDepartmentFrm addFrm = new AddDepartmentFrm();

            addFrm.setId(int.Parse(dataGridViewDepartment.Rows[index].Cells["Id"].Value.ToString()));
            addFrm.fillField();
            addFrm.Text = "修改部门信息";
            addFrm.ShowDialog();
            refreshDataGridView();
        }