Version 3.9.0: Verdopplungsfehler, allerlei andere kleine Bugs, l10p Import ergänzt

This commit is contained in:
Daniel Schick 2017-12-04 18:18:22 +00:00
parent 7be0296cba
commit f6caab44f8
68 changed files with 478 additions and 154 deletions

View File

@ -80,13 +80,15 @@ namespace ENI2
// Preload validation fields // Preload validation fields
List<ValidationField> vFields = bsmd.database.ValidationRule.ValidationFields; List<ValidationField> vFields = bsmd.database.ValidationRule.ValidationFields;
RuleEngine.RegisterLocodeChecker(bsmd.ExcelReadService.LocodeDB.IsValidLocode); RuleEngine.RegisterLocodeChecker(Util.GlobalStructures.IsValidLocode);
// Connect to locking service (if enabled) // Connect to locking service (if enabled)
try try
{ {
if (ENI2.Properties.Settings.Default.UseLocking) if (ENI2.Properties.Settings.Default.UseLocking)
App._lockingServiceClient = new ServiceClient("BasicHttpBinding_IService", ENI2.Properties.Settings.Default.LockingServerAddress); {
App._lockingServiceClient = new ServiceClient("BasicHttpBinding_IService", ENI2.Properties.Settings.Default.LockingServerAddress);
}
} }
catch (Exception ex) catch (Exception ex)
{ {

View File

@ -369,7 +369,8 @@ namespace ENI2
private void DetailControl_RequestSendValidation() private void DetailControl_RequestSendValidation()
{ {
this.Validate(false); this.Validate(false);
foreach(Message aMessage in this._messages) foreach(Message aMessage in this._messages)
{ {
if(aMessage.InternalStatus == Message.BSMDStatus.TOSEND) if(aMessage.InternalStatus == Message.BSMDStatus.TOSEND)
@ -387,6 +388,56 @@ namespace ENI2
} }
} }
} }
// NOA_NOD vor ATA vor ATD Versendereihenfolge sicherstellen
bool noa_nod_queued_or_sent = false;
bool ata_queued_or_sent = false;
foreach(Message aMessage in this._messages)
{
if(aMessage.MessageNotificationClass == Message.NotificationClass.NOA_NOD)
{
if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
noa_nod_queued_or_sent = true;
}
if (aMessage.MessageNotificationClass == Message.NotificationClass.ATA)
{
if ((aMessage.SendSuccess ?? false) || (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
ata_queued_or_sent = true;
}
}
foreach(Message aMessage in this._messages)
{
if((aMessage.MessageNotificationClass == Message.NotificationClass.ATA) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
{
if(!noa_nod_queued_or_sent)
{
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
aMessage.ChangedBy = "";
aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATA");
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
}
}
if ((aMessage.MessageNotificationClass == Message.NotificationClass.ATD) && (aMessage.InternalStatus == Message.BSMDStatus.TOSEND))
{
if (!noa_nod_queued_or_sent)
{
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
aMessage.ChangedBy = "";
aMessage.StatusInfo = string.Format("Validation error: NOA_NOD must be sent before ATD");
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
}
if(!ata_queued_or_sent)
{
aMessage.InternalStatus = Message.BSMDStatus.SUSPENDED;
aMessage.ChangedBy = "";
aMessage.StatusInfo = string.Format("Validation error: ATA must be sent before ATD");
DBManager.GetSingleCon(Properties.Settings.Default.ConnectionString).Save(aMessage);
}
}
}
} }
private void DetailControl_RequestValidate() private void DetailControl_RequestValidate()

View File

@ -84,7 +84,7 @@ namespace ENI2.DetailViewControls
vtBinding.Source = this.Core; vtBinding.Source = this.Core;
vtBinding.Path = this.Core.IsTransit ? new PropertyPath("TransitId") : new PropertyPath("VisitId"); vtBinding.Path = this.Core.IsTransit ? new PropertyPath("TransitId") : new PropertyPath("VisitId");
vtBinding.Mode = BindingMode.TwoWay; vtBinding.Mode = BindingMode.TwoWay;
vtBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged; vtBinding.UpdateSourceTrigger = UpdateSourceTrigger.PropertyChanged;
BindingOperations.SetBinding(textBoxDisplayId, TextBox.TextProperty, vtBinding); BindingOperations.SetBinding(textBoxDisplayId, TextBox.TextProperty, vtBinding);
if (this.Core.Cancelled ?? false) this.ShowCancelledLabel(); if (this.Core.Cancelled ?? false) this.ShowCancelledLabel();
@ -379,9 +379,13 @@ namespace ENI2.DetailViewControls
{ {
this.textBoxDisplayId.DataContext = null; this.textBoxDisplayId.DataContext = null;
this.textBoxDisplayId.DataContext = this.Core; this.textBoxDisplayId.DataContext = this.Core;
this.textBoxDisplayId.GetBindingExpression(TextBox.TextProperty)?.UpdateTarget();
this.labelBSMDStatusInternal.DataContext = null; this.labelBSMDStatusInternal.DataContext = null;
this.labelBSMDStatusInternal.DataContext = this.Core; this.labelBSMDStatusInternal.DataContext = this.Core;
MessageBox.Show("Visit/Transit ID updated!"); this.labelBSMDStatusInternal.GetBindingExpression(Label.ContentProperty)?.UpdateTarget();
MessageBox.Show(string.Format("Visit/Transit ID updated: {0}", this.Core.DisplayId));
} }
#endregion #endregion

View File

@ -92,7 +92,13 @@
</GroupBox> </GroupBox>
</TabItem> </TabItem>
<TabItem Header="{x:Static p:Resources.textLast10PortFacilities}" Name="tabLast10PortFacilites"> <TabItem Header="{x:Static p:Resources.textLast10PortFacilities}" Name="tabLast10PortFacilites">
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridLast10PortFacilities" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <Grid>
<Grid.RowDefinitions>
<RowDefinition Height="28" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Button Name="buttonImportExcel" Grid.Row="0" Grid.Column="0" Content="{x:Static p:Resources.textImportFromExcel}" Margin="2" Width="120" HorizontalAlignment="Left" VerticalAlignment="Center" Background="Transparent" Click="buttonImportExcel_Click" />
<enictrl:ENIDataGrid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridLast10PortFacilities" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
AutoGenerateColumns="False" Margin="0,5,0,0"> AutoGenerateColumns="False" Margin="0,5,0,0">
<DataGrid.Columns> <DataGrid.Columns>
<DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" /> <DataGridTextColumn Header="" Binding="{Binding Identifier}" IsReadOnly="True" />
@ -117,6 +123,7 @@
<DataGridTextColumn Header="{x:Static p:Resources.textSecurityMatters}" Binding="{Binding PortFacilitySecurityMattersToReport}" IsReadOnly="True" Width="0.2*" /> <DataGridTextColumn Header="{x:Static p:Resources.textSecurityMatters}" Binding="{Binding PortFacilitySecurityMattersToReport}" IsReadOnly="True" Width="0.2*" />
</DataGrid.Columns> </DataGrid.Columns>
</enictrl:ENIDataGrid> </enictrl:ENIDataGrid>
</Grid>
</TabItem> </TabItem>
<TabItem Header="{x:Static p:Resources.textShipToShip}" Name="tabShipToShip"> <TabItem Header="{x:Static p:Resources.textShipToShip}" Name="tabShipToShip">
<enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridShip2ShipActivities" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" <enictrl:ENIDataGrid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2" x:Name="dataGridShip2ShipActivities" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"

View File

@ -10,6 +10,10 @@ using bsmd.database;
using System.Windows.Data; using System.Windows.Data;
using System; using System;
using Microsoft.Win32;
using System.IO;
using ExcelDataReader;
using System.Collections.Generic;
namespace ENI2.DetailViewControls namespace ENI2.DetailViewControls
{ {
@ -297,6 +301,89 @@ namespace ENI2.DetailViewControls
#endregion #endregion
#region Excel import last 10 port facilities
private void buttonImportExcel_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
ofd.Filter = "Excel Files|*.xls;*.xlsx";
if (ofd.ShowDialog() ?? false)
{
FileStream stream = null;
try
{
stream = File.Open(ofd.FileName, FileMode.Open, FileAccess.Read);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error);
return;
}
using (var reader = ExcelReaderFactory.CreateReader(stream))
{
List<LastTenPortFacilitiesCalled> importL10C = new List<LastTenPortFacilitiesCalled>();
try
{
do
{
int cnt = 0;
while (reader.Read() && (cnt < 10))
{
if (((IExcelDataReader)reader).FieldCount < 8)
{
throw new InvalidDataException("Sheet must have 8 Columns of data");
}
LastTenPortFacilitiesCalled l10c = new LastTenPortFacilitiesCalled();
if (reader.IsDBNull(0) && reader.IsDBNull(1)) continue;
if (!reader.IsDBNull(0)) l10c.PortFacilityPortName = reader.GetString(0);
if (!reader.IsDBNull(2)) l10c.PortFacilityPortCountry = reader.GetString(2);
if (!reader.IsDBNull(3)) l10c.PortFacilityPortLoCode = reader.GetString(3);
object o = null;
if (!reader.IsDBNull(4)) o = reader.GetValue(4);
if(o != null) l10c.PortFacilityDateOfArrival = Convert.ToDateTime(o);
if (!reader.IsDBNull(5)) o = reader.GetValue(5);
if (o != null) l10c.PortFacilityDateOfDeparture = Convert.ToDateTime(o);
// if (!reader.IsDBNull(4)) l10c.PortFacilityDateOfArrival = reader.GetDateTime(4);
// if (!reader.IsDBNull(5)) l10c.PortFacilityDateOfDeparture = reader.GetDateTime(5);
if (!reader.IsDBNull(6)) o = reader.GetValue(6);
if (o != null) l10c.PortFacilityShipSecurityLevel = Convert.ToByte(o);
if (!reader.IsDBNull(7)) o = reader.GetValue(7);
int gisis = Convert.ToInt32(o);
if (!reader.IsDBNull(7)) l10c.PortFacilityGISISCode = gisis.ToString().PadLeft(4, '0');
if (!reader.IsDBNull(8)) l10c.PortFacilitySecurityMattersToReport = reader.GetString(8);
if (l10c.PortFacilitySecurityMattersToReport.Equals("nil", StringComparison.CurrentCultureIgnoreCase))
l10c.PortFacilitySecurityMattersToReport = null;
l10c.SEC = this._sec;
l10c.IsDirty = true;
l10c.Identifier = LastTenPortFacilitiesCalled.GetNewIdentifier(this._sec.LastTenPortFacilitesCalled);
this._sec.LastTenPortFacilitesCalled.Add(l10c);
importL10C.Add(l10c);
cnt++;
}
} while (reader.NextResult());
}
catch (Exception ex)
{
MessageBox.Show("Error reading Excel: " + ex.Message, Properties.Resources.textCaptionError, MessageBoxButton.OK, MessageBoxImage.Error);
}
if (importL10C.Count > 0)
{
this.dataGridLast10PortFacilities.Items.Refresh();
this.SublistElementChanged(Message.NotificationClass.SEC);
MessageBox.Show(String.Format(Properties.Resources.textL10PImported, importL10C.Count), Properties.Resources.textCaptionInformation, MessageBoxButton.OK, MessageBoxImage.Information);
}
}
stream.Close();
}
}
#endregion
#region enable / disable controls #region enable / disable controls
private void CheckBoxKielCanalPassagePlanned_Checked(object sender, RoutedEventArgs e) private void CheckBoxKielCanalPassagePlanned_Checked(object sender, RoutedEventArgs e)
@ -351,6 +438,6 @@ namespace ENI2.DetailViewControls
} }
#endregion #endregion
} }
} }

