public void AddException(ImportError errorToAdd)
 {
     _exceptions.Add(errorToAdd);
 }
 public void AddException(ImportError errorToAdd)
 {
     _exceptions.Add(errorToAdd);
 }
        private async Task<ImportError> DeactivateException(ImportError exception)
        {
            var filter = ImportQueueFilter.FromExceptionId(exception.FdpImportErrorId);
            filter.IsActive = false;

            return await DataContext.Import.SaveException(filter);
        }
        private async Task<ImportResult> ReProcessException(ImportError exception)
        {
            if (!ConfigurationSettings.GetBoolean("ReprocessImportAfterHandleError"))
                return null;

            var queuedItem = new ImportQueue()
            {
                ImportId = exception.FdpImportId,
                ImportQueueId = exception.ImportQueueId,
                LineNumber = int.Parse(exception.LineNumber)
            };
            return await Task.FromResult(DataContext.Import.ReprocessImportQueue(queuedItem));
        }
        public ImportError ImportErrorSave(ImportError importError)
        {
            ImportError retVal = null;
            string procName = "dbo.ImportQueue_Edit";

            using (IDbConnection conn = DbHelper.GetDBConnection())
            {
                try
                {
                    var para = new DynamicParameters();

                    para.Add("@ImportQueueId", importError.ImportQueueId, DbType.Int32);
                    para.Add("@Error", dbType: DbType.String, size: -1);

                    conn.Execute(procName, para, commandType: CommandType.StoredProcedure);

                    retVal = importError;
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                    throw;
                }
            }

            return retVal;
        }