private void AddButtonOnClick(object sender, RoutedEventArgs e) { var newItem = new Models.ForwardedBalanceOld { ForwardedYear = _userDate.Year, DocumentDate = _userDate }; var forwardedBalanceEditWindow = new ForwardedBalanceEditWindow(newItem); forwardedBalanceEditWindow.ShowDialog(); if (forwardedBalanceEditWindow.ActionResult.Success) { RefreshDisplay(); } }
private void EditButtonOnClick(object sender, RoutedEventArgs e) { if (LedgerGrid.SelectedItems.Count == 0) { return; } var selectedRecord = (Models.ForwardedBalanceOld)LedgerGrid.SelectedItem; if (selectedRecord == null) { return; } var forwardedBalanceEditWindow = new ForwardedBalanceEditWindow(Controllers.ModelController.DeepClone(selectedRecord)); forwardedBalanceEditWindow.ShowDialog(); if (forwardedBalanceEditWindow.ActionResult.Success) { RefreshDisplay(); } }