void OnReturnedFromSortie(SortieInfo rpSortie)
{
if (!r_ReturnReason.HasValue)
{
IEnumerable<Ship> rShips = rpSortie.Fleet.Ships;
if (rpSortie.EscortFleet != null)
rShips = rShips.Concat(rpSortie.EscortFleet.Ships);
r_ReturnReason = rShips.Any(rpShip => (rpShip.State & ShipState.HeavilyDamaged) != 0) ? ReturnReason.RetreatWithHeavilyDamagedShip : ReturnReason.Retreat;
}
using (var rTransaction = Connection.BeginTransaction())
{
InsertReturnReason(r_ReturnReason.Value);
SetReturnTime(rpSortie.ReturnTime);
rTransaction.Commit();
}
}