public static DataTable GetInvoicesDataTable(string checkNo, int assocBankAcctID,
int assocAcctLedgerID, int actionItemID, bool fetchAllItems, bool isUnvoid)
{
string sql = string.IsNullOrEmpty(checkNo) && !fetchAllItems
? GetSingleRecordQuery()
: GetMultipleRecordQuery(checkNo, fetchAllItems);
DataTable dt = DB.RtnTable(sql, DB.DB_CUSTOMER_DATA, assocBankAcctID, checkNo, actionItemID,
assocAcctLedgerID);
if (isUnvoid)
{
// return the datatable but exclude any rows where the column, "VoidDate", is not null
}
// else, return the datatable but exclude any rows where the column, "VoidDate", is null
}
I'm trying to figure out a succinct way to filter a DataTable based on two conditions. Is it best to modify the original DataTable somehow or should I make a copy of it, filter it, and return that? How can I accomplish that?