Exemplo n.º 1
0
        private void buttonAdd_Click(object sender, EventArgs e)
        {
            AddEmployeeFrm addFrm = new AddEmployeeFrm();

            addFrm.Text = "添加员工信息";
            addFrm.ShowDialog();

            refreshDataGridView();
        }
Exemplo n.º 2
0
        private void buttonModify_Click(object sender, EventArgs e)
        {
            if (null == dataGridViewEmployee.CurrentRow)
            {
                return;
            }
            int            index  = dataGridViewEmployee.CurrentRow.Index;
            AddEmployeeFrm addFrm = new AddEmployeeFrm();

            Console.WriteLine("修改ID[" + dataGridViewEmployee.Rows[index].Cells["Id"].Value.ToString() + "]的员工信息");
            addFrm.setEmployeeId(int.Parse(dataGridViewEmployee.Rows[index].Cells["Id"].Value.ToString()));
            addFrm.fillField();
            addFrm.Text = "修改员工信息";
            addFrm.ShowDialog();

            refreshDataGridView();
        }