Version 5.0.19

This commit is contained in:
Daniel Schick 2018-10-26 05:27:52 +00:00
parent f14c3391f6
commit d0c42ca6d9
13 changed files with 38 additions and 51 deletions

View File

@ -447,7 +447,7 @@ namespace ENI2.DetailViewControls
private void CheckBoxKielCanalPassagePlanned_Checked(object sender, RoutedEventArgs e) private void CheckBoxKielCanalPassagePlanned_Checked(object sender, RoutedEventArgs e)
{ {
this.dateTimePickerKielCanalPassagePlannedIncomming.IsEnabled = this.checkBoxKielCanalPassagePlanned.IsChecked ?? false; this.dateTimePickerKielCanalPassagePlannedIncomming.IsEnabled = this.checkBoxKielCanalPassagePlanned.IsChecked ?? false;
this.dateTimePickerKielCanalPassagePlannedOutgoing.IsEnabled = this.checkBoxKielCanalPassagePlanned.IsChecked ?? false; this.dateTimePickerKielCanalPassagePlannedOutgoing.IsEnabled = this.checkBoxKielCanalPassagePlanned.IsChecked ?? false;
} }
private void CheckBoxSECSimplification_Checked(object sender, RoutedEventArgs e) private void CheckBoxSECSimplification_Checked(object sender, RoutedEventArgs e)

View File

@ -36,7 +36,7 @@
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>1</ApplicationRevision> <ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>5.0.18.%2a</ApplicationVersion> <ApplicationVersion>5.0.19.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -36,7 +36,7 @@
<Label Name="labelAmountWasteDischarged" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textWasteAmountDischargedLastPort}" /> <Label Name="labelAmountWasteDischarged" Grid.Row="7" Grid.Column="0" Content="{x:Static p:Resources.textWasteAmountDischargedLastPort}" />
<ComboBox Name="comboBoxWasteCode" Grid.Row="0" Grid.Column="1" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" /> <ComboBox Name="comboBoxWasteCode" Grid.Row="0" Grid.Column="1" Margin="2" SelectedValuePath="Key" DisplayMemberPath="Value" />
<Label Name="labelWasteCodeText" Grid.Row="0" Grid.Column="2" /> <Label Name="labelWasteCodeText" Grid.Row="0" Grid.Column="2" />
<TextBox Name="textBoxDescription" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Width="auto" MaxLength="99" /> <TextBox Name="textBoxDescription" Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" Width="auto" MaxLength="99" TextWrapping="Wrap" />
<xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Name="doubleUpDownAmountDisposed" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/> <xctk:DoubleUpDown Grid.Row="2" Grid.Column="1" Name="doubleUpDownAmountDisposed" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>
<xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="doubleUpDownMaxCapacity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/> <xctk:DoubleUpDown Grid.Row="3" Grid.Column="1" Name="doubleUpDownMaxCapacity" ShowButtonSpinner="False" ParsingNumberStyle="Any" Margin="2" FormatString="N3" TextAlignment="Left"/>

Binary file not shown.

View File

