Fixed exception thrown when qty is not a number.

This commit is contained in:
AJ
2018-06-21 10:50:46 -04:00
parent 2c483d0147
commit 780780ba3c
2 changed files with 728 additions and 730 deletions

View File

@@ -601,19 +601,17 @@ namespace ExportDXF.Forms
.GroupBy(c => c.ReferencedConfiguration)
.Select(group => group.First());
//var itemNumber = table.Text[rowIndex, itemNoColumnIndex].PadLeft(2, '0');
//var rev = 'A';
if (distinctComponents.Count() == 1)
{
var qtyString = table.DisplayedText[rowIndex, qtyColumnIndex];
int qty = 0;
int.TryParse(qtyString, out qty);
if (distinctComponents.Count() > 1)
{
continue;
}
else
{
items.Add(new Item
{
PartName = table.DisplayedText[rowIndex, partNoColumnIndex],
Quantity = int.Parse(table.DisplayedText[rowIndex, qtyColumnIndex]),
Quantity = qty,
Description = table.DisplayedText[rowIndex, descriptionColumnIndex],
ItemNo = table.DisplayedText[rowIndex, itemNoColumnIndex],
Component = distinctComponents.First()