protected override Entity OnAdd() { var newItem = new Deduction(); using (var frm = new frmDeduction_Add()) { frm.ItemData = newItem; if (frm.ShowDialog() != DialogResult.OK) { return(null); } } App.LogAction("Deduction", "Created Deduction: " + newItem.Description); ItemDataCollection.Add(newItem); return(newItem); }
protected override bool OnEdit(Entity item) { var selectedItem = (Deduction)item; using (var frm = new frmDeduction_Add()) { if (selectedItem.Id != 0) { selectedItem.RowStatus = RecordStatus.ModifiedRecord; } frm.ItemData = selectedItem; if (frm.ShowDialog() != DialogResult.OK) { return(false); } } App.LogAction("Deduction", "Updated Deduction: " + selectedItem.Description); return(true); }