/// <summary>
 ///
 /// </summary>
 /// <returns></returns>
 private bool OrderAvailable()
 {
     if (ValidatedRefundOrders.Count() <= 0)
     {
         return(false);
     }
     return(true);
 }
        //=========================================================================
        // Private routines (private methods)
        //=========================================================================

        #region Private routines

        /// <summary>
        ///
        /// </summary>
        protected override void ExecuteConnectorTask()
        {
            Notify(0);

            // 1. Get [RefundQueue], If [RefundQueue].count > 0 generate Sepa file
            if (!OrderAvailable())
            {
                return;
            }

            // 2. Do stuff for each order, like getting customer data by Http request for each order, validate customer data
            //    Merge order- and customerdata and add to the SepaCollection.
            manager.ProcessOrders(ValidatedRefundOrders);

            // 3. Generate and Write to Sepa document.
            manager.GenerateSepa();

            // 4. Send Sepa to FTP server or file location
            manager.SaveSepaDoc(ReadSetting(SepaPathSetting));

            // 5. Validate the stored Sepa Document.
            manager.ValidateSepaDoc(ReadSetting(SepaPathSetting), ReadSetting(XsdPathSetting));



            int failures = WriteSepaOrderFailures.Count();


            // Continue process for all validated orders.
            var enumerator = ValidatedRefundOrders.Where(i => i.IsValid).GetEnumerator();

            while (enumerator.MoveNext())
            {
                // 6. Add all valid orders to [RefundQueueHistory]
                InsertOrderHistory(enumerator.Current);
                // 7. Remove all valid orders from [RefundQueue]
                RemoveRefundOrder(enumerator.Current);
            }

            Notify(1);
        }