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

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

View File

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

View File

@ -16,7 +16,7 @@ using bsmd.database;
namespace bsmd.ExcelReadService
{
public class Util
public static class Util
{
private static ILog _log = LogManager.GetLogger(typeof(Util));
@ -543,8 +543,7 @@ namespace bsmd.ExcelReadService
else
{
aReadState = ExcelReader.ReadState.OK;
double flashval = 0;
if (double.TryParse(ibcPosition.Flashpoint_CEL, out flashval))
if (double.TryParse(ibcPosition.Flashpoint_CEL, out double flashval))
{
if (flashval > 60) ibcPosition.FlashpointInformation = 1; // GT60CEL
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
else
{
double flashval = 0;
if (double.TryParse(marpolPosition.Flashpoint_CEL, out flashval))
if (double.TryParse(marpolPosition.Flashpoint_CEL, out double flashval))
{
if (flashval > 60) marpolPosition.FlashpointInformation = 1; // GT60CEL
else marpolPosition.FlashpointInformation = 2; // LE60CEL
@ -883,8 +881,7 @@ namespace bsmd.ExcelReadService
else
{
aReadState = ExcelReader.ReadState.OK;
double flashval = 0;
if (double.TryParse(ibcPosition.Flashpoint_CEL, out flashval))
if (double.TryParse(ibcPosition.Flashpoint_CEL, out double flashval))
{
if (flashval > 60) ibcPosition.FlashpointInformation = 1; // GT60CEL
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
else
{
double flashval = 0;
if (double.TryParse(marpolPosition.Flashpoint_CEL, out flashval))
if (double.TryParse(marpolPosition.Flashpoint_CEL, out double flashval))
{
if (flashval > 60) marpolPosition.FlashpointInformation = 1; // GT60CEL
else marpolPosition.FlashpointInformation = 2; // LE60CEL
@ -1781,9 +1777,11 @@ namespace bsmd.ExcelReadService
bool? secKielDeparture = reader.ReadBoolean("SEC.KielCanalPassagePlanned_Departure");
sec.KielCanalPassagePlanned = (secKielArrival ?? false) || (secKielDeparture ?? false);
if (sec.KielCanalPassagePlanned ?? false)
{
sec.KielCanalPassagePlannedIncomming = reader.ReadDateTime("SEC.ETADateKielCanalPassagePlannedIncomming", "SEC.ETATimeKielCanalPassagePlannedIncomming", !(secKielArrival ?? false));
sec.KielCanalPassagePlannedOutgoing = reader.ReadDateTime("SEC.ETADateKielCanalPassagePlannedOutgoing", "SEC.ETATimeKielCanalPassagePlannedOutgoing", !(secKielDeparture ?? false));
}
// Last10PortFacilitesCalled
for (int i = 1; i <= 10; i++)
@ -2678,7 +2676,7 @@ namespace bsmd.ExcelReadService
if (poc != null)
{
// 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);
poc = "ZZNOK";

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.