Пример #1
0
        public static List<OxfordLineItem> ReadFile(string path)
        {
            List<OxfordLineItem> records = new List<OxfordLineItem>();

            ExcelFile excel = new ExcelFile(path);
            DataTable dataTable = excel.GetFirstWorksheet();

            DateTime timeStamp = DateTime.Now;

            foreach (DataRow row in dataTable.Rows)
            {
                OxfordLineItem lineItem = ProcessRow(row);

                if (lineItem != null)
                {
                    lineItem.FileName = path;
                    lineItem.Created = timeStamp;

                    records.Add(lineItem);
                }
            }

            return records;
        }
Пример #2
0
        // **** All Private Members
        private static List<HorizonLineItem> LoadFromExcelFile(string path)
        {
            List<HorizonLineItem> records = new List<HorizonLineItem>();
            ExcelFile excel = new ExcelFile(path);
            DataTable dataTable = excel.GetFirstWorksheet();

            DateTime timeStamp = DateTime.Now;

            foreach (DataRow row in dataTable.Rows)
            {
                HorizonLineItem lineItem = ProcessRowExcel(row);

                if (lineItem != null)
                {
                    lineItem.Filename = path;
                    lineItem.Created = timeStamp;
                    records.Add(lineItem);
                }
            }

            return records;
        }