示例#1
0
        public static IProgressItem Start(EntityType entityType, String CSVFileURI, String importSettingsJSON)
        {
            lock (_syncObj)
            {
                var operation = GetStatus(entityType);

                if (operation == null)
                {
                    var fromCache = ImportDataCache.Get(entityType);

                    if (fromCache != null)
                    {
                        return(fromCache);
                    }
                }


                if (operation == null)
                {
                    operation = new ImportDataOperation(entityType, CSVFileURI, importSettingsJSON);

                    _importQueue.Add(operation);
                }

                if (!_importQueue.IsStarted)
                {
                    _importQueue.Start(x => x.RunJob());
                }

                return(operation);
            }
        }
示例#2
0
 public ImportFromCSV(TenantManager tenantProvider,
                      DistributedTaskQueueOptionsManager progressQueueOptionsManager,
                      ImportDataOperation importDataOperation)
 {
     _tenantId            = tenantProvider.GetCurrentTenant().TenantId;
     _importQueue         = progressQueueOptionsManager.Get <ImportDataOperation>();
     _importDataOperation = importDataOperation;
 }
示例#3
0
        public object Clone()
        {
            var cloneObj = new ImportDataOperation();

            cloneObj.Error       = Error;
            cloneObj.Id          = Id;
            cloneObj.IsCompleted = IsCompleted;
            cloneObj.Percentage  = Percentage;
            cloneObj.Status      = Status;

            return(cloneObj);
        }
        public object Clone()
        {
            var cloneObj = new ImportDataOperation
            {
                Error       = Error,
                Id          = Id,
                IsCompleted = IsCompleted,
                Percentage  = Percentage,
                Status      = Status
            };

            return(cloneObj);
        }
        public object Clone()
        {
            var cloneObj = new ImportDataOperation
            {
                Error = Error,
                Id = Id,
                IsCompleted = IsCompleted,
                Percentage = Percentage,
                Status = Status
            };

            return cloneObj;
        }
 public static void Insert(EntityType entityType, ImportDataOperation data)
 {
     Cache.Insert(GetStateCacheKey(entityType), data, TimeSpan.FromMinutes(1));
 }
示例#7
0
        public static IProgressItem Start(EntityType entityType, String CSVFileURI, String importSettingsJSON)
        {

            lock (_syncObj)
            {

                var operation = GetStatus(entityType);

                if (operation == null)
                {

                    operation = new ImportDataOperation(entityType, CSVFileURI, importSettingsJSON);

                    _importQueue.Add(operation);
                }

                if (!_importQueue.IsStarted)
                    _importQueue.Start(x => x.RunJob());

                return operation;

            }
        }
示例#8
0
        public object Clone()
        {
            var cloneObj = new ImportDataOperation();

            cloneObj.Error = Error;
            cloneObj.Id = Id;
            cloneObj.IsCompleted = IsCompleted;
            cloneObj.Percentage = Percentage;
            cloneObj.Status = Status;

            return cloneObj;
        }