Esempio n. 1
0
        public void populatePartsList(ExcelPackage package, List <SparePart> parts)
        {
            var sheet = package.Workbook.Worksheets.First();

            int rowCount = sheet.Dimension.End.Row;

            for (int row = 2; row < rowCount; row++)
            {
                SparePart sparePart = new SparePart();
                sparePart.ItemCode    = sheet.Cells[row, 1].Text.Trim();
                sparePart.Description = sheet.Cells[row, 2].Text.Trim();
                sparePart.Type        = sheet.Cells[row, 3].Text.Trim();
                sparePart.FCAPrice    = sheet.Cells[row, 5].Text.Trim();
                sparePart.Export      = false;

                parts.Add(sparePart);
            }
        }