View File

@ -35,8 +35,8 @@
<MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion> <MinimumRequiredVersion>3.5.1.0</MinimumRequiredVersion>
<CreateWebPageOnPublish>true</CreateWebPageOnPublish> <CreateWebPageOnPublish>true</CreateWebPageOnPublish>
<WebPage>publish.html</WebPage> <WebPage>publish.html</WebPage>
<ApplicationRevision>2</ApplicationRevision> <ApplicationRevision>1</ApplicationRevision>
<ApplicationVersion>3.8.11.%2a</ApplicationVersion> <ApplicationVersion>3.9.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust> <UseApplicationTrust>false</UseApplicationTrust>
<CreateDesktopShortcut>true</CreateDesktopShortcut> <CreateDesktopShortcut>true</CreateDesktopShortcut>
<PublishWizardCompleted>true</PublishWizardCompleted> <PublishWizardCompleted>true</PublishWizardCompleted>

View File

@ -65,7 +65,7 @@ namespace ENI2
public static Dictionary<string, string> getNationalities() public static Dictionary<string, string> getNationalities()
{ {
Dictionary<string, string> result = new Dictionary<string, string>(); Dictionary<string, string> result = new Dictionary<string, string>();
string query = string.Format("SELECT Code, Name FROM Nationality"); string query = string.Format("SELECT Code, Name FROM Nationality ORDER BY Code");
SQLiteCommand cmd = new SQLiteCommand(query, _con); SQLiteCommand cmd = new SQLiteCommand(query, _con);
IDataReader reader = cmd.ExecuteReader(); IDataReader reader = cmd.ExecuteReader();
while(reader.Read()) while(reader.Read())

View File

@ -2426,6 +2426,15 @@ namespace ENI2.Properties {
} }
} }
/// <summary>
/// Looks up a localized string similar to {0} ports visited imported.
/// </summary>
public static string textL10PImported {
get {
return ResourceManager.GetString("textL10PImported", resourceCulture);
}
}
/// <summary> /// <summary>
/// Looks up a localized string similar to LA Code. /// Looks up a localized string similar to LA Code.
/// </summary> /// </summary>

View File

@ -1594,4 +1594,7 @@
<data name="textValidationOK" xml:space="preserve"> <data name="textValidationOK" xml:space="preserve">
<value>No errors or violations detected</value> <value>No errors or violations detected</value>
</data> </data>
<data name="textL10PImported" xml:space="preserve">
<value>{0} ports visited imported</value>
</data>
</root> </root>

