Testversion 7.9.0.2 mit Korrekturen

This commit is contained in:
Daniel Schick 2023-02-17 09:18:50 +01:00
parent 4d9b430cd3
commit bcf4c33478
4 changed files with 55 additions and 23 deletions

View File

@ -31,9 +31,9 @@
<ColumnDefinition Width="120" />
<ColumnDefinition Width="40" />
<ColumnDefinition Width="120" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="50" />
<ColumnDefinition Width="120" />
<ColumnDefinition Width="80" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="80" />
@ -46,7 +46,7 @@
<xctk:DateTimePicker x:Name="dateTimePickerTo" Margin="2" Grid.Column="3" Format="ShortDate" />
<Button x:Name="buttonLoad" Grid.Column="4" Content="Load" Margin="2" Click="buttonLoad_Click" />
<Button x:Name="buttonSave" Grid.Column="5" Content="Save" Margin="2" Click="buttonSave_Click" />
<Button x:Name="buttonRequestIds" Grid.Column="6" Content="Request Ids" Margin="2" Click="buttonRequestIds_Click" />
<Button x:Name="buttonRequestIds" Grid.Column="6" Content="Request marked Ids" Margin="2" Click="buttonRequestIds_Click" />
<Button x:Name="buttonRequestPlus3" Grid.Column="7" Content="Request +3" Margin="2" Click="buttonRequestIds_Click" />
<Button x:Name="buttonImport" Grid.Column="9" Margin="2" Content="Import" Click="buttonImport_Click" />
<Button x:Name="buttonExport" Grid.Column="10" Margin="2" Content="Export" Click="buttonExport_Click" />

View File

@ -244,6 +244,7 @@ namespace ENI2.Controls
{
List<MaerskData> importData = new List<MaerskData>();
uint emptyRowCnt = 0;
bool isFirstRow = true;
try
{
@ -271,7 +272,21 @@ namespace ENI2.Controls
throw new InvalidOperationException($"{md.ColI} found in import to {PortLocode}, this is probably an error. Aborting import");
}
if (!reader.IsDBNull(9)) md.ColJ = ReadFieldAsString(reader, 9);
if (!reader.IsDBNull(10)) { md.ETA = reader.GetDateTime(10); md.ColK = md.ETA.ToString(); }
if (!reader.IsDBNull(10)) {
if (reader.GetFieldType(10) == typeof(DateTime))
{
md.ETA = reader.GetDateTime(10);
}
else
{
if(isFirstRow)
{
isFirstRow = false; // this must be a header row, skip
continue;
}
}
md.ColK = md.ETA.ToString();
}
if (!reader.IsDBNull(11)) md.ColL = ReadFieldAsString(reader, 11);
if (!reader.IsDBNull(12)) md.ColM = ReadFieldAsString(reader, 12);
if (!reader.IsDBNull(13)) md.Remark = ReadFieldAsString(reader, 13);
@ -281,6 +296,7 @@ namespace ENI2.Controls
else
emptyRowCnt++;
if (emptyRowCnt > MAX_EMPTY_ROWS_ON_IMPORT) break;
if (isFirstRow) isFirstRow = false;
}
}
catch (Exception ex)
@ -298,7 +314,7 @@ namespace ENI2.Controls
{
if (this.maerskDataList.Contains(md))
{
MaerskData foundData = this.maerskDataList.First((m) => ((m.ColF != null) ? m.ColF.Equals(md.ColF) : false) && ((m.ColG != null) ? m.ColG.Equals(md.ColG) : false) && ((md.ColH != null) ? md.ColH.Equals(md.ColH) : false));
MaerskData foundData = this.maerskDataList.First((m) => (m.ColF != null) && m.ColF.Equals(md.ColF) && (m.ColG != null) && m.ColG.Equals(md.ColG) && (md.ColH != null) && md.ColH.Equals(md.ColH));
if (foundData.Update(md))
foundData.Status = MaerskData.MDStatus.UPDATED;
}

View File

@ -36,7 +36,7 @@
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationRevision>3</ApplicationRevision>
<ApplicationVersion>7.9.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>

View File

@ -22,25 +22,41 @@ namespace ENI2.Excel
Worksheet ws = wb.Worksheets[1];
// ExcelWorkSheet.Cells[r, c] = "R" + r + "C" + c;
// Überschriften erste Zeile
ws.Cells[1, 1] = "ETA";
ws.Cells[1, 2] = "ETD";
ws.Cells[1, 3] = "Rotation name";
ws.Cells[1, 4] = "Vessel code";
ws.Cells[1, 5] = "Vessel name";
ws.Cells[1, 6] = "IMO";
ws.Cells[1, 7] = "Arr voy";
ws.Cells[1, 8] = "Dep voy";
ws.Cells[1, 9] = "Terminal name";
ws.Cells[1, 10] = "Operator code";
ws.Cells[1, 11] = "Pro arr";
ws.Cells[1, 12] = "Pro dep";
ws.Cells[1, 13] = "ID";
ws.Cells[1, 14] = "Remark";
for (int i = 0; i < data.Count; i++)
{
MaerskData md = data[i];
ws.Cells[i + 1, 1] = md.ColA;
ws.Cells[i + 1, 2] = md.ColB;
ws.Cells[i + 1, 3] = md.ColC;
ws.Cells[i + 1, 4] = md.ColD;
ws.Cells[i + 1, 5] = md.ColE;
ws.Cells[i + 1, 6] = md.ColF;
ws.Cells[i + 1, 7] = md.ColG;
ws.Cells[i + 1, 8] = md.ColH;
ws.Cells[i + 1, 9] = md.ColI;
ws.Cells[i + 1, 10] = md.ColJ;
ws.Cells[i + 1, 11] = md.ColK;
ws.Cells[i + 1, 12] = md.ColL;
ws.Cells[i + 1, 13] = md.ColM ;
ws.Cells[i + 1, 14] = md.Remark;
ws.Cells[i + 2, 1].NumberFormat = "TT/hh:mm";
ws.Cells[i + 2, 1] = md.ColA;
ws.Cells[i + 2, 2].NumberFormat = "TT/hh:mm";
ws.Cells[i + 2, 2] = md.ColB;
ws.Cells[i + 2, 3] = md.ColC;
ws.Cells[i + 2, 4] = md.ColD;
ws.Cells[i + 2, 5] = md.ColE;
ws.Cells[i + 2, 6] = md.ColF;
ws.Cells[i + 2, 7] = md.ColG;
ws.Cells[i + 2, 8] = md.ColH;
ws.Cells[i + 2, 9] = md.ColI;
ws.Cells[i + 2, 10] = md.ColJ;
ws.Cells[i + 2, 11] = md.ColK;
ws.Cells[i + 2, 12] = md.ColL;
ws.Cells[i + 2, 13] = md.ColM ;
ws.Cells[i + 2, 14] = md.Remark;
}
wb.SaveAs(filename, XlFileFormat.xlOpenXMLWorkbook, Type.Missing, Type.Missing, Type.Missing,