Version 5.1.6 mit verschiedenen kleineren Punkten

This commit is contained in:
Daniel Schick 2019-03-19 10:09:38 +00:00
parent 8e70a7ecde
commit 4767e19045
14 changed files with 60 additions and 22 deletions

View File

@ -78,7 +78,7 @@
<TextBox Name="textBoxTicketNo" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2" Text="{Binding TicketNo, Mode=TwoWay}" Margin="2" VerticalContentAlignment="Center" MaxLength="50"/> <TextBox Name="textBoxTicketNo" Grid.Column="1" Grid.Row="4" Grid.ColumnSpan="2" Text="{Binding TicketNo, Mode=TwoWay}" Margin="2" VerticalContentAlignment="Center" MaxLength="50"/>
<Label Grid.Column="0" Grid.Row="6" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelBSMDStatusInternal" Content="{Binding BSMDStatusInternal, StringFormat={}{0}}" VerticalContentAlignment="Center" FontWeight="Bold" /> <Label Grid.Column="0" Grid.Row="6" Margin="0,0,10,0" HorizontalContentAlignment="Right" Name="labelBSMDStatusInternal" Content="{Binding BSMDStatusInternal, StringFormat={}{0}}" VerticalContentAlignment="Center" FontWeight="Bold" />
<Button IsEnabled="True" Name="buttonStorno" Grid.Column="1" Grid.Row="6" Margin="2" Click="buttonStorno_Click" Content="{x:Static p:Resources.textCancelDeclaration}"/> <Button IsEnabled="True" Name="buttonStorno" Grid.Column="1" Grid.Row="6" Margin="2" Click="buttonStorno_Click" Content="{x:Static p:Resources.textCancelDeclaration}" Background="Red"/>
<Button IsEnabled="True" Name="buttonCopy" Grid.Column="2" Grid.Row="6" Margin="2" Click="buttonCopy_Click" Content="{x:Static p:Resources.textCopyData}"/> <Button IsEnabled="True" Name="buttonCopy" Grid.Column="2" Grid.Row="6" Margin="2" Click="buttonCopy_Click" Content="{x:Static p:Resources.textCopyData}"/>
<Button IsEnabled="False" Name="buttonSendPDF" Grid.Column="3" Grid.Row="6" Margin="2" Click="buttonSendPDF_Click" Content="{x:Static p:Resources.textCreatePDF}"/> <Button IsEnabled="False" Name="buttonSendPDF" Grid.Column="3" Grid.Row="6" Margin="2" Click="buttonSendPDF_Click" Content="{x:Static p:Resources.textCreatePDF}"/>
<Button Name="buttonQueryHIS" Grid.Column="4" Grid.Row="6" Margin="2" Click="buttonQueryHIS_Click" Content="{x:Static p:Resources.textQueryHIS}"/> <Button Name="buttonQueryHIS" Grid.Column="4" Grid.Row="6" Margin="2" Click="buttonQueryHIS_Click" Content="{x:Static p:Resources.textQueryHIS}"/>

View File

@ -63,6 +63,23 @@ namespace ENI2.DetailViewControls
private void buttonAddMissingEntries_Click(object sender, RoutedEventArgs e) private void buttonAddMissingEntries_Click(object sender, RoutedEventArgs e)
{ {
this._was.AddMissingWaste(); this._was.AddMissingWaste();
if(this._was.Waste.Count < 15)
{
Waste newWaste = new Waste
{
Identifier = DatabaseEntity.GetNewIdentifier(this._was.Waste),
WAS = this._was,
WasteAmountGeneratedTillNextPort_MTQ = 0,
WasteAmountRetained_MTQ = 0,
WasteCapacity_MTQ = 0,
WasteDescription = "",
WasteDisposalAmount_MTQ = 0,
WasteDisposalPort = "ZZUKN",
WasteDisposedAtLastPort_MTQ = 0
};
this._was.Waste.Add(newWaste);
}
this.SublistElementChanged(Message.NotificationClass.WAS); this.SublistElementChanged(Message.NotificationClass.WAS);
this.dataGridWaste.Items.Refresh(); this.dataGridWaste.Items.Refresh();
} }

View File

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

Binary file not shown.

View File