View File

@ -49,7 +49,7 @@ namespace ENI2.Util
if(entity.IsTransit) if(entity.IsTransit)
{ {
if (!entity.TransitId.Equals(watchedEntity.TransitId)) if ((!watchedEntity.TransitId.IsNullOrEmpty()) && !entity.TransitId.Equals(watchedEntity.TransitId))
{ {
OnVisitTransitIdUpdated(entity); OnVisitTransitIdUpdated(entity);
watchedEntity.TransitId = entity.TransitId; watchedEntity.TransitId = entity.TransitId;
@ -57,7 +57,7 @@ namespace ENI2.Util
} }
else else
{ {
if (!entity.VisitId.Equals(watchedEntity.VisitId)) if ((!watchedEntity.VisitId.IsNullOrEmpty()) && !entity.VisitId.Equals(watchedEntity.VisitId))
{ {
OnVisitTransitIdUpdated(entity); OnVisitTransitIdUpdated(entity);
watchedEntity.VisitId = entity.VisitId; watchedEntity.VisitId = entity.VisitId;

View File

@ -7,6 +7,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Data; using System.Windows.Data;
using bsmd.ExcelReadService;
namespace ENI2.Util namespace ENI2.Util
{ {
@ -196,5 +197,19 @@ namespace ENI2.Util
return true; return true;
return false; return false;
} }
public static bool IsValidLocode(string locode, RuleEngine.LocodeMode mode)
{
switch (mode)
{
case RuleEngine.LocodeMode.NO_PORT_FLAG:
return !LocodeDB.LocationNameFromLocode(locode).IsNullOrEmpty();
case RuleEngine.LocodeMode.SSN:
return !LocalizedLookup.SSNPortNameFromLocode(locode).IsNullOrEmpty();
default:
return !LocodeDB.PortNameFromLocode(locode).IsNullOrEmpty();
}
}
} }
} }

Binary file not shown.

Binary file not shown.

View File

@ -159,6 +159,10 @@ namespace SendNSWMessageService
} }
} }
// nach NotificationClass sortieren
// das ist wichtig für 861,881,882: NOA_NOD vor ATA vor ATD, falls alles gleichzeitig gesendet wird.
toSendMessageList.Sort();
foreach (Message message in toSendMessageList) foreach (Message message in toSendMessageList)
{ {
try try
@ -481,13 +485,13 @@ namespace SendNSWMessageService
} }
bsmd.hisnord.transmitter.CallTransmitter(true); bsmd.hisnord.transmitter.CallTransmitter(true);
// bsmd.hisnord.transmitter.CallTransmitter(false); // wird aktuell nicht funktionieren bsmd.hisnord.transmitter.CallTransmitter(false); // wird aktuell nicht funktionieren
// ob test oder nicht ist in stat. dict gespeicher // ob test oder nicht ist in stat. dict gespeicher
bsmd.hisnord.Request.ReadResponseFiles(); bsmd.hisnord.Request.ReadResponseFiles();
bsmd.hisnord.Response.ReadAnswers(true); bsmd.hisnord.Response.ReadAnswers(true);
// bsmd.hisnord.Response.ReadAnswers(false); bsmd.hisnord.Response.ReadAnswers(false);
List<MessageCore> coresMarkedForStatusQuery = DBManager.Instance.GetMessageCoresWithNSWStatusFlag(); List<MessageCore> coresMarkedForStatusQuery = DBManager.Instance.GetMessageCoresWithNSWStatusFlag();

View File

@ -12,7 +12,6 @@ using System.Collections.Generic;
using System.Data; using System.Data;
using System.Data.SQLite; using System.Data.SQLite;
using bsmd.database; using bsmd.database;
using ENI2;
namespace bsmd.ExcelReadService namespace bsmd.ExcelReadService
{ {
@ -56,20 +55,7 @@ namespace bsmd.ExcelReadService
if (result != null) if (result != null)
result = string.Format("{0}{1}", country, result); result = string.Format("{0}{1}", country, result);
return result; return result;
} }
public static bool IsValidLocode(string locode, RuleEngine.LocodeMode mode)
{
switch(mode)
{
case RuleEngine.LocodeMode.NO_PORT_FLAG:
return !LocodeDB.LocationNameFromLocode(locode).IsNullOrEmpty();
case RuleEngine.LocodeMode.SSN:
return !LocalizedLookup.SSNPortNameFromLocode(locode).IsNullOrEmpty();
default:
return !LocodeDB.PortNameFromLocode(locode).IsNullOrEmpty();
}
}
public static List<string> AllLocodesForCityName(string city) public static List<string> AllLocodesForCityName(string city)

View File

@ -1152,28 +1152,12 @@ namespace bsmd.ExcelReadService
reader.Conf.ConfirmText("NOA_NOD.LastPort", lastPort, noa_nod.LastPort.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK); reader.Conf.ConfirmText("NOA_NOD.LastPort", lastPort, noa_nod.LastPort.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);
string nextPort = reader.ReadText("NOA_NOD.NextPort"); string nextPort = reader.ReadText("NOA_NOD.NextPort");
if (!nextPort.IsNullOrEmpty()) nextPort = nextPort.Trim(); if (!nextPort.IsNullOrEmpty())
if (nextPort != null)
{ {
if (LocodeDB.PortNameFromLocode(nextPort) != null) noa_nod.NextPort = nextPort.Trim();
{ if (noa_nod.NextPort.Length > 5)
noa_nod.NextPort = nextPort; noa_nod.NextPort = noa_nod.NextPort.Substring(0, 5); //trunc
} }
else
{
List<string> nextPorts = LocodeDB.AllLocodesForCityName(nextPort);
if (nextPorts.Count == 1)
noa_nod.NextPort = nextPorts[0];
else
{
if (nextPort.Equals("ZZUKN", StringComparison.OrdinalIgnoreCase))
noa_nod.NextPort = nextPort;
else
_log.WarnFormat("{0} results in {1} possible LOCODES", nextPort, nextPorts.Count);
}
}
}
reader.Conf.ConfirmText("NOA_NOD.NextPort", nextPort, noa_nod.NextPort.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK); reader.Conf.ConfirmText("NOA_NOD.NextPort", nextPort, noa_nod.NextPort.IsNullOrEmpty() ? ExcelReader.ReadState.WARN : ExcelReader.ReadState.OK);

