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

View File

@ -36,8 +36,8 @@
<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>1</ApplicationRevision> <ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>7.3.0.1</ApplicationVersion> <ApplicationVersion>7.3.0.2</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -144,6 +144,8 @@ namespace ENI2.Excel
{ {
var range = _nameDict[lookup].RefersToRange; var range = _nameDict[lookup].RefersToRange;
range.Interior.Color = color; 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 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 public static class ExcelComparer
{ {
private static int diffColor = ColorTranslator.ToOle(Color.FromArgb(150, 150, 255)); // blue 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; if (!source.NameDict.ContainsKey(name)) continue;
string sourceText = source.ReadText(name); string sourceText = source.ReadText(name);
string targetText = comparison.ReadText(name); string targetText = comparison.ReadText(name);
if (sourceText == null) if (sourceText == null)
{ {
if (targetText != null) if (targetText != null)
{ {
comparison.Colorize(name, diffColor); comparison.Colorize(name, diffColor);
counter++; counter++;
} }
} }
if (targetText == null) else if (targetText == null)
{ {
if (sourceText != null) if (sourceText != null)
{ {
comparison.Colorize(name, diffColor); comparison.Colorize(name, diffColor);
counter++; counter++;
} }
} }
if ((sourceText != null) && (targetText != null)) else if ((sourceText != null) && (targetText != null))
{ {
if (!sourceText.Equals(targetText)) if (!sourceText.Equals(targetText))
{ {
// turn cell blue // turn cell blue
comparison.Colorize(name, diffColor); comparison.Colorize(name, diffColor);
counter++; counter++;
} }
} }
} }
comparison.Save(fileName); comparison.Save(fileName);
errorMessage = string.Format("{0} differences found", counter); errorMessage = string.Format("{0} differences found", counter);