Example #1
0
        public static CobieModel ImportFromTable(Stream file, ExcelTypeEnum typeEnum, out string report, ModelMapping mapping = null)
        {
            var loaded = new CobieModel();

            mapping = mapping ?? ModelMapping.Load(Properties.Resources.COBieUK2012);
            var storage = GetTableStore(loaded, mapping);

            using (var txn = loaded.BeginTransaction("Loading XLSX"))
            {
                storage.LoadFrom(file, typeEnum);
                txn.Commit();
            }

            report = storage.Log.ToString();
            return(loaded);
        }