22
nsw/Source/bsmd.Tool.sln Normal file
View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25123.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "bsmd.Tool", "bsmd.Tool\bsmd.Tool.csproj", "{5F5E65EE-9351-4F30-817A-9C6C6D6835AE}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5F5E65EE-9351-4F30-817A-9C6C6D6835AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5F5E65EE-9351-4F30-817A-9C6C6D6835AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5F5E65EE-9351-4F30-817A-9C6C6D6835AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5F5E65EE-9351-4F30-817A-9C6C6D6835AE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1,11 +1,29 @@
<?xml version="1.0" encoding="utf-8" ?> <?xml version="1.0" encoding="utf-8" ?>
<configuration> <configuration>
<configSections> <configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,Log4net"/>
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" > <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
<section name="bsmd.Tool.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" /> <section name="bsmd.Tool.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
</sectionGroup> </sectionGroup>
</configSections> </configSections>
<startup> <log4net>
<root>
<level value="DEBUG" />
<appender-ref ref="LogFileAppender" />
</root>
<appender name="LogFileAppender" type="log4net.Appender.RollingFileAppender" >
<param name="File" value="log.bsmd.Tool.txt" />
<param name="AppendToFile" value="true" />
<rollingStyle value="Size" />
<maxSizeRollBackups value="10" />
<maximumFileSize value="10MB" />
<staticLogFileName value="true" />
<layout type="log4net.Layout.PatternLayout">
<param name="ConversionPattern" value="%date [%thread] %-5level [%logger] - %message%newline" />
</layout>
</appender>
</log4net>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" /> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup> </startup>
<userSettings> <userSettings>

View File

@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;
namespace bsmd.Tool
{
class CleanupFiles
{
/// <summary>
/// Alle XML Dateien in einem Dateipfad(rootPath) (recursive) löschen, die älter als (staleDays) Tage sind
/// </summary>
/// <param name="rootPath"></param>
/// <param name="staleDays"></param>
/// <param name="recursive"></param>
public static void Cleanup(string rootPath, int staleDays, bool recursive)
{
if (!Directory.Exists(rootPath)) throw new ArgumentException("directory does not exist");
foreach (string file in Directory.GetFiles(rootPath, "*.xml"))
{
double age = (DateTime.Now - File.GetCreationTime(file)).TotalDays;
if (age > staleDays)
{
Console.WriteLine(file + " - " + age.ToString());
File.Delete(file);
}
}
if(recursive)
{
foreach (string directory in Directory.GetDirectories(rootPath))
Cleanup(directory, staleDays, recursive);
}
}
}
}

View File

@ -25,6 +25,15 @@ namespace bsmd.Tool
[Option('r', "checkrules", MutuallyExclusiveSet = "command", HelpText = "Use rule engine on message core")] [Option('r', "checkrules", MutuallyExclusiveSet = "command", HelpText = "Use rule engine on message core")]
public bool CheckRules { get; set; } public bool CheckRules { get; set; }
[Option('s', "staledays", DefaultValue = 30, HelpText ="Delete files older than X days")]
public int StaleDays { get; set; }
[Option('p', "path", HelpText ="Path to cleanup root folder")]
public string CleanupFolderRoot { get; set; }
[Option('x', "recursive", DefaultValue = false, HelpText ="Cleanup subdirectories recursively")]
public bool CleanupRecursive { get; set; }
[ParserState] [ParserState]
public IParserState LastParserState { get; set; } public IParserState LastParserState { get; set; }

View File

@ -32,9 +32,13 @@ namespace bsmd.Tool
log.FatalFormat("CheckRules: cannot parse message core id"); log.FatalFormat("CheckRules: cannot parse message core id");
} }
} }
else if((options.CleanupFolderRoot != null) && (options.CleanupFolderRoot.Length > 0))
{
CleanupFiles.Cleanup(options.CleanupFolderRoot, options.StaleDays, options.CleanupRecursive);
}
else else
{ {
// .. anderes
} }
return 0; return 0;
} }

View File

@ -41,8 +41,8 @@
<Reference Include="CommandLine"> <Reference Include="CommandLine">
<HintPath>..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath> <HintPath>..\packages\CommandLineParser.1.9.71\lib\net45\CommandLine.dll</HintPath>
</Reference> </Reference>
<Reference Include="log4net, Version=2.0.7.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL"> <Reference Include="log4net, Version=2.0.8.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\packages\log4net.2.0.7\lib\net45-full\log4net.dll</HintPath> <HintPath>..\packages\log4net.2.0.8\lib\net45-full\log4net.dll</HintPath>
<Private>True</Private> <Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
@ -64,6 +64,7 @@
<Link>Properties\AssemblyProjectKeyInfo.cs</Link> <Link>Properties\AssemblyProjectKeyInfo.cs</Link>
</Compile> </Compile>
<Compile Include="CheckRules.cs" /> <Compile Include="CheckRules.cs" />
<Compile Include="CleanupFiles.cs" />
<Compile Include="Options.cs" /> <Compile Include="Options.cs" />
<Compile Include="Program.cs" /> <Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
<StartArguments>-r -c "8ECF90D2-1F1F-4CDD-A7C7-8E1BB3EF7105"</StartArguments> <StartArguments>-s 100 -p E:\svnlager\BSMD\nsw\HIS-NORD\Transmitter-Tool -x</StartArguments>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
<package id="CommandLineParser" version="1.9.71" targetFramework="net45" /> <package id="CommandLineParser" version="1.9.71" targetFramework="net45" />
<package id="log4net" version="2.0.7" targetFramework="net45" /> <package id="log4net" version="2.0.8" targetFramework="net45" />
</packages> </packages>

View File

@ -129,9 +129,11 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
cmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, AgentCompanyName, AgentStreetAndNumber, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
cmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, AgentCompanyName, AgentStreetAndNumber, " +
"AgentPostalCode, AgentCity, AgentCountry, AgentLastName, AgentFirstName, AgentPhone, AgentFax, " + "AgentPostalCode, AgentCity, AgentCountry, AgentLastName, AgentFirstName, AgentPhone, AgentFax, " +
"AgentEMail) VALUES (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11)", this.Tablename); "AgentEMail) VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11)", this.Tablename);
} }
else else
{ {

View File

@ -51,7 +51,9 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, ATAPortOfCall) VALUES ( @P1, @P2 )", this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, ATAPortOfCall) VALUES (@ID, @P1, @P2 )",
this.Tablename); this.Tablename);
} }
else else

View File

@ -51,7 +51,9 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, ATDPortOfCall) VALUES ( @P1, @P2 )", this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, ATDPortOfCall) VALUES (@ID, @P1, @P2 )",
this.Tablename); this.Tablename);
} }
else else

View File

