Exemple #1
0
 private void ImportConstructionValue()
 {
     ImportAndValidate("ConstructionValue.xlsx", stream =>
     {
         var importer = new ConstructionValueImport(stream);
         importer.Import();
     });
 }
 public void ConstructionValue()
 {
     ImportAndValidate("ConstructionValue.xlsx", stream =>
     {
         var importer = new ConstructionValueImport(stream);
         importer.Import();
         var data = Context.ConstructionValues.First();
         Assert.AreEqual("钢筋混凝土", data.Name);
         Assert.AreEqual(1, data.Id);
         Assert.AreEqual(data.DesignRequirement, ConstructionDesignRequirement.一级);
         Assert.AreEqual(data.Jgkhyz, 2.37);
         Assert.AreEqual(importer.RowCount, 7);
         Assert.AreEqual(Context.ConstructionValues.Count(), 7);
     });
 }
Exemple #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();
        }