@ -166,12 +166,10 @@ namespace bsmd.ExcelReadService
internal int? ReadCargoLACode(string lookup) internal int? ReadCargoLACode(string lookup)
{ {
int result;
string val = ReadText(lookup); string val = ReadText(lookup);
if (val.IsNullOrEmpty()) return null; if (val.IsNullOrEmpty()) return null;
if(int.TryParse(val, out result)) if(int.TryParse(val, out int result))
{ {
if ((result >= 10) && (result <= 99)) if ((result >= 10) && (result <= 99))
this.Conf.ConfirmText(lookup, val, ReadState.OK); this.Conf.ConfirmText(lookup, val, ReadState.OK);
@ -361,8 +359,7 @@ namespace bsmd.ExcelReadService
bool isValid = false; bool isValid = false;
if(!val.IsNullOrEmpty()) if(!val.IsNullOrEmpty())
{ {
int typeVal; if (int.TryParse(val, out int typeVal))
if(int.TryParse(val, out typeVal))
{ {
if ((typeVal >= 1) && (typeVal <= 23)) if ((typeVal >= 1) && (typeVal <= 23))
isValid = true; isValid = true;
@ -452,23 +449,21 @@ namespace bsmd.ExcelReadService
CultureInfo provider = CultureInfo.InvariantCulture; CultureInfo provider = CultureInfo.InvariantCulture;
string dateString = val.ToString(); string dateString = val.ToString();
string format = "yyyyMMdd"; string format = "yyyyMMdd";
DateTime tmpDate; if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out DateTime tmpDate))
if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out tmpDate))
date = tmpDate; date = tmpDate;
} }
} }
if (date == null) if (date == null)
{ {
DateTime tmpDate; if (DateTime.TryParse(val, out DateTime tmpDate))
if (DateTime.TryParse(val, out tmpDate))
date = tmpDate; date = tmpDate;
} }
// TODO: weitere varianten ausprobieren // TODO: weitere varianten ausprobieren
if (date != null) if (date != null)
{ {
if ((date.Value < new DateTime(1900, 1, 1)) || (date.Value > new DateTime(2030, 1, 1))) if ((date.Value < new DateTime(1899, 1, 1)) || (date.Value > new DateTime(2030, 1, 1)))
{ {
date = null; date = null;
this.Conf.ConfirmDate(lookup, date, noHighlight ? ReadState.NONE : ReadState.WARN); this.Conf.ConfirmDate(lookup, date, noHighlight ? ReadState.NONE : ReadState.WARN);
@ -543,8 +538,7 @@ namespace bsmd.ExcelReadService
if (!dateString.Contains(":")) if (!dateString.Contains(":"))
{ {
string format = "HHmm"; string format = "HHmm";
DateTime tmpDate; if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out DateTime tmpDate))
if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out tmpDate))
result = tmpDate; result = tmpDate;
} }
} }
@ -552,15 +546,13 @@ namespace bsmd.ExcelReadService
} }
if (result == null) if (result == null)
{ {
DateTime date; if (DateTime.TryParseExact(val, "HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out DateTime date))
if (DateTime.TryParseExact(val, "HH:mm:ss", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out date))
result = date; result = date;
} }
if (result == null) if (result == null)
{ {
DateTime date; if (DateTime.TryParseExact(val, "HH:mm", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out DateTime date))
if (DateTime.TryParseExact(val, "HH:mm", CultureInfo.InvariantCulture, DateTimeStyles.NoCurrentDateDefault, out date))
result = date; result = date;
} }
@ -570,9 +562,8 @@ namespace bsmd.ExcelReadService
string dateString = val.ToString(); string dateString = val.ToString();
if (!dateString.Contains(":")) if (!dateString.Contains(":"))
{ {
string format = "HHmm"; const string format = "HHmm";
DateTime tmpDate; if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out DateTime tmpDate))
if (DateTime.TryParseExact(dateString, format, provider, DateTimeStyles.None, out tmpDate))
result = tmpDate; result = tmpDate;
} }
} }
@ -607,9 +598,8 @@ namespace bsmd.ExcelReadService
if (val is double) result = val; if (val is double) result = val;
if (val is string) if (val is string)
{ {
double tmpDouble; if (double.TryParse(val, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite,
if (double.TryParse(val, NumberStyles.AllowDecimalPoint | NumberStyles.AllowLeadingWhite | NumberStyles.AllowTrailingWhite, CultureInfo.InvariantCulture, out double tmpDouble))
CultureInfo.InvariantCulture, out tmpDouble))
result = tmpDouble; result = tmpDouble;
if (result == null) if (result == null)
{ {

View File

@ -16,7 +16,7 @@ using bsmd.database;
namespace bsmd.ExcelReadService namespace bsmd.ExcelReadService
{ {
public class Util public static class Util
{ {
private static ILog _log = LogManager.GetLogger(typeof(Util)); private static ILog _log = LogManager.GetLogger(typeof(Util));
@ -543,8 +543,7 @@ namespace bsmd.ExcelReadService
else else
{ {
aReadState = ExcelReader.ReadState.OK; aReadState = ExcelReader.ReadState.OK;
double flashval = 0; if (double.TryParse(ibcPosition.Flashpoint_CEL, out double flashval))
if (double.TryParse(ibcPosition.Flashpoint_CEL, out flashval))
{ {
if (flashval > 60) ibcPosition.FlashpointInformation = 1; // GT60CEL if (flashval > 60) ibcPosition.FlashpointInformation = 1; // GT60CEL
else ibcPosition.FlashpointInformation = 2; // LE60CEL else ibcPosition.FlashpointInformation = 2; // LE60CEL
@ -686,8 +685,7 @@ namespace bsmd.ExcelReadService
if (marpolPosition.Flashpoint_CEL.IsNullOrEmpty()) { marpolPosition.FlashpointInformation = 0; } // NF // Ableitung Flashpoint-Info: Christin, 22.3.2017 if (marpolPosition.Flashpoint_CEL.IsNullOrEmpty()) { marpolPosition.FlashpointInformation = 0; } // NF // Ableitung Flashpoint-Info: Christin, 22.3.2017
else else
{ {
double flashval = 0; if (double.TryParse(marpolPosition.Flashpoint_CEL, out double flashval))
if (double.TryParse(marpolPosition.Flashpoint_CEL, out flashval))
{ {
if (flashval > 60) marpolPosition.FlashpointInformation = 1; // GT60CEL if (flashval > 60) marpolPosition.FlashpointInformation = 1; // GT60CEL
else marpolPosition.FlashpointInformation = 2; // LE60CEL else marpolPosition.FlashpointInformation = 2; // LE60CEL
@ -883,8 +881,7 @@ namespace bsmd.ExcelReadService
else else
{ {
aReadState = ExcelReader.ReadState.OK; aReadState = ExcelReader.ReadState.OK;
double flashval = 0; if (double.TryParse(ibcPosition.Flashpoint_CEL, out double flashval))
if (double.TryParse(ibcPosition.Flashpoint_CEL, out flashval))
{ {
if (flashval > 60) ibcPosition.FlashpointInformation = 1; // GT60CEL if (flashval > 60) ibcPosition.FlashpointInformation = 1; // GT60CEL
else ibcPosition.FlashpointInformation = 2; // LE60CEL else ibcPosition.FlashpointInformation = 2; // LE60CEL
@ -1026,8 +1023,7 @@ namespace bsmd.ExcelReadService
if (marpolPosition.Flashpoint_CEL.IsNullOrEmpty()) { marpolPosition.FlashpointInformation = 0; } // NF // Ableitung Flashpoint-Info: Christin, 22.3.2017 if (marpolPosition.Flashpoint_CEL.IsNullOrEmpty()) { marpolPosition.FlashpointInformation = 0; } // NF // Ableitung Flashpoint-Info: Christin, 22.3.2017
else else
{ {
double flashval = 0; if (double.TryParse(marpolPosition.Flashpoint_CEL, out double flashval))
if (double.TryParse(marpolPosition.Flashpoint_CEL, out flashval))
{ {
if (flashval > 60) marpolPosition.FlashpointInformation = 1; // GT60CEL if (flashval > 60) marpolPosition.FlashpointInformation = 1; // GT60CEL
else marpolPosition.FlashpointInformation = 2; // LE60CEL else marpolPosition.FlashpointInformation = 2; // LE60CEL
@ -1781,9 +1777,11 @@ namespace bsmd.ExcelReadService
bool? secKielDeparture = reader.ReadBoolean("SEC.KielCanalPassagePlanned_Departure"); bool? secKielDeparture = reader.ReadBoolean("SEC.KielCanalPassagePlanned_Departure");
sec.KielCanalPassagePlanned = (secKielArrival ?? false) || (secKielDeparture ?? false); sec.KielCanalPassagePlanned = (secKielArrival ?? false) || (secKielDeparture ?? false);
sec.KielCanalPassagePlannedIncomming = reader.ReadDateTime("SEC.ETADateKielCanalPassagePlannedIncomming", "SEC.ETATimeKielCanalPassagePlannedIncomming", !(secKielArrival ?? false)); if (sec.KielCanalPassagePlanned ?? false)
sec.KielCanalPassagePlannedOutgoing = reader.ReadDateTime("SEC.ETADateKielCanalPassagePlannedOutgoing", "SEC.ETATimeKielCanalPassagePlannedOutgoing", !(secKielDeparture ?? false)); {
sec.KielCanalPassagePlannedIncomming = reader.ReadDateTime("SEC.ETADateKielCanalPassagePlannedIncomming", "SEC.ETATimeKielCanalPassagePlannedIncomming", !(secKielArrival ?? false));
sec.KielCanalPassagePlannedOutgoing = reader.ReadDateTime("SEC.ETADateKielCanalPassagePlannedOutgoing", "SEC.ETATimeKielCanalPassagePlannedOutgoing", !(secKielDeparture ?? false));
}
// Last10PortFacilitesCalled // Last10PortFacilitesCalled
for (int i = 1; i <= 10; i++) for (int i = 1; i <= 10; i++)
@ -2678,7 +2676,7 @@ namespace bsmd.ExcelReadService
if (poc != null) if (poc != null)
{ {
// Prüfen auf Transit // Prüfen auf Transit
if (poc.ToUpper().Contains("CANAL") || poc.ToUpper().Equals("ZZNOK")) if (poc.IndexOf("CANAL", StringComparison.OrdinalIgnoreCase) >= 0 || poc.Equals("ZZNOK", StringComparison.OrdinalIgnoreCase))
{ {
reader.SetConfirmation(Properties.Settings.Default.ConfirmationDE); reader.SetConfirmation(Properties.Settings.Default.ConfirmationDE);
poc = "ZZNOK"; poc = "ZZNOK";

View File

@ -35,7 +35,7 @@ namespace bsmd.database
public DateTime? ETDFromPortOfCall { get; set; } public DateTime? ETDFromPortOfCall { get; set; }
[Validation1(ValidationCode.LIST_EMPTY)] [Validation1(ValidationCode.LIST_EMPTY)]
public ObservableCollection<DatabaseEntity> CallPurposes { get; private set; } = new ObservableCollection<DatabaseEntity>(); public ObservableCollection<DatabaseEntity> CallPurposes { get; } = new ObservableCollection<DatabaseEntity>();
[ShowReport] [ShowReport]
[Validation2(ValidationCode.NOT_NULL)] [Validation2(ValidationCode.NOT_NULL)]
@ -247,7 +247,7 @@ namespace bsmd.database
if((this.LastPort?.Equals("ZZUKN") == true) && this.ETDFromLastPort.HasValue) if((this.LastPort?.Equals("ZZUKN") == true) && this.ETDFromLastPort.HasValue)
errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE_ZZUKN, "ETDFromLastPort", null, this.Title, null, this.Tablename)); errors.Add(RuleEngine.CreateError(ValidationCode.IMPLAUSIBLE_ZZUKN, "ETDFromLastPort", null, this.Title, null, this.Tablename));
if (this.ETDFromPortOfCall.HasValue && this.ETAToNextPort.HasValue && !this.NextPort.Equals("ZZUKN") && if (this.ETDFromPortOfCall.HasValue && this.ETAToNextPort.HasValue && (this.NextPort?.Equals("ZZUKN") == false) &&
(this.ETAToNextPort <= ETDFromPortOfCall)) (this.ETAToNextPort <= ETDFromPortOfCall))
errors.Add(RuleEngine.CreateError(ValidationCode.E122, "ETAToNextPort", null, this.Title, null, this.Tablename)); errors.Add(RuleEngine.CreateError(ValidationCode.E122, "ETAToNextPort", null, this.Title, null, this.Tablename));
@ -314,8 +314,7 @@ namespace bsmd.database
noanod.NextPort = this.NextPort; noanod.NextPort = this.NextPort;
noanod.IsAnchored = this.IsAnchored; noanod.IsAnchored = this.IsAnchored;
noanod.id = null; noanod.id = null;
noanod.CallPurposes = new ObservableCollection<DatabaseEntity>();
foreach (CallPurpose cp in this.CallPurposes) foreach (CallPurpose cp in this.CallPurposes)
{ {

View File

@ -2,6 +2,6 @@
[assembly: AssemblyCompany("schick Informatik")] [assembly: AssemblyCompany("schick Informatik")]
[assembly: AssemblyProduct("BSMD NSW interface")] [assembly: AssemblyProduct("BSMD NSW interface")]
[assembly: AssemblyInformationalVersion("5.0.18")] [assembly: AssemblyInformationalVersion("5.0.20")]
[assembly: AssemblyCopyright("Copyright © 2014-2018 schick Informatik")] [assembly: AssemblyCopyright("Copyright © 2014-2018 schick Informatik")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

@ -1,4 +1,4 @@
using System.Reflection; using System.Reflection;
[assembly: AssemblyVersion("5.0.18.*")] [assembly: AssemblyVersion("5.0.20.*")]

View File

@ -206,7 +206,7 @@ namespace bsmd.database
} }
else else
{ {
scmd.Parameters.AddWithValue(@"ID", this.Id); scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("UPDATE {0} SET SECSimplification = @P2, PortOfCallWhereCompleteSECNotified = @P3, " + scmd.CommandText = string.Format("UPDATE {0} SET SECSimplification = @P2, PortOfCallWhereCompleteSECNotified = @P3, " +
"CSOLastName = @P4, CSOFirstName = @P5, CSOPhone = @P6," + "CSOLastName = @P4, CSOFirstName = @P5, CSOPhone = @P6," +
"CSOEMail = @P7, ValidISSCOnBoard = @P8, ReasonsForNoValidISSC = @P9, " + "CSOEMail = @P7, ValidISSCOnBoard = @P8, ReasonsForNoValidISSC = @P9, " +

View File

@ -17,9 +17,9 @@ namespace bsmd.database
{ {
public static class Util public static class Util
{ {
private static Regex regexVisit = new Regex("(DE)([A-Z]{3})-([0-9]{4})-([A-Z]{6})", RegexOptions.IgnoreCase); private static readonly Regex regexVisit = new Regex("^(DE)([A-Z]{3})-([0-9]{4})-([A-Z]{6})$", RegexOptions.IgnoreCase);
private static Regex regexTransit = new Regex("(ZZNOK)-([0-9]{4})-([A-Z]{6})", RegexOptions.IgnoreCase); private static readonly Regex regexTransit = new Regex("^(ZZNOK)-([0-9]{4})-([A-Z]{6})$", RegexOptions.IgnoreCase);
private static ILog _log = LogManager.GetLogger(typeof(Util)); private static readonly ILog _log = LogManager.GetLogger(typeof(Util));
/// <summary> /// <summary>
/// Extension helper to add values that can be null: /// Extension helper to add values that can be null:
@ -139,7 +139,7 @@ namespace bsmd.database
} }
bool isDE, isDK; bool isDE, isDK;
if((core != null) && (core.PoC != null)) if(core?.PoC != null)
{ {
isDE = core.PoC.Equals("ZZNOK") || core.PoC.StartsWith("DE"); isDE = core.PoC.Equals("ZZNOK") || core.PoC.StartsWith("DE");
isDK = core.PoC.StartsWith("DK"); isDK = core.PoC.StartsWith("DK");

View File

@ -88,7 +88,7 @@ namespace bsmd.database
public int? WasteType { get; set; } public int? WasteType { get; set; }
[ShowReport] [ShowReport]
[MaxLength(100)] [MaxLength(99)]
[ENI2Validation] [ENI2Validation]
public string WasteDescription { get; set; } public string WasteDescription { get; set; }
@ -184,7 +184,7 @@ namespace bsmd.database
} }
else else
{ {
scmd.Parameters.AddWithValue(@"ID", this.Id); scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("UPDATE {0} SET WasteType = @P2, WasteDescription = @P3, " + scmd.CommandText = string.Format("UPDATE {0} SET WasteType = @P2, WasteDescription = @P3, " +
"WasteDisposalAmount_MTQ = @P4, WasteCapacity_MTQ = @P5, WasteAmountRetained_MTQ = @P6," + "WasteDisposalAmount_MTQ = @P4, WasteCapacity_MTQ = @P5, WasteAmountRetained_MTQ = @P6," +
"WasteDisposalPort = @P7, WasteAmountGeneratedTillNextPort_MTQ = @P8, WasteDisposedAtLastPort_MTQ = @P9, " + "WasteDisposalPort = @P7, WasteAmountGeneratedTillNextPort_MTQ = @P8, WasteDisposedAtLastPort_MTQ = @P9, " +

Binary file not shown.