private void btnOpenEmployee_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; try { var empId = 0; using (var frm = new frmEmployee_Open()) { if (frm.ShowDialog() != DialogResult.OK) { return; } empId = frm.EmployeeId; } var employee = new EmployeeDataReader().GetItemOf(empId); using (var frm = new frmEmployee_Add()) { frm.ItemData = employee; frm.ShowDialog(); } } catch (Exception ex) { MessageDialog.ShowError(ex, this); } }
private void btnAddEmployee_Click(object sender, EventArgs e) { Cursor.Current = Cursors.WaitCursor; try { using (var frm = new frmEmployee_Add()) { frm.ItemData = new Dll.Employee.Employee(); frm.ShowDialog(); } } catch (Exception ex) { MessageDialog.ShowError(ex, this); } }