@ -63,8 +63,10 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, BunkerFuelType, BunkerFuelQuantity_TNE, Identifier) " + this.CreateId();
"VALUES ( @P1, @P2, @P3, @P4 )", this.Tablename); scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, BunkerFuelType, BunkerFuelQuantity_TNE, Identifier) " +
"VALUES (@ID, @P1, @P2, @P3, @P4 )", this.Tablename);
} }
else else
{ {

View File

@ -63,8 +63,10 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, BunkerFuelType, BunkerFuelQuantity_TNE, Identifier) " + this.CreateId();
"VALUES ( @P1, @P2, @P3, @P4 )", this.Tablename); scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, BunkerFuelType, BunkerFuelQuantity_TNE, Identifier) " +
"VALUES ( @ID, @P1, @P2, @P3, @P4 )", this.Tablename);
} }
else else
{ {

View File

@ -146,10 +146,12 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, CrewMemberLastName, CrewMemberFirstName, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, CrewMemberLastName, CrewMemberFirstName, " +
"CrewMemberPlaceOfBirth, CrewMemberDateOfBirth, CrewMemberGender, CrewMemberNationality,CrewMemberIdentityDocumentType, " + "CrewMemberPlaceOfBirth, CrewMemberDateOfBirth, CrewMemberGender, CrewMemberNationality,CrewMemberIdentityDocumentType, " +
"CrewMemberIdentityDocumentId, CrewMemberVisaNumber, CrewMemberDuty, Identifier, IsDeparture) " + "CrewMemberIdentityDocumentId, CrewMemberVisaNumber, CrewMemberDuty, Identifier, IsDeparture) " +
"VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13 )", this.Tablename); "VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13 )", this.Tablename);
} }
else else
{ {

View File

@ -54,8 +54,10 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (NOA_NODId, CallPurposeCode, CallPurposeDescription, Identifier) " + this.CreateId();
" VALUES ( @P1, @P2, @P3, @P4 )", this.Tablename); scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, NOA_NODId, CallPurposeCode, CallPurposeDescription, Identifier) " +
" VALUES (@ID, @P1, @P2, @P3, @P4 )", this.Tablename);
} }
else else
{ {

View File

@ -567,7 +567,7 @@ namespace bsmd.database
entity.PrepareSave(cmd); entity.PrepareSave(cmd);
int queryResult = this.PerformNonQuery(cmd); int queryResult = this.PerformNonQuery(cmd);
this.LogNonQueryResult(cmd.CommandText, queryResult); this.LogNonQueryResult(cmd.CommandText, queryResult);
if (this._closeConnectionAfterUse) this.Disconnect(); if (this._closeConnectionAfterUse) this.Disconnect();
} }

View File

@ -175,9 +175,11 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (HAZId, ProductName, PollutionCategory, Hazards, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, HAZId, ProductName, PollutionCategory, Hazards, " +
"FlashpointInformation, Flashpoint_CEL, Quantity_KGM, StowagePosition, PortOfLoading, PortOfDischarge, " + "FlashpointInformation, Flashpoint_CEL, Quantity_KGM, StowagePosition, PortOfLoading, PortOfDischarge, " +
"SpecRef15_19, Remarks, Identifier) VALUES (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, " + "SpecRef15_19, Remarks, Identifier) VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, " +
"@P11, @P12, @P13)", this.Tablename); "@P11, @P12, @P13)", this.Tablename);
} }
else else

View File

@ -95,8 +95,10 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (HAZId, UNNumber, IMOClass, ProductName, Quantity_KGM, " + this.CreateId();
"StowagePosition, PortOfLoading, PortOfDischarge, Remarks, Identifier) VALUES (@P1, @P2, @P3, @P4, " + scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, HAZId, UNNumber, IMOClass, ProductName, Quantity_KGM, " +
"StowagePosition, PortOfLoading, PortOfDischarge, Remarks, Identifier) VALUES (@ID, @P1, @P2, @P3, @P4, " +
"@P5, @P6, @P7, @P8, @P9, @P10)", this.Tablename); "@P5, @P6, @P7, @P8, @P9, @P10)", this.Tablename);
} }
else else

View File

@ -101,9 +101,11 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (HAZId, BulkCargoShippingName, MHB, UNNumber, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, HAZId, BulkCargoShippingName, MHB, UNNumber, " +
"IMOClass, Quantity_KGM, StowagePosition, PortOfLoading, PortOfDischarge, Remarks, Identifier) " + "IMOClass, Quantity_KGM, StowagePosition, PortOfLoading, PortOfDischarge, Remarks, Identifier) " +
" VALUES (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11)", this.Tablename); " VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11)", this.Tablename);
} }
else else
{ {

View File

@ -108,9 +108,11 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, ShippingArea, RequestedPositionInPortOfCall, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, ShippingArea, RequestedPositionInPortOfCall, " +
"SpecialRequirementsOfShipAtBerth, ConstructionCharacteristicsOfShip, FumigatedBulkCargo, DeplacementSummerDraught_TNE, " + "SpecialRequirementsOfShipAtBerth, ConstructionCharacteristicsOfShip, FumigatedBulkCargo, DeplacementSummerDraught_TNE, " +
"PortArea, BowThrusterPower, SternThrusterPower, PortFacility) VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11 )", this.Tablename); "PortArea, BowThrusterPower, SternThrusterPower, PortFacility) VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11 )", this.Tablename);
} }
else else
{ {

View File

@ -154,9 +154,11 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, CargoHandlingType, CargoCodeNST, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, CargoHandlingType, CargoCodeNST, " +
"CargoNumberOfItems, CargoGrossQuantity_TNE, PortOfLoading, PortOfDischarge, Identifier, CargoLACode, CargoCodeNST_3) VALUES " + "CargoNumberOfItems, CargoGrossQuantity_TNE, PortOfLoading, PortOfDischarge, Identifier, CargoLACode, CargoCodeNST_3) VALUES " +
"( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10 )", this.Tablename); "( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10 )", this.Tablename);
} }
else else
{ {

View File

@ -93,9 +93,11 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (SEC_Id, PortFacilityPortName, PortFacilityPortCountry, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, SEC_Id, PortFacilityPortName, PortFacilityPortCountry, " +
"PortFacilityPortLoCode, PortFacilityDateOfArrival, PortFacilityDateOfDeparture, PortFacilityShipSecurityLevel, " + "PortFacilityPortLoCode, PortFacilityDateOfArrival, PortFacilityDateOfDeparture, PortFacilityShipSecurityLevel, " +
"PortFacilitySecurityMattersToReport, PortFacilityGISISCode, Identifier) VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10)", "PortFacilitySecurityMattersToReport, PortFacilityGISISCode, Identifier) VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10)",
this.Tablename); this.Tablename);
} }
else else

View File

@ -106,9 +106,11 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (HAZId, Name, FlashpointInformation, Flashpoint_CEL, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, HAZId, Name, FlashpointInformation, Flashpoint_CEL, " +
"Quantity_KGM, StowagePosition, PortOfLoading, PortOfDischarge, Remarks, Identifier) VALUES " + "Quantity_KGM, StowagePosition, PortOfLoading, PortOfDischarge, Remarks, Identifier) VALUES " +
"(@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10)", this.Tablename); "(@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10)", this.Tablename);
} }
else else
{ {

View File

@ -57,7 +57,9 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, ErrorCode, ErrorText) VALUES (@MHID, @VC, @VT)", this.Tablename); this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, ErrorCode, ErrorText) VALUES (@ID, @MHID, @VC, @VT)", this.Tablename);
} }
else else
{ {

View File

@ -54,7 +54,9 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, ViolationCode, ViolationText) VALUES (@MHID, @VC, @VT)", this.Tablename); this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, ViolationCode, ViolationText) VALUES (@ID, @MHID, @VC, @VT)", this.Tablename);
} }
else else
{ {

View File

@ -53,7 +53,9 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, NameOfMaster) VALUES ( @P1, @P2 )", this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, NameOfMaster) VALUES ( @ID, @P1, @P2 )",
this.Tablename); this.Tablename);
} }
else else

View File

