private void bt_add_person_Click(object sender, EventArgs e) { if (lb_dept.SelectedIndex != -1) { PersonEdit form = new PersonEdit(deptList[lb_dept.SelectedIndex].id); if (form.ShowDialog() == DialogResult.OK) { LoadPerson(); } } }
private void bt_update_person_Click(object sender, EventArgs e) { if (dg_person.SelectedRows.Count != 0) { PersonEdit form = new PersonEdit(int.Parse(dg_person.SelectedRows[0].Cells[0].Value.ToString()), int.Parse(dg_person.SelectedRows[0].Cells[1].Value.ToString()), dg_person.SelectedRows[0].Cells[3].Value.ToString(), dg_person.SelectedRows[0].Cells[2].Value.ToString(), dg_person.SelectedRows[0].Cells[4].Value.ToString(), dg_person.SelectedRows[0].Cells[5].Value.ToString(), dg_person.SelectedRows[0].Cells[6].Value.ToString(), dg_person.SelectedRows[0].Cells[7].Value.ToString(), dg_person.SelectedRows[0].Cells[8].Value.ToString()); form.ShowDialog(); LoadPerson(); } }