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