// Import information from file with offers and file with routes (see CSVImport in DataAccess for more info) public void InitializeImport(string masterDataFilepath, string routeNumberFilepath) { CSVImport csvImport = new CSVImport(); csvImport.ImportContractors(masterDataFilepath); csvImport.ImportRouteNumbers(); csvImport.ImportOffers(routeNumberFilepath); contractorList = csvImport.SendContractorListToContainer(); routeNumberList = csvImport.SendRouteNumberListToContainer(); ListContainer listContainer = ListContainer.GetInstance(); listContainer.GetLists(routeNumberList, contractorList); }
//Starts the import of data when import is clicked public void InitializeImport(string masterDataFilepath, string routeNumberFilepath) { CSVImport csvImport = new CSVImport(); //only import from excel file if database is empty and there are excel files to import if (masterDataFilepath != null || routeNumberFilepath != null) { //Import data from excel files csvImport.ImportContractors(masterDataFilepath); csvImport.ImportRouteNumbers(); csvImport.ImportOffers(routeNumberFilepath); } //Import data from database contractorList = csvImport.SendContractorListToListContainer(); routeNumberList = csvImport.SendRouteNumberListToListContainer(); ListContainer listContainer = ListContainer.GetInstance(); listContainer.GetLists(routeNumberList, contractorList); }