@ -70,7 +70,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 BunkerFuelType = @P2, BunkerFuelQuantity_TNE = @P3, Identifier = @P4 WHERE Id = @ID", this.Tablename); scmd.CommandText = string.Format("UPDATE {0} SET BunkerFuelType = @P2, BunkerFuelQuantity_TNE = @P3, Identifier = @P4 WHERE Id = @ID", this.Tablename);
} }
} }
@ -116,5 +116,17 @@ namespace bsmd.database
#endregion #endregion
#region Validation
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{
if(this.BunkerFuelQuantity_TNE.HasValue && this.BunkerFuelQuantity_TNE > 10000)
{
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Bunker quantity too high?", null, this.Title, this.Identifier, "BKRA"));
}
}
#endregion
} }
} }

View File

@ -60,7 +60,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 StowawaysOnBoard = @P2, CruiseShip = @P3 WHERE Id = @ID", this.Tablename); scmd.CommandText = string.Format("UPDATE {0} SET StowawaysOnBoard = @P2, CruiseShip = @P3 WHERE Id = @ID", this.Tablename);
} }
} }

View File

@ -70,7 +70,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 BunkerFuelType = @P2, BunkerFuelQuantity_TNE = @P3, Identifier = @P4 WHERE Id = @ID", this.Tablename); scmd.CommandText = string.Format("UPDATE {0} SET BunkerFuelType = @P2, BunkerFuelQuantity_TNE = @P3, Identifier = @P4 WHERE Id = @ID", this.Tablename);
} }
} }
@ -114,5 +114,17 @@ namespace bsmd.database
#endregion #endregion
#region Validation
public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{
if (this.BunkerFuelQuantity_TNE.HasValue && this.BunkerFuelQuantity_TNE > 10000)
{
violations.Add(RuleEngine.CreateViolation(ValidationCode.IMPLAUSIBLE, "Bunker quantity too high?", null, this.Title, this.Identifier, "BKRD"));
}
}
#endregion
} }
} }

View File

