public void ImportPOSyncData(bool truncate = false)
        {
            try
            {
                DataTable pervasiveRecords         = _purchaseOrderHeaderRepository.GetPervasiveRecords();
                DataTable pervasiveRecordsToUpdate = new DataTable();

                if (truncate)
                {
                    _queueRepository.TruncateQueueTable();
                }
                else
                {
                    var queueRecords = _queueRepository.GetQueueRecords();

                    // Remove items already existing in Queue from pervasive recordset
                    var idsFromQueue = new HashSet <string>(queueRecords.AsEnumerable()
                                                            .Select(pa => pa.Field <string>("POHeaderRecordID")));

                    var pervasiveRecordsNotFoundInQueue = pervasiveRecords.AsEnumerable()
                                                          .Where(pq => !idsFromQueue.Contains(pq.Field <string>("POHeaderRecordID")));

                    var pervasiveRecordsToUpdateInQueue = pervasiveRecords.AsEnumerable()
                                                          .Where(pq => idsFromQueue.Contains(pq.Field <string>("POHeaderRecordID")));

                    pervasiveRecords         = pervasiveRecordsNotFoundInQueue.CopyToDataTable();
                    pervasiveRecordsToUpdate = pervasiveRecordsToUpdateInQueue.CopyToDataTable();
                }

                for (int i = 0; i < pervasiveRecords.Rows.Count; i++)
                {
                    string sql = _queueRepository.CreateInsertSQL(pervasiveRecords.Rows[i]);
                    _queueRepository.InsertAuditPOSyncRecord(sql);

                    if (i % 5000 == 0)
                    {
                        Console.WriteLine("{0} records processed.", i);
                    }
                }

                _serviceLog.AppendLog(String.Format(" {0} PO_Header records imported to Queue", pervasiveRecords.Rows.Count.ToString()));
            }
            catch (Exception ex)
            {
                _serviceLog.AppendLog(ex.ToString());
            }
        }