static async Task Main(string[] args) { try { if (args.Length <= 0) { throw new ArgumentNullException("Give the path to Hyperspin.' RetroDbImporter C:\\Hyperspin'"); } if (args.Length <= 1) { throw new ArgumentNullException("Give the path to Rocketlauncher.' RetroDbImporter C:\\Hyperspin I:\\Rocketlauncher'"); } IBulkImport bulkImport = new BulkImport(@"Data Source=RetroDb.db", "hyperspin", args[0], args[1]); bulkImport.ImportProgressChanged += BulkImport_ImportProgressChanged;; await bulkImport.ImportAsync(); } catch (Exception ex) { System.Console.WriteLine(ex.Message); } finally { System.Console.Read(); } }
public async Task DoBulkHyperspinImport() { IBulkImport bulkImport = new BulkImport(Constants.CONN_STRING, "hyperspin", @"I:\Hyperspin", @"I:\Rocketlauncher"); Assert.True(bulkImport?.FrontEnd?.FePath == @"I:\Hyperspin"); bulkImport.ImportProgressChanged += BulkImport_ImportProgressChanged;; await bulkImport.ImportAsync(); }
public int ProcessCommit(string batchId, TenantViewModel tenant) { int bulkImportId = int.Parse(batchId); BulkImport bulkImport = BulkImportRepository.Single(x => x.BulkImportId == bulkImportId); ConvertedAssetsDto convertedAssets = BuildAssetsClearLookups(bulkImport.ImportText, tenant.TenantId); CommitImport(convertedAssets.Assets); return(convertedAssets.Assets.Count()); }
public BulkUploadViewModel PrepareImport(HttpPostedFileBase importedCsv) { BulkImport bulkImportResponse = new BulkImport(); string csvRaw = ConvertCsvFileToString(importedCsv); BatchId = BackupImport(csvRaw); BulkUploadViewModel assetsToCommit = BuildAssetsForDisplay(csvRaw, 0); return(assetsToCommit); }
public BulkUploadViewModel PrepareImport(int batchId) { BulkImport bulkImport = BulkImportRepository.Single(x => x.BulkImportId == batchId); if (bulkImport != null) { BulkUploadViewModel assetsToCommit = BuildAssetsForDisplay(bulkImport.ImportText, 0); return(assetsToCommit); } return(new BulkUploadViewModel()); }
public string BackupImport(string importCsvAsString) { BulkImport bulkImport = new BulkImport { ImportText = importCsvAsString, TenantId = 3 }; BulkImportRepository.Create(bulkImport); BulkImportRepository.Save(); return(bulkImport.BulkImportId.ToString()); }
public static async Task <bool> Import([ActivityTrigger] int batch, ILogger log) { log.LogInformation($"Prepare documents for batch {batch}"); string partitionKey = Environment.GetEnvironmentVariable("PartitionKey"); int docsPerBatch; int.TryParse(Environment.GetEnvironmentVariable("DocsPerBatch"), out docsPerBatch); List <string> documentsToImportInBatch = CosmosHelper.DocumentBatch(partitionKey, docsPerBatch, batch); await BulkImport.BulkImportDocuments(documentsToImportInBatch); return(true); }
public BulkImportDocument ToContaract(BulkImport bulkImport) { if (bulkImport == null) { throw new ArgumentNullException(nameof(bulkImport)); } return(new BulkImportDocument { Id = 12345, UploadedAt = bulkImport.EntryDate }); }
public void ImportWithExcelControlFile() { var fn = Path.GetTempFileName(); SQLiteServer svr = new SQLiteServer(fn); TimeSeriesDatabase db = new TimeSeriesDatabase(svr); var xlsControl = Path.Combine(TestData.DataPath, "bulk-import-template.xlsx"); BulkImport.Import(db, xlsControl); var cs = db.Factory.GetCalculationSeries(TimeInterval.Daily, "tablename='daily_ger_fb'"); Assert.AreEqual("khydromet", cs[0].Properties.Get("program")); Assert.AreEqual("DailyMidnight(instant_%site%_fb)", cs[0].Expression); Console.WriteLine(fn); }
protected override void ProcessBlock(NBitcoin.Indexer.BlockInfo block, BulkImport <Notify> bulk) { var notif = new NewBlockNotificationData() { Header = block.Block.Header, BlockId = block.BlockId, Height = block.Height }; foreach (var newBlock in _Subscriptions.GetNewBlocks()) { bulk.Add("o", new Notify(new Notification() { Subscription = newBlock, Data = notif })); } }
/// <summary> /// Ask user to select template for importing multiple series. /// then import all series defined in the first sheet of the workbook. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void importUsingTemplateToolStripMenuItem_Click(object sender, EventArgs e) { try { DB.SuspendTreeUpdates(); if (openExcelDialog.ShowDialog() == DialogResult.OK) { BulkImport.Import(DB, openExcelDialog.FileName); DatabaseChanged(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } finally { DB.ResumeTreeUpdates(); } }
private void AddImportIntelliFlo(ISession session) { const string importId = "3EB27ADC-9404-4451-BD70-F3E091F36339"; var import = new BulkImport { Id = 1234, EntryDate = new DateTime(2002, 01, 01, 0, 0, 0, DateTimeKind.Utc), LastUpdatedDate = new DateTime(2002, 01, 01, 0, 0, 0, DateTimeKind.Utc), }; var query = session.Query <BulkImport>().Where(x => x.Id == 12345); if (query.Any()) { return; } session.Save(import); }