@ -23,7 +23,6 @@ namespace bsmd.database
private ObservableCollection<DatabaseEntity> igcPositions = new ObservableCollection<DatabaseEntity>(); private ObservableCollection<DatabaseEntity> igcPositions = new ObservableCollection<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> imsbcPositions = new ObservableCollection<DatabaseEntity>(); private ObservableCollection<DatabaseEntity> imsbcPositions = new ObservableCollection<DatabaseEntity>();
private ObservableCollection<DatabaseEntity> marpolPositions = new ObservableCollection<DatabaseEntity>(); private ObservableCollection<DatabaseEntity> marpolPositions = new ObservableCollection<DatabaseEntity>();
private bool _isDeparture;
#endregion #endregion
@ -85,10 +84,7 @@ namespace bsmd.database
// selektor HAZA / HAZD // selektor HAZA / HAZD
[ENI2Validation] [ENI2Validation]
public bool IsDeparture { public bool IsDeparture { get; set; }
get { return this._isDeparture; }
set { this._isDeparture = value; }
}
/// <summary> /// <summary>
/// No NSW field! Set to determine whether HAZ info should be reported to the NSW /// No NSW field! Set to determine whether HAZ info should be reported to the NSW
@ -122,7 +118,7 @@ namespace bsmd.database
{ {
get get
{ {
if (this._isDeparture) if (this.IsDeparture)
return "[dbo].[HAZD]"; return "[dbo].[HAZD]";
else else
return "[dbo].[HAZA]"; return "[dbo].[HAZA]";

View File

@ -57,6 +57,7 @@ namespace bsmd.database
#region Properties #region Properties
public HAZ HAZ { get; set; } public HAZ HAZ { get; set; }
[ShowReport] [ShowReport]
[Validation(ValidationCode.NOT_NULL)] [Validation(ValidationCode.NOT_NULL)]
[MaxLength(255)] [MaxLength(255)]
@ -74,7 +75,7 @@ namespace bsmd.database
{ {
get get
{ {
if (this.PollutionCategory.HasValue && (this.PollutionCategory.Value >= 0) && (this.PollutionCategory.Value < pollutionCategories.Length)) if (this.PollutionCategory.HasValue && (this.PollutionCategory.Value < pollutionCategories.Length))
return pollutionCategories[this.PollutionCategory.Value]; return pollutionCategories[this.PollutionCategory.Value];
return ""; return "";
} }
@ -89,7 +90,7 @@ namespace bsmd.database
{ {
get get
{ {
if (this.Hazards.HasValue && (this.Hazards.Value >= 0) && (this.Hazards.Value < hazards.Length)) if (this.Hazards.HasValue && (this.Hazards.Value < hazards.Length))
return hazards[this.Hazards.Value]; return hazards[this.Hazards.Value];
return ""; return "";
} }
@ -105,7 +106,7 @@ namespace bsmd.database
{ {
get get
{ {
if (this.FlashpointInformation.HasValue && (this.FlashpointInformation.Value >= 0) && (this.FlashpointInformation.Value < flashpointInformations.Length)) if (this.FlashpointInformation.HasValue && (this.FlashpointInformation.Value < flashpointInformations.Length))
return flashpointInformations[this.FlashpointInformation.Value]; return flashpointInformations[this.FlashpointInformation.Value];
return ""; return "";
} }
@ -186,7 +187,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 ProductName = @P2, PollutionCategory = @P3, Hazards = @P4, " + scmd.CommandText = string.Format("UPDATE {0} SET ProductName = @P2, PollutionCategory = @P3, Hazards = @P4, " +
"FlashpointInformation = @P5, Flashpoint_CEL = @P6, Quantity_KGM = @P7, StowagePosition = @P8, " + "FlashpointInformation = @P5, Flashpoint_CEL = @P6, Quantity_KGM = @P7, StowagePosition = @P8, " +
"PortOfLoading = @P9, PortOfDischarge = @P10, SpecRef15_19 = @P11, Remarks = @P12, Identifier = @P13 " + "PortOfLoading = @P9, PortOfDischarge = @P10, SpecRef15_19 = @P11, Remarks = @P12, Identifier = @P13 " +
@ -257,7 +258,7 @@ namespace bsmd.database
if(!this.Flashpoint_CEL.IsNullOrEmpty()) if(!this.Flashpoint_CEL.IsNullOrEmpty())
{ {
string pattern = @"^[<>]?\-?[0-9]+(\.[0-9]+)?$"; const string pattern = @"^[<>]?\-?[0-9]+(\.[0-9]+)?$";
Regex regex = new Regex(pattern); Regex regex = new Regex(pattern);
if(!regex.IsMatch(this.Flashpoint_CEL)) if(!regex.IsMatch(this.Flashpoint_CEL))

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.1.6")] [assembly: AssemblyInformationalVersion("5.1.7")]
[assembly: AssemblyCopyright("Copyright © 2014-2019 schick Informatik")] [assembly: AssemblyCopyright("Copyright © 2014-2019 schick Informatik")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

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

View File

@ -304,7 +304,7 @@ namespace bsmd.database
public override void Validate(List<MessageError> errors, List<MessageViolation> violations) public override void Validate(List<MessageError> errors, List<MessageViolation> violations)
{ {
if ((this.GrossTonnage.HasValue && (this.GrossTonnage.Value >= 500)) && (this.ISMCompanyName.IsNullOrEmpty() || this.ISMCompanyId.IsNullOrEmpty())) if (this.GrossTonnage.HasValue && (this.GrossTonnage.Value >= 500) && (this.ISMCompanyName.IsNullOrEmpty() || this.ISMCompanyId.IsNullOrEmpty()))
violations.Add(RuleEngine.CreateViolation(ValidationCode.V821, "ISMCompanyId/Name must be provided", null, this.Title, null, this.Tablename)); violations.Add(RuleEngine.CreateViolation(ValidationCode.V821, "ISMCompanyId/Name must be provided", null, this.Title, null, this.Tablename));
} }

View File

@ -58,7 +58,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 DraughtUponArrival_DMT = @P2 WHERE Id = @ID", this.Tablename); scmd.CommandText = string.Format("UPDATE {0} SET DraughtUponArrival_DMT = @P2 WHERE Id = @ID", this.Tablename);
} }
} }

View File

@ -59,7 +59,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 DraughtUponDeparture_DMT = @P2 WHERE Id = @ID", this.Tablename); scmd.CommandText = string.Format("UPDATE {0} SET DraughtUponDeparture_DMT = @P2 WHERE Id = @ID", this.Tablename);
} }
} }