private void btnDeleteTransaction_Click( object sender, RoutedEventArgs e )
{
int transactionId = (int)( sender as Button ).CommandParameter;
if ( MessageBox.Show( "Are you sure you want to delete this transaction?", "Confirm", MessageBoxButton.OKCancel ) == MessageBoxResult.OK )
{
try
{
FinancialTransaction financialTransaction = grdBatchItems.SelectedValue as FinancialTransaction;
if ( financialTransaction != null )
{
RockConfig config = RockConfig.Load();
RockRestClient client = new RockRestClient( config.RockBaseUrl );
client.Login( config.Username, config.Password );
client.Delete( string.Format( "api/FinancialTransactions/{0}", transactionId ) );
UpdateBatchUI( this.SelectedFinancialBatch );
}
}
catch ( Exception ex )
{
ShowException( ex );
}
}
}