das ist alles gar nicht so einfach
This commit is contained in:
parent
ce5327821b
commit
98b2b0adba
@ -375,13 +375,14 @@ namespace ENI2.Controls
|
||||
List<MaerskData> importData = new List<MaerskData>();
|
||||
|
||||
bool isFirstRow = true;
|
||||
int currentRow = 1;
|
||||
int currentRow = 0;
|
||||
bool imosAreOkay = true;
|
||||
|
||||
try
|
||||
{
|
||||
while (reader.Read())
|
||||
{
|
||||
currentRow++;
|
||||
|
||||
if (isFirstRow)
|
||||
{
|
||||
@ -435,22 +436,30 @@ namespace ENI2.Controls
|
||||
{
|
||||
if (Int32.TryParse(md.ColF, out int imo))
|
||||
{
|
||||
if ((imo < 1000000) && (imo > 9999999))
|
||||
if ((imo < 1000000) || (imo > 9999999))
|
||||
{
|
||||
imosAreOkay = false;
|
||||
}
|
||||
}
|
||||
if(!imosAreOkay)
|
||||
else
|
||||
{
|
||||
imosAreOkay = false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
imosAreOkay = false;
|
||||
}
|
||||
|
||||
if (!imosAreOkay)
|
||||
{
|
||||
MessageBox.Show($"Invalid IMO in row {currentRow}, aborting import", Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
importData.Add(md);
|
||||
|
||||
if (isFirstRow) isFirstRow = false;
|
||||
currentRow++;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
|
||||
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
|
||||
<WebPage>publish.html</WebPage>
|
||||
<ApplicationRevision>5</ApplicationRevision>
|
||||
<ApplicationRevision>8</ApplicationRevision>
|
||||
<ApplicationVersion>7.10.0.%2a</ApplicationVersion>
|
||||
<UseApplicationTrust>false</UseApplicationTrust>
|
||||
<CreateDesktopShortcut>true</CreateDesktopShortcut>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user