@ -159,10 +159,12 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, PassengerLastName, PassengerFirstName, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, PassengerLastName, PassengerFirstName, " +
"PassengerPlaceOfBirth, PassengerDateOfBirth, PassengerGender, PassengerNationality, PassengerIdentityDocumentType, " + "PassengerPlaceOfBirth, PassengerDateOfBirth, PassengerGender, PassengerNationality, PassengerIdentityDocumentType, " +
"PassengerIdentityDocumentId, PassengerVisaNumber, PassengerPortOfEmbarkation, PassengerPortOfDisembarkation," + "PassengerIdentityDocumentId, PassengerVisaNumber, PassengerPortOfEmbarkation, PassengerPortOfDisembarkation," +
"PassengerInTransit, Identifier, IsDeparture) VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15 )", "PassengerInTransit, Identifier, IsDeparture) VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15 )",
this.Tablename); this.Tablename);
} }
else else

View File

@ -69,9 +69,11 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, TotalPersonsOnBoardUponArrival, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, TotalPersonsOnBoardUponArrival, " +
"TotalCrewMembersOnBoardUponArrival, TotalPassengersOnBoardUponArrival, " + "TotalCrewMembersOnBoardUponArrival, TotalPassengersOnBoardUponArrival, " +
"TotalStowawaysOnBoardUponArrival) VALUES (@P1, @P2, @P3, @P4, @P5)", this.Tablename); "TotalStowawaysOnBoardUponArrival) VALUES (@ID, @P1, @P2, @P3, @P4, @P5)", this.Tablename);
} }
else else
{ {

View File

@ -69,9 +69,11 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, TotalPersonsOnBoardUponDeparture, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, TotalPersonsOnBoardUponDeparture, " +
"TotalCrewMembersonBoardUponDeparture, TotalPassengersOnBoardUponDeparture, " + "TotalCrewMembersonBoardUponDeparture, TotalPassengersOnBoardUponDeparture, " +
"TotalStowawaysOnBoardUponDeparture) VALUES (@P1, @P2, @P3, @P4, @P5)", this.Tablename); "TotalStowawaysOnBoardUponDeparture) VALUES (@ID, @P1, @P2, @P3, @P4, @P5)", this.Tablename);
} }
else else
{ {

View File

@ -114,9 +114,11 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, Tanker, TankerHullConfiguration, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, Tanker, TankerHullConfiguration, " +
"ConditionCargoBallastTanks, NatureOfCargo, VolumeOfCargo, PlannedOperations, PlannedWorks, DateOfLastExpandedInspection, " + "ConditionCargoBallastTanks, NatureOfCargo, VolumeOfCargo, PlannedOperations, PlannedWorks, DateOfLastExpandedInspection, " +
"PlannedPeriodOfStay_HUR, IsDueToInspection, PossibleAnchorage) VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12 )", "PlannedPeriodOfStay_HUR, IsDueToInspection, PossibleAnchorage) VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12 )",
this.Tablename); this.Tablename);
} }
else else

View File

@ -50,8 +50,10 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
cmd.CommandText = string.Format("INSERT INTO {0} (PortOfCallLast30DaysId, PortOfCallLast30DaysCrewJoinedShipName, Identifier) " + this.CreateId();
"VALUES (@P1, @P2, @P3)" , this.Tablename); scmd.Parameters.AddWithValue("@ID", this.Id);
cmd.CommandText = string.Format("INSERT INTO {0} (Id, PortOfCallLast30DaysId, PortOfCallLast30DaysCrewJoinedShipName, Identifier) " +
"VALUES (@ID, @P1, @P2, @P3)" , this.Tablename);
} }
else else
{ {

View File

@ -62,8 +62,10 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (BPOLId, PortOfItineraryName, PortOfItineraryETA, Identifier, " + this.CreateId();
"PortOfItineraryLocode) VALUES ( @P1, @P2, @P3, @P4, @P5 )", this.Tablename); scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, BPOLId, PortOfItineraryName, PortOfItineraryETA, Identifier, " +
"PortOfItineraryLocode) VALUES ( @ID, @P1, @P2, @P3, @P4, @P5 )", this.Tablename);
} }
else else
{ {

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("3.8.11")] [assembly: AssemblyInformationalVersion("3.9.0")]
[assembly: AssemblyCopyright("Copyright © 2014-2017 schick Informatik")] [assembly: AssemblyCopyright("Copyright © 2014-2017 schick Informatik")]
[assembly: AssemblyTrademark("")] [assembly: AssemblyTrademark("")]

View File

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

View File

@ -192,9 +192,11 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (RPName, RPStreetAndNumber, RPPostalCode, RPCity, RPCountry, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, RPName, RPStreetAndNumber, RPPostalCode, RPCity, RPCountry, " +
"RPLastName, RPFirstName, RPPhone, RPFax, RPEMail, Logon, PasswordHash, Salt, Flags, EMail) VALUES " + "RPLastName, RPFirstName, RPPhone, RPFax, RPEMail, Logon, PasswordHash, Salt, Flags, EMail) VALUES " +
"( @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15, @P17 )", this.Tablename); "( @ID, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, @P12, @P13, @P14, @P15, @P17 )", this.Tablename);
} }
else else
{ {

View File

@ -72,8 +72,10 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, ServiceName, ServiceBeneficiary, " + this.CreateId();
"ServiceInvoiceRecipient, Identifier) VALUES ( @P1, @P2, @P3, @P4, @P5 )", this.Tablename); scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, ServiceName, ServiceBeneficiary, " +
"ServiceInvoiceRecipient, Identifier) VALUES ( @ID, @P1, @P2, @P3, @P4, @P5 )", this.Tablename);
} }
else else
{ {

View File

@ -276,11 +276,13 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
cmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, ShipName, CallSign, MMSINumber, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
cmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, ShipName, CallSign, MMSINumber, " +
"Flag, LengthOverall_MTR, Beam_MTR, GrossTonnage, PortOfRegistry, InmarsatCallNumber, ShipType, " + "Flag, LengthOverall_MTR, Beam_MTR, GrossTonnage, PortOfRegistry, InmarsatCallNumber, ShipType, " +
"ISMCompanyName, ISMCompanyId, ISMCompanyStreetAndNumber, ISMCompanyPostalCode, ISMCompanyCity, " + "ISMCompanyName, ISMCompanyId, ISMCompanyStreetAndNumber, ISMCompanyPostalCode, ISMCompanyCity, " +
"ISMCompanyCountry, TransportMode, NetTonnage, RegistryDate, CertificateOfRegistryNumber) " + "ISMCompanyCountry, TransportMode, NetTonnage, RegistryDate, CertificateOfRegistryNumber) " +
"VALUES (@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, " + "VALUES (@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11, " +
" @P12, @P13, @P14, @P15, @P16, @P17, @P18, @P19, @P20, @P21)", this.Tablename); " @P12, @P13, @P14, @P15, @P16, @P17, @P18, @P19, @P20, @P21)", this.Tablename);
} }
else else

View File

