fixes für Fehlermeldungen von Christin

This commit is contained in:
Daniel Schick 2022-06-19 16:34:21 +02:00
parent c3a7737975
commit 05d378536e
4 changed files with 24 additions and 19 deletions

View File

@ -222,8 +222,7 @@ namespace ENI2.DetailViewControls
target_haz.MARPOLPositions.Add(copyMARPOL);
target_haz.NoDPGOnBoardOnArrival = false;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
this.SetHAZGlobalFlags();
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
}
}
}
@ -244,8 +243,7 @@ namespace ENI2.DetailViewControls
target_haz.IMSBCPositions.Add(copyIMSBC);
target_haz.NoDPGOnBoardOnArrival = false;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
this.SetHAZGlobalFlags();
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
}
}
}
@ -266,8 +264,7 @@ namespace ENI2.DetailViewControls
target_haz.IMDGPositions.Add(copyIMDG);
target_haz.NoDPGOnBoardOnArrival = false;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
this.SetHAZGlobalFlags();
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
}
}
}
@ -288,8 +285,7 @@ namespace ENI2.DetailViewControls
target_haz.IGCPositions.Add(copyIGC);
target_haz.NoDPGOnBoardOnArrival = false;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
this.SetHAZGlobalFlags();
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
}
}
}
@ -312,8 +308,7 @@ namespace ENI2.DetailViewControls
target_haz.IBCPositions.Add(copyIBC);
target_haz.NoDPGOnBoardOnArrival = false;
this.SublistElementChanged(this.IsDeparture ? Message.NotificationClass.HAZA : Message.NotificationClass.HAZD);
this.OnControlCacheReset(Properties.Resources.textDGDeparture);
this.SetHAZGlobalFlags();
this.OnControlCacheReset(this.IsDeparture ? Properties.Resources.textDGArrival : Properties.Resources.textDGDeparture);
}
}
}
@ -327,6 +322,7 @@ namespace ENI2.DetailViewControls
void SetHAZGlobalFlags()
{
HAZ haz = this.IsDeparture ? this.hazd : this.haza;
int totalCount = haz.MARPOLPositions.Count + haz.IMDGPositions.Count + haz.IGCPositions.Count + haz.IBCPositions.Count + haz.IMSBCPositions.Count;
if(totalCount == 1)
{

View File

@ -36,8 +36,8 @@
<MinimumRequiredVersion>5.4.0.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage>
<ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>7.3.0.1</ApplicationVersion>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>7.3.0.2</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -144,6 +144,8 @@ namespace ENI2.Excel
{
var range = _nameDict[lookup].RefersToRange;
range.Interior.Color = color;
// range.Worksheet.Tab.ColorIndex = XlColorIndex.xlColorIndexAutomatic;
range.Worksheet.Tab.Color = color;
}
}

View File

@ -12,6 +12,12 @@ using System.Drawing;
namespace ENI2.Excel
{
/// <summary>
/// Diese Klasse beinhaltet den von Anmeldungen unabhängigen Vergleich von Excel Sheets. Damit
/// können dann Updates von "außen" einfacher abgearbeitet werden. Zellen und sheets werden bei
/// Aktualisierung bunt eingefärbt
/// </summary>
public static class ExcelComparer
{
private static int diffColor = ColorTranslator.ToOle(Color.FromArgb(150, 150, 255)); // blue
@ -33,32 +39,33 @@ namespace ENI2.Excel
{
if (!source.NameDict.ContainsKey(name)) continue;
string sourceText = source.ReadText(name);
string targetText = comparison.ReadText(name);
string targetText = comparison.ReadText(name);
if (sourceText == null)
{
if (targetText != null)
{
comparison.Colorize(name, diffColor);
comparison.Colorize(name, diffColor);
counter++;
}
}
if (targetText == null)
else if (targetText == null)
{
if (sourceText != null)
{
comparison.Colorize(name, diffColor);
comparison.Colorize(name, diffColor);
counter++;
}
}
if ((sourceText != null) && (targetText != null))
else if ((sourceText != null) && (targetText != null))
{
if (!sourceText.Equals(targetText))
{
// turn cell blue
comparison.Colorize(name, diffColor);
comparison.Colorize(name, diffColor);
counter++;
}
}
}
}
comparison.Save(fileName);
errorMessage = string.Format("{0} differences found", counter);