Merge from trunk - no conflicts
Modified the code that auto-generates validation.  The previous change allowed empty string for fields that are NOT NULL but not part of the primary key.  This new code enforces that empty strings are not allowed in this circumstance if the field is a foreign key (to a different table's primary key).  This fixes this bug and about 70 other cases where the rule now applies.
GL Transactions were taking a very long time to load since code was added to UpdateBatchTotals.  This piece of code goes through all transactions checking the international currency amount.  However it used the default 10 places of decimals and the database data only works to 2 places (US cents).  For now this checkin uses a fixed 2 places because there is no time to do more.  But in future it needs to get the number of DP for whatever is the selected intl currency.  Now the screen loads as quickly as you would expect.  However more work needs to be done because of an extraordinary discovery that loopin through a DataView row by row gets progressively more time consuming.  We will need a different approach.
The Gift screen was taking a long time to load.  This was due to two reasons:  1) the fact that 2 cacheable tables both need loading 4 times and this was taking 0.5 seconds each time and 2) we were loading the batch data in the LedgerNumber 'setter' and it is much quicker to delay loading until the last opportunity.  On the SADB the load time on my laptop has come down from 8.5 seconds to 3.5 seconds.  The work did show however that there is a serious bug in our cacheable tables code whereby the data is always obtained from the server anyway.  Not changing that now.
More work on Gift Importing and validation following discussions with Rob in Carlisle.  Still not finished.
Uncrustify
Merge from trunk - no conflicts
Get rid of unused variables detected by Jenkins.  Also changed UINavigation because the Stewardship Calculation screen did not open at all.
This fixes an exception that occurs when the FPreviouslySelectedDetailRow references a row that has been removed.  The code now remembers the primary key values while the variable is good and then finds the row again in order to display the details on the Gift Revert dialog.
A simple fix to prevent an exception when a row returned by Rows.Find() is null.  This occurred when checking that a non-confidential gift is being associated with an anonymous donor.
Added a method to get the first day of an accounting period for any specified date.  Used to get the date of a required corporate exchange rate entry.  The method is accessible using a delegate so should be available to clients too, if required in the future.
Just a small change to the reporting of real exceptions. (Matches a similar change in Gift Importing).
A lot more validation in Gift Import and some minor changes to the import code as well.
Uncrustify the previous checkin.
Merge with trunk - no conflicts
Improved the behaviour of GL Import Transactions.  There were two main problems:  1. You could not import and then create a new journal to import again.  This raised a concurrency exception.  2. The batch totals were not calculated at all - and did not have enough information in the DataSet to do so.  I have checked this code agains imports using the file from the Swiss Office.

There is still more work to do on GL Imports (including using the B/J/T stype file, but this checks in the code so far and is what will be required by CH.
This check in adds a new feature whereby we can import gifts using a simple gift transaction file.  This is the way that the Swiss Office will do it.  I have tested it against one of their files (which is a fairly simple one admittedly).  I will do more checking but this does work.
Uncrustify
Merge from trunk - no conflicts
Just gets rid of an unused variable discovered by Jenkins