@ -129,8 +129,10 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, Name, Quantity, " + this.CreateId();
"QuantityUnit, LocationOnBoard, OfficialUse, Identifier) VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7 )", this.Tablename); scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, Name, Quantity, " +
"QuantityUnit, LocationOnBoard, OfficialUse, Identifier) VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7 )", this.Tablename);
} }
else else
{ {

View File

@ -96,10 +96,12 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (SEC_Id, ShipToShipActivityLocationName, ShipToShipActivityLocationLoCode, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, SEC_Id, ShipToShipActivityLocationName, ShipToShipActivityLocationLoCode, " +
"ShipToShipActivityLocationCoordinatesLatitude, ShipToShipActivityLocationCoordinatesLongitude, ShipToShipActivityDateFrom, ShipToShipActivityDateTo, " + "ShipToShipActivityLocationCoordinatesLatitude, ShipToShipActivityLocationCoordinatesLongitude, ShipToShipActivityDateFrom, ShipToShipActivityDateTo, " +
"ShipToShipActivityType, ShipToShipActivitySecurityMattersToReport, Identifier, ShipToShipActivityTypeCode) VALUES ( " + "ShipToShipActivityType, ShipToShipActivitySecurityMattersToReport, Identifier, ShipToShipActivityTypeCode) VALUES ( " +
"@P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11)", "@ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10, @P11)",
this.Tablename); this.Tablename);
} }
else else

View File

@ -49,8 +49,10 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
cmd.CommandText = string.Format("INSERT INTO {0} (IMDGPositionId, SubsidiaryRisk, Identifier) " + this.CreateId();
"VALUES (@P1, @P2, @P3)", this.Tablename); scmd.Parameters.AddWithValue("@ID", this.Id);
cmd.CommandText = string.Format("INSERT INTO {0} (Id, IMDGPositionId, SubsidiaryRisk, Identifier) " +
"VALUES (@ID, @P1, @P2, @P3)", this.Tablename);
} }
else else
{ {

View File

@ -135,8 +135,10 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (ErrorAt, MeldeType, ReferenceId, ProcessStatus, ImportFilename, ErrorCode, ErrorMessage, ErrorDescription, MessageCoreId, Status, MessageHeaderId) " + this.CreateId();
"VALUES (@EAT, @MT, @REFID, @PS, @IF, @EC, @EM, @ED, @MCID, @STATUS, @MHID)", this.Tablename); scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, ErrorAt, MeldeType, ReferenceId, ProcessStatus, ImportFilename, ErrorCode, ErrorMessage, ErrorDescription, MessageCoreId, Status, MessageHeaderId) " +
"VALUES (@ID, @EAT, @MT, @REFID, @PS, @IF, @EC, @EM, @ED, @MCID, @STATUS, @MHID)", this.Tablename);
} }
else else
{ {

View File

@ -24,7 +24,7 @@ namespace bsmd.database
#region Properties #region Properties
[ShowReport] [ShowReport]
[Validation(ValidationCode.DRAUGHT_IMPLAUSIBLE)] [Validation(ValidationCode.NOT_NULL)]
[LookupName("TIEFA.DraughtUponArrival_DMT")] [LookupName("TIEFA.DraughtUponArrival_DMT")]
[ENI2Validation] [ENI2Validation]
public double? DraughtUponArrival_DMT { get; set; } public double? DraughtUponArrival_DMT { get; set; }
@ -51,7 +51,9 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, DraughtUponArrival_DMT) VALUES ( @P1, @P2 )", this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, DraughtUponArrival_DMT) VALUES ( @ID, @P1, @P2 )",
this.Tablename); this.Tablename);
} }
else else

View File

@ -25,7 +25,7 @@ namespace bsmd.database
#region Properties #region Properties
[ShowReport] [ShowReport]
[Validation(ValidationCode.DRAUGHT_IMPLAUSIBLE)] [Validation(ValidationCode.NOT_NULL)]
[LookupName("TIEFD.DraughtUponDeparture_DMT")] [LookupName("TIEFD.DraughtUponDeparture_DMT")]
[ENI2Validation] [ENI2Validation]
public double? DraughtUponDeparture_DMT { get; set; } public double? DraughtUponDeparture_DMT { get; set; }
@ -52,7 +52,9 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, DraughtUponDeparture_DMT) VALUES ( @P1, @P2 )", this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, DraughtUponDeparture_DMT) VALUES ( @ID, @P1, @P2 )",
this.Tablename); this.Tablename);
} }
else else

View File

@ -149,12 +149,14 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, TowageOnArrivalName, TowageOnArrivalFlag, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, TowageOnArrivalName, TowageOnArrivalFlag, " +
"TowageOnArrivalOperatorCompanyName, TowageOnArrivalOperatorStreetNameAndNumber, TowageOnArrivalOperatorPostalCode, " + "TowageOnArrivalOperatorCompanyName, TowageOnArrivalOperatorStreetNameAndNumber, TowageOnArrivalOperatorPostalCode, " +
"TowageOnArrivalOperatorCity, TowageOnArrivalOperatorCountry, TowageOnArrivalOperatorPhone, " + "TowageOnArrivalOperatorCity, TowageOnArrivalOperatorCountry, TowageOnArrivalOperatorPhone, " +
"TowageOnArrivalOperatorFax, TowageOnArrivalOperatorEmail, TowageOnArrivalGrossTonnage, " + "TowageOnArrivalOperatorFax, TowageOnArrivalOperatorEmail, TowageOnArrivalGrossTonnage, " +
"TowageOnArrivalLengthOverall_MTR, TowageOnArrivalBeam_MTR, TowageOnArrivalPurposeOfCall, " + "TowageOnArrivalLengthOverall_MTR, TowageOnArrivalBeam_MTR, TowageOnArrivalPurposeOfCall, " +
"TowageOnArrivalDraught_DMT, TowageOnArrivalRemarks, Identifier) VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, " + "TowageOnArrivalDraught_DMT, TowageOnArrivalRemarks, Identifier) VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, " +
"@P9, @P10, @P11, @P12, @P13, @P14, @P15, @P16, @P17, @P18 )", this.Tablename); "@P9, @P10, @P11, @P12, @P13, @P14, @P15, @P16, @P17, @P18 )", this.Tablename);
} }
else else

View File

@ -133,12 +133,14 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (MessageHeaderId, TowageOnDepartureName, TowageOnDepartureFlag, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, MessageHeaderId, TowageOnDepartureName, TowageOnDepartureFlag, " +
"TowageOnDepartureOperatorCompanyName, TowageOnDepartureOperatorStreetNameAndNumber, TowageOnDepartureOperatorPostalCode, " + "TowageOnDepartureOperatorCompanyName, TowageOnDepartureOperatorStreetNameAndNumber, TowageOnDepartureOperatorPostalCode, " +
"TowageOnDepartureOperatorCity, TowageOnDepartureOperatorCountry, TowageOnDepartureOperatorPhone, " + "TowageOnDepartureOperatorCity, TowageOnDepartureOperatorCountry, TowageOnDepartureOperatorPhone, " +
"TowageOnDepartureOperatorFax, TowageOnDepartureOperatorEmail, " + "TowageOnDepartureOperatorFax, TowageOnDepartureOperatorEmail, " +
"TowageOnDepartureLengthOverall_MTR, TowageOnDepartureBeam_MTR, " + "TowageOnDepartureLengthOverall_MTR, TowageOnDepartureBeam_MTR, " +
"TowageOnDepartureDraught_DMT, TowageOnDepartureRemarks, Identifier) VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, " + "TowageOnDepartureDraught_DMT, TowageOnDepartureRemarks, Identifier) VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, " +
"@P9, @P10, @P11, @P12, @P13, @P14, @P15, @P16 )", this.Tablename); "@P9, @P10, @P11, @P12, @P13, @P14, @P15, @P16 )", this.Tablename);
} }
else else

