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