Beispiel #1
0
        private void FindColumnIndices()
        {
            if (columnIndices == null)
            {
                columnIndices = new BomColumnIndices();
            }

            var table = bom as TableAnnotation;

            columnIndices.Description = table.IndexOfColumnTitle("Description");
            columnIndices.ItemNumber  = table.IndexOfColumnType(swTableColumnTypes_e.swBomTableColumnType_ItemNumber);
            columnIndices.PartNumber  = table.IndexOfColumnType(swTableColumnTypes_e.swBomTableColumnType_PartNumber);
            columnIndices.Quantity    = table.IndexOfColumnType(swTableColumnTypes_e.swBomTableColumnType_Quantity);

            if (columnIndices.PartNumber == -1)
            {
                throw new Exception("Part number column not found.");
            }

            if (columnIndices.ItemNumber == -1)
            {
                throw new Exception("Item number column not found.");
            }

            if (columnIndices.Description == -1)
            {
                throw new Exception("Description column not found.");
            }

            if (columnIndices.Quantity == -1)
            {
                throw new Exception("Quantity column not found.");
            }
        }
Beispiel #2
0
 public BomItemExtractor(BomTableAnnotation bom)
 {
     this.bom      = bom;
     columnIndices = new BomColumnIndices();
 }