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