View File

@ -137,9 +137,7 @@ namespace bsmd.database
isDK = core.PoC.StartsWith("DK"); isDK = core.PoC.StartsWith("DK");
foreach (Message.NotificationClass notificationClass in Enum.GetValues(typeof(Message.NotificationClass))) foreach (Message.NotificationClass notificationClass in Enum.GetValues(typeof(Message.NotificationClass)))
{ {
if (messageDict.ContainsKey(notificationClass)) continue;
if(isDE) if(isDE)
{ {
if ((notificationClass == Message.NotificationClass.CREWD) || if ((notificationClass == Message.NotificationClass.CREWD) ||
@ -159,17 +157,28 @@ namespace bsmd.database
if (core.IsTransit && (notificationClass == Message.NotificationClass.VISIT)) continue; if (core.IsTransit && (notificationClass == Message.NotificationClass.VISIT)) continue;
if (!core.IsTransit && (notificationClass == Message.NotificationClass.TRANSIT)) continue; if (!core.IsTransit && (notificationClass == Message.NotificationClass.TRANSIT)) continue;
Message message = new Message(); Message message = null;
if (user != null)
message.CreatedBy = string.Format("ENI-2: {0}", user.Logon);
message.MessageCore = core;
message.MessageCoreId = core.Id;
message.MessageNotificationClass = notificationClass;
// abgesehen von "Listen" für die Nachrichtenklassen auch untergeordnete Elemente erzeugen if (!messageDict.ContainsKey(notificationClass))
DatabaseEntity classElement = null;
if (!Message.IsListClass(notificationClass))
{ {
message = new Message();
if (user != null)
message.CreatedBy = string.Format("ENI-2: {0}", user.Logon);
message.MessageCore = core;
message.MessageCoreId = core.Id;
message.MessageNotificationClass = notificationClass;
DBManager.Instance.Save(message);
result.Add(message);
}
else
{
message = messageDict[notificationClass];
}
// abgesehen von "Listen" für die Nachrichtenklassen auch untergeordnete Elemente erzeugen, falls nicht vorhanden!
DatabaseEntity classElement = null;
if (!Message.IsListClass(notificationClass) && (message.Elements.Count == 0))
{
classElement = DBManager.CreateMessage(notificationClass); classElement = DBManager.CreateMessage(notificationClass);
// CH: 6.10.17: Für die manuelle Eingabe (wird leider nicht ganz auszuschließen sein) wäre es hilfreich, wenn alle Checkboxen nicht leer sind, sondern False beinhalten. // CH: 6.10.17: Für die manuelle Eingabe (wird leider nicht ganz auszuschließen sein) wäre es hilfreich, wenn alle Checkboxen nicht leer sind, sondern False beinhalten.
@ -177,17 +186,13 @@ namespace bsmd.database
{ {
((MDH)classElement).SetBoolsToFalse(); ((MDH)classElement).SetBoolsToFalse();
} }
} if (classElement != null) // null für Visit/Transit
{
DBManager.Instance.Save(message); classElement.MessageHeader = message;
DBManager.Instance.Save(classElement);
if (classElement != null) // null für Visit/Transit/List message.Elements.Add(classElement);
{ }
classElement.MessageHeader = message; }
DBManager.Instance.Save(classElement);
message.Elements.Add(classElement);
}
result.Add(message);
} }
} }
return result; return result;

View File

@ -202,11 +202,11 @@ namespace bsmd.database
switch (this.ConditionOperator) switch (this.ConditionOperator)
{ {
case ConditionOperatorEnum.EQUAL: case ConditionOperatorEnum.EQUAL:
result = val.ToString().Equals(this.Value); result = (val ?? "").ToString().Equals(this.Value);
break; break;
case ConditionOperatorEnum.NOT_EQUAL: case ConditionOperatorEnum.NOT_EQUAL:
result = !val.ToString().Equals(this.Value); result = !(val ?? "").ToString().Equals(this.Value);
break; break;
case ConditionOperatorEnum.LESS: case ConditionOperatorEnum.LESS:
//result = val.ToString() < this.Value; //result = val.ToString() < this.Value;

View File

@ -340,7 +340,8 @@ namespace bsmd.database
if (field.NotificationClass.HasValue) if (field.NotificationClass.HasValue)
{ {
// Feld gehört zu einer Liste auf "Top-Level" Ebene // Feld gehört zu einer Liste auf "Top-Level" Ebene
_lookupListDict.Add(field, messageLookup[field.NotificationClass.Value].Elements.Cast<object>().ToList()); if(messageLookup.ContainsKey(field.NotificationClass.Value))
_lookupListDict.Add(field, messageLookup[field.NotificationClass.Value].Elements.Cast<object>().ToList());
} }
else else
{ {

View File

@ -144,10 +144,12 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (WASId, WasteType, WasteDescription, " + this.CreateId();
scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, WASId, WasteType, WasteDescription, " +
"WasteDisposalAmount_MTQ, WasteCapacity_MTQ, WasteAmountRetained_MTQ, WasteDisposalPort, " + "WasteDisposalAmount_MTQ, WasteCapacity_MTQ, WasteAmountRetained_MTQ, WasteDisposalPort, " +
"WasteAmountGeneratedTillNextPort_MTQ, WasteDisposedAtLastPort_MTQ, Identifier) " + "WasteAmountGeneratedTillNextPort_MTQ, WasteDisposedAtLastPort_MTQ, Identifier) " +
" VALUES ( @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10 )", this.Tablename); " VALUES ( @ID, @P1, @P2, @P3, @P4, @P5, @P6, @P7, @P8, @P9, @P10 )", this.Tablename);
} }
else else
{ {

View File

@ -54,8 +54,10 @@ namespace bsmd.database
if (this.IsNew) if (this.IsNew)
{ {
scmd.CommandText = string.Format("INSERT INTO {0} (WASId, WasteDisposalServiceProviderName, WasteDisposalDelivery, Identifier) " + this.CreateId();
"VALUES ( @P1, @P2, @P3, @P4 )", this.Tablename); scmd.Parameters.AddWithValue("@ID", this.Id);
scmd.CommandText = string.Format("INSERT INTO {0} (Id, WASId, WasteDisposalServiceProviderName, WasteDisposalDelivery, Identifier) " +
"VALUES ( @ID, @P1, @P2, @P3, @P4 )", this.Tablename);
} }
else else
{ {

View File

@ -146,7 +146,7 @@ namespace bsmd.database
} }
} }
if (Message.IsListClass(message.MessageNotificationClass) && (message.Elements.Count == 0)) if (Message.IsListClass(message.MessageNotificationClass) && (message.Elements.Count == 0) && (!message.Reset))
{ {
message.StatusInfo = "empty list message type"; message.StatusInfo = "empty list message type";
return false; return false;

Binary file not shown.