Example #1
0
        public List <Agreement> ImportRecords(string path)
        {
            DataTable dataTable = excelImporter.ImportExcelFileToDataTable(path); // tutaj to ma byc?

            List <Agreement> agreements = new List <Agreement>();

            for (int i = 0; i < dataTable.Rows.Count; i++)
            {
                Address        address        = _addressBuilder.CreateFromDataTable(dataTable, i);
                Person         person         = _personBuilder.CreateFromDataTable(dataTable, i, address);
                FinancialState financialState = _financialStateBuilder.CreateFromDataTable(dataTable, i);
                Agreement      agreement      = _agreementBuilder.CreateFromDataTable(dataTable, i, person, financialState);
                agreements.Add(agreement);
            }

            return(agreements);
        }