public ExcelDataManager(TranslationMapper translations, string primaryLanguage = "Serbian") { _xlApp = new Excel.Application(); if (_xlApp == null) { Console.WriteLine("Excel is not properly installed!"); return; } _xlWorkBook = _xlApp.Workbooks.Add(Type.Missing); _translations = translations; _primaryLanguage = primaryLanguage; }
public void ExportDiseases(int diseaseCount = 1) { List <Disease> diseases = GetDiseasesForExport(diseaseCount); TranslationMapper translations = new TranslationMapper(); ExcelDataManager <Disease> dataManager = new ExcelDataManager <Disease>(translations); foreach (Disease disease in diseases) { dataManager.AddNewData(disease); } dataManager.SaveFile(DateTime.Now.ToString("yyyyMMddHHmmss")); _repository.Update(_exportedDiseases); }