//新增员工 private void addTool_Click(object sender, EventArgs e) { EmployeeForm addEmployee = new EmployeeForm(db, null, this); if (addEmployee.ShowDialog() == DialogResult.OK) { dgv_show(); } }
//编辑员工 private void editTool_Click(object sender, EventArgs e) { if (dgv.CurrentCell == null) { GeneralClass.printErrorMsg("没有选择行!"); return; } string selId = dgv.CurrentRow.Cells[0].Value.ToString(); var employee = db.Employee.FirstOrDefault(x => x.id == selId); EmployeeForm editEmployee = new EmployeeForm(db, employee, this); if (editEmployee.ShowDialog() == DialogResult.OK) { dgv_show(); } }
//编辑员工 private void editTool_Click(object sender, EventArgs e) { if (dgv.CurrentCell == null) { GeneralClass.printErrorMsg("没有选择行!"); return; } string selId = dgv.CurrentRow.Cells[0].Value.ToString(); var employee = db.Employee.FirstOrDefault(x => x.id == selId); EmployeeForm editEmployee = new EmployeeForm(db, employee, this); if (editEmployee.ShowDialog() == DialogResult.OK) dgv_show(); }
//新增员工 private void addTool_Click(object sender, EventArgs e) { EmployeeForm addEmployee = new EmployeeForm(db, null, this); if (addEmployee.ShowDialog() == DialogResult.OK) dgv_show(); }