private void btnNew_Click(object sender, EventArgs e) { fEmployee frm = new fEmployee(); frm.ItemChanged = RefreshList; frm.ShowDlg(new Employee(), true); }
private void btnEdit_Click(object sender, EventArgs e) { if (lsvEmployee.SelectedItems.Count <= 0) { MessageBox.Show("select an item to edit", "Item not yet selected", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } Employee oEmployee = null; fEmployee frm = new fEmployee(); if (lsvEmployee.SelectedItems != null && lsvEmployee.SelectedItems.Count > 0) { oEmployee = (Employee)lsvEmployee.SelectedItems[0].Tag; } frm.ItemChanged = RefreshList; frm.ShowDlg(oEmployee, false); }