コード例 #1
0
 public void ExcelImport(ExcelImportMapping importMapping)
 {
     if (importMapping.Lookups.TransactionDate < 0)
     {
         throw new ExcelMappingException(String.Format("The {0} must be mapped. Please select a column to map the {0} to and try again", MappingFields.TransactionDate));
     }
     dataFileStorage.AddLocation(importMapping.SheetDescription.Filename);
     session.ImportData(lookupInterpreter.CreateSearcherFactory(importMapping.Lookups), reader.ReadJournals(importMapping));
 }
コード例 #2
0
        private static SearchResponse GetAllTransactionsFromSearch(ExcelImportMapping importMapping, int pageNumber)
        {
            var builder = AutofacConfiguration.CreateDefaultContainerBuilder()
                          .WithNoLicensing();
            SearchResponse results;

            using (var scope = builder.Build())
            {
                var controller = scope.Resolve <ExcelSessionController>();
                controller.ExcelImport(importMapping);

                var searchController = scope.Resolve <SearchController>();
                results =
                    searchController.UserSearch(
                        new SearchRequest <UserParameters>(
                            new SearchWindow <UserParameters>(new UserParameters("Steve"),
                                                              new DateRange(DateTime.MinValue, DateTime.MaxValue)), pageNumber));
            }
            return(results);
        }