예제 #1
0
 private void ImportRiskLevel()
 {
     ImportAndValidate("RiskLevel.xlsx", stream =>
     {
         var importer = new RiskLevelImport(stream);
         importer.Import();
     });
 }
 public void RiskLevel()
 {
     ImportAndValidate("RiskLevel.xlsx", stream =>
     {
         var importer = new RiskLevelImport(stream);
         importer.Import();
         var data = Context.RiskLevels.First();
         Assert.AreEqual(data.MinValue, 0);
         Assert.AreEqual(data.MaxValue, 1);
         Assert.AreEqual(data.Color, "White");
         Assert.AreEqual(data.Description, "安全");
     });
 }
예제 #3
0
        private static void ImportFromFolder()
        {
            var folder = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ImportData");
            ExcelDataImportBase importer = new CellMappingImport(Path.Combine(folder, "CellMapping.xlsx"));

            importer.Import();
            importer = new ConstructionValueImport(Path.Combine(folder, "ConstructionValue.xlsx"));
            importer.Import();
            importer = new BusinessValueImport(Path.Combine(folder, "BusinessValue.xlsx"));
            importer.Import();
            importer = new BusinesFeatureImport(Path.Combine(folder, "BusinessFeature.xlsx"));
            importer.Import();
            importer = new RiskLevelImport(Path.Combine(folder, "RiskLevel.xlsx"));
            importer.Import();
        }