Fixed exception thrown when qty is not a number.
This commit is contained in:
@@ -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()
|
||||||
|
|||||||
Reference in New Issue
Block a user